Better HN
topnewbestaskshowjobs
Log inSign up

TwentyPosts

569 karma · joined Nov 28, 2022 (3y ago) · 183 submissions

Submissions

comment 2y ago · link · parent

Thank you, this was a very insightful blog post!

comment 2y ago · link · parent

`async` is neither multi-threaded nor single-threaded by default. It all depends on the underlying runtime.

Rust's Tokio runtime, for example, is multi-threaded by default and makes progress on several tasks at the same time by using multiple threads.

comment 2y ago · link · parent

> Threads are far more heavy than async

This sounds like an issue with the implementation of threads and scheduling in common operating systems, and I don't see how replicating all that functionality inside of each sufficiently large programming language is remotely taken seriously.

But also, you didn't respond to what I even said. You claimed that async is 'beautiful and natural'. I disagreed. You...fell back to a performance claim that's uncontroversially true, but irrelevant to what I said.

comment 2y ago · link · parent

Is it really though? All I personally care for when it comes to "doing multiple things at the same time" is frankly Rust's scoped threads API: Create N threads, have them perform some computations, then join them at the end of the scope.

How is this not more natural than creating various state machines and passing around all sorts of weird highly abstract Future-objects?

comment 2y ago · link · parent

No? How does that even follow? That a standard should codify common expectations insofar possible (without breaking rigor) is irrelevant to whether you "should" only use standardized languages or not.

comment 2y ago · link · parent

>Pixel camera was underwhelming

Are we looking at the same phone? Everyone I know loved the camera and I could've sworn it came out on top in that one phone camera elo ranking

comment 2y ago · link · parent

Seeing that the last time I tried to use Zig–completely inexperienced, trying to do completely basic stuff–I hit a compiler bug within two hours, I'd say that "not ready" is about right.

To be fair, the latest Github version had the bug already fixed, but it's still a sign the language is basically still in an alpha stage.

comment 2y ago · link · parent

Please, anything but that.

I find it hard not to view stuff like this as a "if Rust gets to be in the kernel, then so should C++!".

comment 2y ago · link · parent

Do you have any source for this? This would be quite shocking for me, if true.

comment 2y ago · link · parent

Granted, it's been long enough I don't even quite remember the exact issues I had, so take it with a grain of salt. It was definitely primarily weird edge cases, and might've been related to plugin use.

This is one area where NeoVim afaik comes out on top: Vimscript isn't fast, and NeoVim allows Lua plugins via the embedded LuaJit, and those should be significantly faster.

comment 2y ago · link · parent

At the same time, NeoVim lacks many, many of Helix' features unless you use plugins. That's fine, of course, plugins and customization are part of what makes NeoVim so great.

Anyway, can you name a few NeoVim features you miss in Helix? I still use NeoVim now and then, so I'd be happy to learn more, even if it's something small.

comment 2y ago · link · parent

Even the suggestion that vim is fast is funny to me.

Vim feels sluggish compared to NeoVim.

NeoVim feels sluggish compared to Helix.

comment 2y ago · link · parent

Damn, I wish I had known about this earlier.

comment 2y ago · link · parent

I guess my hope was that the program would just terminate immediately the instant it tries to throw an exception while -fno-exceptions is set, thus ideally preventing any further action from the program.

comment 2y ago · link · parent

Well, my hope was that we'd have a guarantee that the program is in fact just going to terminate, and the process is going to die.

That's probably not great and might leave data in a bad shape, but it seems better than "undefined behavior" aka no guarantees whatsoever, no?

comment 2y ago · link · parent

Could you elaborate on that? I'd love to see an example of this. Are you saying that even relatively simple code (using eg. std::vector) could easily cause UB if -fno-exceptions is enabled?

comment 2y ago · link · parent

Were these blind tests?

comment 2y ago · link · parent

It's laughably easy to grab a temporary e-mail and set up a throwaway account in just a few minutes. I did it for Twitter just a few weeks ago, even.

Surely someone on HN is capable of gritting their teeth here, and understands that Eric doesn't want to have to set-up a whole account and e-mail verification system.

comment 3y ago · link · parent

"coproduct type"

comment 3y ago · link · parent

Convenience instead of historical baggage, maybe?

comment 3y ago · link · parent

Bard is honestly fine, I think? It wasn't particularly impressive when they first rolled it out, that probably had a significant impact on peoples' perception.

comment 3y ago · link · parent

Still not sure what the "killer feature" here is. Is there even one? Or is it just "something like vs code but in Rust and faster and slicker"?

I'd give it a try, but I am very happy using Helix, which is pretty novel in its own right.

comment 3y ago · link · parent

Clearly they should not have passed linear algebra without this understanding, and you're free to fail then if they didn't personally manage to correct for it by the end of the term.

comment 3y ago · link · parent

...There's sexual torture content in Blindsight? Or in his short stories? Having read several of them, I really don't remember anything like that. Can you note some examples?

comment 3y ago · link · parent

To flip the question on its head, why bother with C++ when you can use Rust?

comment 3y ago · link · parent

Fwiw I don't remember seeing that many posts for Cosmic DE here. In fact, it's the first time it really stands out to me. Maybe I forget, could definitely be the case.

Either way, looks like a cool project? I don't quite get the pitch yet, but sure, looks cool

comment 3y ago · link · parent

Absolutely powerful move.

How did this play out after that for you? Or him, for that matter, if you know.

comment 3y ago · link · parent

>not all functions always need their error checked - as an obvious example, fmt.Println.

I agree, but a lot of other languages handle this much better. In Rust (predictably!) you receive a Result type, and if you don't want to check the error you either .unwrap() it or apply the ? operator to pass it up.

I feel like making "let's not check this error" explicit rather than implicit would be an improvement. Currently in Go it's impossible to tell whether someone forgot to check an error, or if they omitted the check intentionally.

As an aside: I feel like if you are ever in a situation in which fmt.Println returns an error, then whatever situation you are in is already far, far beyond saving. Maybe fmt.Println should just panic on an error, that seems better than output silently being dropped!

comment 3y ago · link · parent

Do you have any evidence for this? Seems like a pretty severe accusation.

comment 3y ago · link · parent

> Things like dynamically updated graphs are nearly impossible to write in Rust Just curious, have you tried to handroll these, or have you used libraries? (eg. petgraph, though I don't know if it'd suit your usecases.)

I'm a Rust connoisseur, but I'd agree with 'nearly impossible to write', which is why I'd (first of all) try to grab a library, assuming I'm doing anything complicated with graphs. If it's very simple and specific, I'd try to go through the list of possible graph representations (eg. adjacency lists), and pick a suitable one, but never store nodes directly, rather store indices (while the nodes are stored in some sort of vector).

1234567