1,005 karma · joined Mar 31, 2020 (6y ago) · 374 submissions
comment 4y ago · link · parent
I like that feature a lot, but the big one I'm waiting for is Quick Connect on the Roku app so I don't need to choose between highly secure passwords and the ability to get logged into a device in a reasonable timeframe
Also keeping an eye on Dim. It's nice to see new projects popping up in this space.
comment 4y ago · link · parent
Would I take a job that required me to be in the office every day? Almost definitely not. Would I sacrifice a bit of pay if it meant working for a company local enough that I could go to the office 1-2 days a week? Probably.
That would really be the sweet spot for me. I like working from home a lot, but being a fully remote team wears on you. I've considered taking a part time bartending job just to satisfy the desire to have in-person coworkers a bit of time a week.
comment 4y ago · link · parent
func()? desugars to (more or less)
match func() {
Ok(v) => v,
Err(e) => return Err(e.into())
}
I'm also not really sure what the complaint is. Go doesn't do any more implicit type conversion than Rust does. There are numerous solid arguments for Go over Rust, but error handling and automatic type punning aren't on the list.comment 4y ago · link · parent
Even when you have to box a variant to avoid inflating the size of the whole enum, that's still an improvement over a `dyn Trait` - it involves half as much pointer chasing
It'd be cool to see this added as a compiler optimization - even for cases where the author of an interface can't possibly know all variants (e.g. you have a `pub fn` that accepts a `&dyn MyTrait`), the compiler can
comment 4y ago · link · parent
- You can panic trivially with `.unwrap()`
- You can propagate the condition up trivially with `?`
- `?` doesn't work with all types, but it does work with Option, and it does work with the vast majority of error types - making your custom error work with it is very easy (if you're whipping up an application or prototype and want your error handling very simple, `anyhow::Error` works great here)
- You can convert None to an Err condition trivially with `.ok_or()?`
- In cases where it makes sense, you can trivially use a default value with `.unwrap_or_default()`
And all of these use require a _lot_ less code than `if err != nil { return nil, err }`And all of these allow you to use the Ok/Some value directly in a function call, or in a method chain, while still enabling the compiler to force you to handle the Err/None case
The common theme here being "trivial" :) Result/Option are a big piece of that better developer experience.
comment 4y ago · link · parent
I expect it would require a fair amount of tuning to become useful, but could be based on something analogous to the function inliner's cost model, along with number of calls per type. Could possibly be most useful as a PGO type step, where real-world call frequency with each concrete type is considered.
comment 4y ago · link · parent
If there are specialization opportunities when hand-implementing the function for a given concrete type, I would indeed expect that to be faster than a monomorphized generic function.
comment 4y ago · link · parent
This was a major reason that AMD was able to price Ryzen so aggressively even at the high end - a high-end CPU is just made of more of the same small dies used in low-end CPUs, albeit requiring a better bin, instead of having to make a much larger single die.
The constant defect rate isn't typically a correct assumption across different products (e.g. different CPU or GPU dies) - different feature designs will have differing defect rates. Maybe Apple was able to design the M1 Ultra's features so that defect rate is very very low, though - I don't really know much about that silicon.
comment 4y ago · link · parent
In case anybody wants to go down the rabbit hole of shit you should definitely not use in production (but we did anyway), this was my starting point: https://words.filippo.io/rustgo/
I did not, however, `no_std` or avoid heap allocation on the Rust side. Everything worked great, including running a multithreaded tokio runtime.
Still do not recommend in prod ;)
comment 4y ago · link · parent
Restated: You aren't arrogant because you disagree with me. You're arrogant because the things you say and the way you say them are arrogant.
comment 4y ago · link · parent
[citation needed]
> there are plenty of people willing to think differently and reap the benefits
"Reap the benefits" is, again, subjective. It's something you like, not something objectively beneficial or worth the trade-offs in all, most, or even necessarily many projects.
This is precisely the unduly arrogant attitude amongst Gophers that others have already mentioned several times in this thread.