Better HN
topnewbestaskshowjobs
Log inSign up

mcronce

1,005 karma · joined Mar 31, 2020 (6y ago) · 374 submissions

Submissions

comment 4y ago · link · parent

> Once Jellyfin gets intro skipping I think I'll be switching.

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

I'm with you. I definitely miss having an office to go to.

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

Class actions do virtually nothing to make individuals whole.

comment 4y ago · link · parent

Not that that stops companies from making you believe arbitrary modifications will wholesale void your warranty.

The crackdown on "warranty void if removed" stickers is better than nothing, but your rights don't mean a thing if you don't know you have them.

comment 4y ago · link · parent

Even transforming an error is taken care of by ?

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

"Worse than" lol

comment 4y ago · link · parent

To be fair, "because the market will pay it" is entirely the correct answer. It's certainly not interesting, but it is correct

comment 4y ago · link · parent

Why would that be awful?

comment 4y ago · link · parent

FWIW, I'm fairly sure this is the assembly syntax used by Go - the author may not have made a decision to use this vs another

comment 4y ago · link · parent

I do it frequently. It is indeed easy

comment 4y ago · link · parent

I'm a huge fan. It's very little work to use, as long as all variants can be known to the author, and as long as you aren't in a situation where uncommon variants drastically inflate the size of your common variants, it's a performance win, often a big one, compared to a boxed trait object.

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

Are Result and Option really the only thing? Because nesting scopes based on Err/None is rarely the right choice, just like nesting a scope based on `if err == nil` isn't typically something you want to do in Go, or `if errno == 0` in C

  - 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

You're definitely right. While it's not a particularly common problem, it does exist; one thing I'd really like to see enter the compiler world is an optimization step to use vtable dispatch (or something akin to Rust's enum_dispatch, since all concrete types should be knowable at compile time) in these cases.

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

What, specifically, do you mean when you say Rust is "awful to work with"? With C and C++ I agree, but I've had a drastically better development experience in Rust than Go.

comment 4y ago · link · parent

The point is they shouldn't be slower than a manually-copied implementation for that concrete type. They also should be faster than vtable dynamic dispatch in the vast majority of cases. (I also fail to see a compelling reason that they couldn't have been implemented by passing the fat pointer directly, making the codegen the same as passing an interface, instead of having that business with the extra layer of indirection.)

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

Zen 4 is reported to have AVX-512 support. I'm not sure if that'll be included on Ryzen or not, though; only Epyc is "confirmed" as far as I know.

comment 4y ago · link · parent

Lots of things are amoral but not illegal. I also don't think anybody above you claimed it was illegal.

comment 4y ago · link · parent

That makes a lot of sense. The Max is still pretty fucking big, but two of those is a lot more manageable than a single monolothic die double the size

comment 4y ago · link · parent

It's generally superlinear due to yield effects - this is a bit oversimplified, but in particular, with lithography defects being more or less randomly placed throughout the wafer, a defect in a 100mm2 die impacts a far smaller percentage of the dies in the wafer than a defect in an 800mm2 die. Assuming a constant defect rate per wafer, you'll end up with drastically less usable wafer area with large dies than with small ones.

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

There are a couple solid summaries in that thread based on my experience going through that exercise - thanks for the link

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

I did this once trying to mitigate Go's FFI performance cost. It wasn't great but it wasn't awful either. If I had to do it again I'd generate the assembly trampolines.

comment 4y ago · link · parent

I'm using a Freestyle (still) and it's a pretty great keyboard. I was very surprised to discover it uses membrane switches; they've got a great feel. I only wish I could (easily) replace the cable connecting the halves and move them a bit farther apart.

comment 4y ago · link · parent

There's not really any further way to "actually explain" that, often, when a person says something, context matters and it isn't universally applicable.

I'm not even sure why I'm having to explain this. It's is a pretty obvious thing.

comment 4y ago · link · parent

"Meeting at X" means exactly what it always meant. The only difference made by removing timezones is that you don't need to adjust the time for remote dial-ins. 2PM becomes 2PM everywhere.

comment 4y ago · link · parent

Why wouldn't it make sense "ever" in any part of the world?

comment 4y ago · link · parent

> Switch to UTC and now the idea of the sun rising between 5-7 AMish is ruined

And this idea is critically important because?

comment 4y ago · link · parent

They already don't make sense when you're trying to coordinate communication with people more than a few timezones away

comment 4y ago · link · parent

lol...you even take criticism arrogantly. Impressive. It wasn't a personal attack, it was a statement of fact, but thanks for making my point even more clearly for me - not only in your response to that, but in your assertion that your opinion based on your experience is fact. Appreciated.

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

Because not all statements apply to all situations.

comment 4y ago · link · parent

> there’s pretty wide consensus even among Go detractors about these qualities

[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.

1
910111213