Hacker News new | past | comments | ask | show | jobs | submit login
Rust Web Framework Comparison (github.com/flosse)
63 points by neverminder on Oct 29, 2022 | hide | past | favorite | 33 comments



Curious why rouille (my personal server-side favourite) is marked as "outdated". Because it doesn't use async? That's the point!

It had a release fairly recently (less than 3 weeks ago) and works perfectly fine with a pretty stable API.

Edit: I opened a PR to fix it! https://github.com/flosse/rust-web-framework-comparison/pull...


I was confused for some minutes because the first hit when I googled "rouille rust" is "rouille (French for Rust) is here to save your day, as it allows you to write Rust programs in French, using French keywords, French function names, French idioms." with code like:

  statique mutable DICTIONNAIRE: PeutÊtre<Dico<Chaine, Chaine>> = Rien;
That's probably "Option" in English Rust?


Peut être: "Maybe"/"Perhaps"

Literally: "Could be"


yeah I understand that much French, but Rust (opposed to Haskell) doesn't have "Maybe", as far as I know, but "Option"

My source: https://notes.iveselov.info/programming/cheatsheet-rust-opti...


Because it's an undisciplined collection of many people's hard work, boiled down to overly simplistic attributes used to highlight some repositories and put others down.


That doesn't mean it's outdated. You might be right or wrong about your point, but that's what comparisons are for.

That's like saying "I refuse to compare Linux to windows because windows is bad"... Not helpful for anyone actually wanting the differences


I think they are referring to this comparison repo, rather than the framework


I tried to enjoy rust and make a service with it to give it a test run. I really disliked the reliance on so many third party libraries to get things done.

Is this not possible using the standard library alone?


If you make a tree of crate dependencies, the root is the standard library. So yes, you could build it all yourself with the standard library, it would just be really unpleasant.

I agree, it would be nice the if the rust foundation would give their blessing to some important crates like serde and regex, but putting them in the standard library only makes them harder to evolve. In particular, breaking changes go from being unpleasant to disallowed altogether.


Sure, you can write the stuff yourself instead of using a third party library. Might be harder than it sounds, though.


That makes me wonder if there is a web framework for Haskell that compiles to WASM.


Haskell has a garbage collector, and the wasm gc proposal has just hit stage 3. Once and if this continues and gets implemented, then we’ll see how Haskell (and fingers crossed, ocaml) gets compiled to wasm.

I’d love to deploy Haskell or ocaml on some of these new cloud wasm hosts.


These are the kinds of things that make me think, "Do you really need Javascript or C++ or Haskell anymore?" Can't we just use Rust from top to bottom for pretty much everything?!


I'm not convinced Rust would ever be the right "everything language".

Currently I find myself reaching for it for almost every domain, largely thanks to the ADT's and amazing tooling, but it's a bit low level and sometimes tedious for certain sets of applications where more approachable languages, like Python and JS currently are the standard bearers.

Personally I think we would get really far with Rust, and some yet-to-exist higher level language with a modern type system built on top of the Cargo ecosystem.

Then maybe C and/or something like Zig for niche applications where extreme memory efficiency is the main constraint.


You absolutely can. The biggest snag in "rust everything" is in web frontends. Yew is decent, but getting JavaScript developers is so much easier than getting Rust developers who like (web) frontend work.


It's also just a matter of the massive amount of prior art available on the JS side. There's so much you would have to create from scratch in Rust which is already an npm package.


We can! It’s a lot of work because you don’t have the whole JS ecosystem to fall back on, but to some that’s a feature not a bug.

My favorite example of this is https://makepad.dev


You can with basically any language. But it would likely be a bad idea. You will eventually have created such an abstraction that you’ve got a new language.

Django is written in C after all. ;)


GitHub says it's 97.1% python and doesn't list C.

https://github.com/django/django


My tongue in cheek joke is that CPython is C. And if you write long enough in Rust something that needs plenty of flexibility, you’ll end up inadvertently writing a language.


Oh, like Greenspun’s tenth rule:

> Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.


Hah I’ve never seen that one. Love it!


Have you tried writing a web backend in Rust?

See Primeagen, a Senior Eng at Netflix w/ Rust as his #1 lang, and his experience writing a quick web backend in Go, Rust, and TS:

https://youtu.be/Z0GX2mTUtfo?t=267


Until Rust shows me lightweight binary size story.


The language itself is lightweight enough to use on tiny microcontrollers. Most bloat on the host side comes down to your choice of dependencies (clap is one of the worst offenders in my experience, bloating a simple command line tool by as much as 10x in both size and compile time).


I wonder if there's an alternative to clap's derive stuff? I really love it (I think it came from structopt), it makes defining and handling the arguments nice and easy when things get a bit complex.


My go-to is argh[1], as it's more lightweight while still providing a nice derive-based API.

[1]: https://github.com/google/argh


I'll have to try it out. Thanks!


I mean, Unix/Linux was top to bottom C for a long time. It still kind of is. Higher level languages aren't needed per se, but they do make life easier.


If you think about it, the reason Rust, or any other programming language were created, was simply because other languages had something lacking...

There's no single language that's the greatest. Haskell has different aims than Rust. If you're using Haskell for frontend development, you probably need to reconsider your choices, I think


Rust and Haskell present a very different programming experience, and so does an untyped language like JavaScript. Just because you can program in Rust for web development doesn't mean developers will want that type of experience. The C++ comparison makes more sense since Rust presents that style of programming done better.


to be quite honest, this kind of evangelism is what drives me away from rust.


This isn't a comparison... this is a series of lists.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: