Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Rust is not a language for lazy developers.

I am one, and Rust absolutely can be.

> Lazy developers won't fight with the borrow checker.

You don't fight the borrow checker when writing web code. The request flow is well suited for rarely, if ever, testing the borrow checker.

> Instead, think more critically about why a Rust developer would need a web framework

The same reason anyone would need a web framework. Anything ranging from bullshit hack to high SLA service.

I'm finding Rust to be a drop-in Go and Python replacement for HTTP. It's really good at this use case, and it's certainly something you can be very lazy about with modern Rust web frameworks.



It's absolutely not true, the moment you're out of http hello word, and you have more serious logic about data that you need to manipulate / modify you will fight the borrow checker, that's why a lot of people do a lot of rc / arc refcell.

And then the async implementation.


I’m writing a web app at work and I have one Arc and no Rc or RefCell.


Got zero because I cheated with Box::leak


Haha!


Have you ever written a web app in Rust? Most of the code is in a form of handlers that receive data, process the data and give some data back. There is rarely need to think about lifetimes or borrowing in these scenarios.


Show me what you find to be hard, because I don't believe you.

None of what you've described is hard. It's quite approachable, and an IDE with an LLM practically autocompletes everything for you anyway.

If you can write Java or Go, you can absolutely write Rust.


I would have thought async would be the biggest problem.


If you're in a web framework, all the handlers are async already. You have literally no work to do.


As someone who has written a fair bit of web service code in Rust over the last 5 years or so, this is all correct.




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

Search: