Live data from Hacker News

Is Rust Web Yet?

arewewebyet.org

61–70 of 183 posts

Re: Is Rust Web Yet?

#61

Earlier quoted context omitted.

> the borrow checker rejects valid programs Yup, this is the tradeoff you have to make to catch the wide variety of bugs. For personal use, probably not worthwhile, but it definitely pays off for the safety it provides in production contexts. The way I view Rust's philosophy is "it's better to catch bugs at the compile stage than at the execution stage".

One charitable way to view Rust's philosophy is that it's better to catch bugs at the compile stage than at the execution stage. In theory yes. In practice, getting to the execution stage was such a slog that it rarely happened. Would have liked it a lot better if the borrow checker had the option to be -Wall instead of -Werror.

Out of curiosity, what are your preferred language(s) to write in, and what sort of software were you trying to write?

> Would have liked it a lot better if the borrow checker had the option to be -Wall instead of -Werror.

Wouldn’t this defeat the purpose of the borrow checker and remove the guarantees the language gives you?

Re: Is Rust Web Yet?

#62

Earlier quoted context omitted.

> the borrow checker rejects valid programs Yup, this is the tradeoff you have to make to catch the wide variety of bugs. For personal use, probably not worthwhile, but it definitely pays off for the safety it provides in production contexts. The way I view Rust's philosophy is "it's better to catch bugs at the compile stage than at the execution stage".

One charitable way to view Rust's philosophy is that it's better to catch bugs at the compile stage than at the execution stage. In theory yes. In practice, getting to the execution stage was such a slog that it rarely happened. Would have liked it a lot better if the borrow checker had the option to be -Wall instead of -Werror.

[deleted]

Re: Is Rust Web Yet?

#63

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

However, if your experience was primarily with managed/garbage collected languages, a lot of the Rust compiler pedantry is stuff that you never had to worry about to being with and you have never experienced the pain it is trying to prevent.

Re: Is Rust Web Yet?

#64
post #2

We’ve been able to build a mobile/web hybrid ride-sharing app using Yew/GraphQL. A robot Lego-like 3D builder, with Yew interop with ThreeJS. And a full 3D web game with Yew hosting a Bevy game. Everything packed with trunk. It’s still a bit rough around the edges but the Rust benefits more than makes up for it.

The api and cli of https://mayhem4api.forallsecure.com/ are written in Rust. Still using react on frontend with REST api written with actix.

Re: Is Rust Web Yet?

#65

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 Yup, this is the tradeoff you have to make to catch the wide variety of bugs. For personal use, probably not worthwhile, but it definitely pays off for the safety it provides in production contexts. The way I view Rust's philosophy is "it's better to catch bugs at the compile stage than at the execution stage".

That's been every language's philosophy for generations. (Obviously, some languages do a better job of it than others).

Re: Is Rust Web Yet?

#66

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.

Re: Is Rust Web Yet?

#67
post #8

> Yes! And it's freaking fast! Going by these benchmarks (click around to find your own use case) Rust is definitely fast, but not (much) faster than many other languages, including Javascript. https://www.techempower.com/benchmarks/#section=data-r20&hw=... When it comes to JSON serializers, there is a Java framework that is faster than Rust, which is interesting to say the least. When you start comparing actual full…

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.

Those benchmarks are pretty heavily gamed. Think about things like hardcoding "Content-Length: 123" instead of computing the length at runtime.

Re: Is Rust Web Yet?

#68

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…

Agree with this wholeheartedly.. I was a hardcore c++ dev by day for 7 years straight and picking up rust was like the best thing I ever did. If anything it made me a much better c++ programmer by the end.

Re: Is Rust Web Yet?

#70
post #32
post #15

Earlier quoted context omitted.

Because C is 50 years old and boring. And Rust is slightly more intellectually demanding and takes longer to get into so has a a smaller monk like comm-- oh my god.

I'd argue that Rust is less demanding intellectually than C as you don't have to constantly worry about UB. C is definitely easier to "get into", if by "getting into" you mean writing unmergeable contributions full of unidiomatic code and security vulnerabilities. C's age is not an issue in itself. The programming languages it replaced were ahead of C in many ways. It was a setback from a language design point of vie…

I thought Rust didn't have a spec so everything in Rust was essentially undefined behaviour.

Has this changed or is the "defined" part still the compiler source code? In that case taking the source code of any C compiler as the _blessed_ one should get rid of any undefined behaviour problems as well.

Post reply on HN