Live data from Hacker News

Is Rust Web Yet?

arewewebyet.org

71–80 of 183 posts

Re: Is Rust Web Yet?

#71
I've spent the last few months porting the guts of a 100 KLOC PHP command-line utility I wrote to Rust. Thanks to the wonderful Rust documentation it's been a mostly painless endeavour.

What I've gained as a result:

- execution speed (about 3x faster, single-threaded)

- better-documented data structures

Things I've lost:

- ease of iteration

- concise, readable code

- really smart type inference

- a bunch of time thinking about the borrow checker

Quick iteration and concise readable code are much more important in web-land than in system programming land, and those are key reasons why I don't think many will be abandoning interpreted langauges for Rust.

I sometimes wonder whether people adopt Rust/Haskell/ReasonML for front-end work because they want it to feel like more of an effort than it otherwise would.

Re: Is Rust Web Yet?

#72

Can some explain why I always get cult like vibes from the rust community?

Because Rust has a vocal community and that noise far over represents its usage here on HN. People aren’t searching for Rust much: https://trends.google.com/trends/explore?q=%2Fm%2F0dsbpg6,%2... Because it’s not a popular language, cobol and prolog are more popular: https://www.tiobe.com/tiobe-index/ And yet hardly a day goes by without a rust story on hn and for the past 5 years it’s scored most loved language on th…

Wasn't there an article on here the other day talking about how Rust will never make it into the kernel as-is? The sentiment seemed to be that the kernel developers simply reject the idea of packaged code and many of the modern paradigms in Rust. I only had a chance to skim it but it made it sound like Rust in the kernel would be forced/relegated to a very different usage and style compared to the way it is written elsewhere.

Re: Is Rust Web Yet?

#73

I spent about the past month learning rust - and decided it just wasn't a usable language for me. I think what it comes down to is that I'm just not that into bondage and discipline from a compiler. Yes, I know, it's trying to make my code 'safe', and I'm horribly cavalier and I should feel bad, but: 1. the borrow checker rejects valid programs, has a lot of corner cases it can't catch, and is in active development 2…

No post body was provided.

Re: Is Rust Web Yet?

#74
post #6
post #5

How do you debug rust code that has been compiled to we assembly?

Source maps I suppose.

They still don't work very well if you use wasm-bindgen: https://github.com/rustwasm/wasm-bindgen/issues/2389 (consider voting for it).

P.S. It's very hard to work without wasm-bindgen, since you have to wrap browser API manually otherwise.

Re: Is Rust Web Yet?

#75
post #71

I've spent the last few months porting the guts of a 100 KLOC PHP command-line utility I wrote to Rust. Thanks to the wonderful Rust documentation it's been a mostly painless endeavour. What I've gained as a result: - execution speed (about 3x faster, single-threaded) - better-documented data structures Things I've lost: - ease of iteration - concise, readable code - really smart type inference - a bunch of time thin…

My company has its code basically split in half between Python and Rust. Our Python code uses mypy pretty aggressively. The iteration speed difference is... drastic. Rust far outshines Python in terms of our ability to get something done, maintain it, and iterate on it over time.

Re: Is Rust Web Yet?

#76

I spent about the past month learning rust - and decided it just wasn't a usable language for me. I think what it comes down to is that I'm just not that into bondage and discipline from a compiler. Yes, I know, it's trying to make my code 'safe', and I'm horribly cavalier and I should feel bad, but: 1. the borrow checker rejects valid programs, has a lot of corner cases it can't catch, and is in active development 2…

> the borrow checker rejects valid programs That's Godel's incompleteness theorem for you. Every static type checker also rejects valid programs, but that doesn't make them any less useful. Just one of those inconvenient facts about our universe.

I think it's more of a Rice's theorem/ halting problem issue than an incompleteness theorem issue.

Re: Is Rust Web Yet?

#77

> "Yes! And it's freaking fast!" They're surely not talking about compilation times. Admittedly it's been a few years since I tried to build a web stack in Rust, but I felt like I was back in the 1990s dealing with the long compile times on modern hardware. Diesel was such a nightmare to use. It was poorly documented, and took a long time to compile even trivial example projects.

Compile times are still pretty bad, I recently upgraded from a pretty-new laptop to a blazing-fast desktop (12900K) just for Rust development. But at least they're acceptable now: using the mold linker, incremental builds take 1-2s on a large (~450 crate) project.

I agree that there's a lot more work to do before Rust development is pleasant on average hardware. Does anyone know if Cranelift is still going anywhere?

Re: Is Rust Web Yet?

#78

I spent about the past month learning rust - and decided it just wasn't a usable language for me. I think what it comes down to is that I'm just not that into bondage and discipline from a compiler. Yes, I know, it's trying to make my code 'safe', and I'm horribly cavalier and I should feel bad, but: 1. the borrow checker rejects valid programs, has a lot of corner cases it can't catch, and is in active development 2…

Just curious, what was your programming background. Have you used C++ a lot especially “modern C++”? I find that as a C++ programmer, Rust encodes in the compiler a lot of best practices about ownership and memory management. Using Rust is a breath of fresh air in not having to worry about dangling references. From experience programming C++, I can see what the error messages are trying to prevent and why it is impor…

I had a stint as a C++14 programmer, and I switched over to C++20 for this project.

You covered the downsides pretty well, big upsides for C++:

- ability to use C libraries directly - and thus original C API docs. I've got battlescars from NPMs deep dependency trees, and cargo is a similar story.

- I don't need the (very patient and knowledgeable!) people on rust discord to hold my hand every day. There's a stackoverflow for almost every C++ issue.

- that 5% edge case where the codes safe but the borrow checker isn't happy I can just write. No RefCell or nightly compiler.

Re: Is Rust Web Yet?

#79

I spent about the past month learning rust - and decided it just wasn't a usable language for me. I think what it comes down to is that I'm just not that into bondage and discipline from a compiler. Yes, I know, it's trying to make my code 'safe', and I'm horribly cavalier and I should feel bad, but: 1. the borrow checker rejects valid programs, has a lot of corner cases it can't catch, and is in active development 2…

I agree with this. My experience was that the learning curve for Rust has a huge kink in it right where the borrow checker is.

Type checkers provide tools that make it comparatively easier to ignore when they could be wrong or are getting in the way. To do something in a type-safe manner often doesn’t require re-abstracting behavior.

Re: Is Rust Web Yet?

#80
post #57

Earlier quoted context omitted.

Not that I think those metrics are all that relevant, but can someone explain to me how just-js ranks so highly? Very much defying my expectations in comparison with some of the top representatives of compiled languages.

Not sure, but it’s pretty funny how the most popular frameworks (rails, Django, flask, laravel, etc) are way at the bottom with 3% the score of the winner. Apparently async db requests and batching transactions are the key to winning on that benchmark: https://news.ycombinator.com/item?id=24315512 I wish more benchmarks would produce latency vs requests/second curves in microseconds. I bet the latency is massive due…

There fortune test is weight 1.5 while others are weighted at 1 or .75.
Post reply on HN