Live data from Hacker News

Rust needs a web framework

ntietz.com

41–50 of 395 posts

Re: Rust needs a web framework

#41
post #36

Rust has some great and useful web frameworks that are a joy to use, once you understand what is going on. For example, in Axum, they use traits cleverly to allow you to use dependency injection the same way that fastapi uses it. But at least when I started using it, that wasn’t an insight made bluntly clear with tutorials as good as tiangolo’s. Instead, I had to piece it together via examples in the axum repo as wel…

Curious which YouTube video you watched that helped learn Axum.

Re: Rust needs a web framework

#43
post #10

> I like to make silly things, and I also like to put in minimal effort for those silly things. I also like to make things in Rust… I think this part is perhaps the silliest part of a very silly article. If you really like to put in a minimal effort then why on earth would you use Rust? If you want efficiency, memory management and a compiled modern language just use Go. Then you won’t even need anything but the stan…

It could beat using C/C++ for using an embedded web server. I remember I tried that once and a lot of the work was using aho-corasick for working with paths, handling cookies and dealing with a bunch of nasty error handling all of which in theory would be easier in rust.

My problem wasn't so much dealing with memory management, but trying to put an upper bound on memory usage and failing nicely when that upper bound is met. I generally don't like working with garbage-collected languages, or having to use some niche application-specific language when I can just use a general-purpose language instead.

Re: Rust needs a web framework

#44
I am so glad I moved away from the web. I remember spending lots of time playing with different frameworks for Node.js and Java and PHP and Python, all with different tradeoffs, and all of them suck the fun out of programming out of me.

Yeah yeah I know Framework is great and good for stability or something, but using a framework makes something that I enjoy (programming) feel more like filing out my taxes, just so I can end up with a mediocre CRUD application that more or less works for the project I am working on.

I have removed myself to from the web and programming almost instantly became more fun for me again.

Re: Rust needs a web framework

#45

Earlier quoted context omitted.

What kind of logic is this... The Rust language is quite rigorous, so web frameworks on it should also be equally laborious to work with? You have to roll your own authentication, you have to do your own routing, you have to do ad-hoc string manipulation instead of templates?... The person likes writing in Rust, and would like to have a batteries-included web framework so they can tie together a web app quickly on th…

If you find the language rigorous, a web framework can't magically do away with that. It's genuinely illogical to believe so. There are plenty of web frameworks on Rust that are quite nice to use, but they are still Rust, with all its shortcomings in the same way Django is still Python with all its shortcomings. What you're asking for is a DSL built on top of Rust for the purpose of creating web apps.

Show me where I asked for a framework that magically turns Rust into Ruby. The person has created a list of (high-level!) features that they need. None of them are 'no borrow checker'.

Re: Rust needs a web framework

#46

Possible unpopular opinion: Rust is a systems language, doing "web work" in Rust is a waste of effort as there are much better languages and ecosystems for that.

Counter-point: developing web services in Rust is just as easy as doing it in Go or Java, yet you now have an excellent type system (sum types!), an excellent package manager, and extremely good performance.

You can do dependency injection in Rust to share connection pools just like you would in Java, and it's super simple to write threaded background tasks.

Google gave a talk recently that said they measured Rust developers as no less efficient or productive than Go developers [1].

It's a fantastic language and you shouldn't ever limit yourself to systems programming with Rust. It can do so much more than that.

[1] https://www.ardanlabs.com/news/2024/rust-at-google/

Re: Rust needs a web framework

#47

Possible unpopular opinion: Rust is a systems language, doing "web work" in Rust is a waste of effort as there are much better languages and ecosystems for that.

IDK I use C/C++ all the time for web servers. It's lightweight and lets you pretty easily/quickly call C/C++ and low-level code and gives you a lot of control in terms of networking. You can pretty much "do anything" in a straightforward generic way without having to learn some application specific language like PHP or through nginx/apache configuration files.

Having a rust alternative to something like libmicrohttpd would be nice and I would use it.

Re: Rust needs a web framework

#49

For new web applications, why recommend alternatives to Next.js? How do you convince someone to use an alternative? The knowledge needed to understand why will help you get close enough in Next.js anyway.

The npm dependency ecosystem is extremely tangled. I work with node frequently, but there's plenty of opportunities for bad actors to introduce abuse and I'm wondering when the other shoe will drop.

Re: Rust needs a web framework

#50
Servo is in Rust.

I want to make an app in Rust that hosts Servo in it with my business logic in maybe SciterJS - like electron but hopefully lighter?

Something, just a business software guy who wants something with more control than an webapp and not so heavy like electron.

Post reply on HN