Live data from Hacker News

Is Rust Web Yet?

arewewebyet.org

31–40 of 183 posts

Re: Is Rust Web Yet?

#32
post #15

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

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 view, even 50 years ago.

Re: Is Rust Web Yet?

#33
Here's an example of how useful webassembly can be: we're at the (fairly early) stages of developing PRQL [1]. Because it's in rust, with WASM we could put a live compiler on a webpage [2], and recompile the PRQL into SQL on every keystroke.

There's no server process — it's all built in GitHub Actions, hosted in GitHub pages, and runs in the browser. The whole WASM code is 164 lines (o/w half are comments).

[1]: https://github.com/prql/prql [2]: https://lang.prql.builders/editor.html

Re: Is Rust Web Yet?

#34
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…

Ah, but there's the trick, you ignore the presence of potential UB and write a lot of complicated code real quick!

Re: Is Rust Web Yet?

#35

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

Not only that, the rust community also seems to have some weird complex where not only they evangelize their own language (which is fine) but also feel the need to bully and bash on other languages (usually targeting mainly C/Go but occasionally Java as well).

Re: Is Rust Web Yet?

#36
post #9

This content, while still accurate (Rust is Web-ready, and all the frameworks listed are excellent!), is missing out a few credible and recent options. In particular I want to shout out for Axum ( https://github.com/tokio-rs/axum ), from the folks who brought us Tokio. I've been building with it for the past few weeks and have enjoyed every minute. I started with Warp, but ended up struggling a bit with middleware. I…

I have been toying around with Axum a bit and it is nice as a web framework. I really appreciate the many examples in the repo.

Having come from python (day job) I did hit a screeching halt when it came time to meaningfully interact with a database.

It is unfair to compare Rusts current offerings to something as mature as SQLAlchecmy but boy does it slow things down dev wise to be mapping my own types and queries using tokio-postgres.

I've looked at Diesel, sqlx and SeaORM but have not yet committed to learning one yet.

I've also used Warp for some small web server stuff in the past as well. It is an interesting approach but definitely a little different.

Re: Is Rust Web Yet?

#37

What's the best way to learn rust for low latency programming in 2022?

I think most low latency tricks work just as well in Rust as in any language. Shared writeable buffers to keep allocations and such down can be a challenge, but with the right unsafe code (and knowledge of the workings of Rust) you can make them work.

Re: Is Rust Web Yet?

#39
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.

I honestly don't know. It could be a consequence of the way the test is set up, or how the total score is calculated, or maybe the code was optimized better than other frameworks were.

You read see the source of the tests here: https://github.com/TechEmpower/FrameworkBenchmarks/tree/mast...

The SQL code seems quite optimized (manually compiling database packets instead of using a library). Most code seems quite static and very small, so it's probably very quick. I don't think you can actually use the framework like that in practice, though.

Re: Is Rust Web Yet?

#40

Earlier quoted context omitted.

Because the world is really ready for something to displace C and bring low-level programming to the 21-st century.

Go

Personally I think this comment explains why Go isn't the solution. It's magical for fast development following the most minimum and well trodden path. Stray outside and face demons at every turn.

We, like the commenter have made the decision to start slowly depreciating our Go code base in favor of Rust.

https://news.ycombinator.com/item?id=31019234#31024525

Post reply on HN