Hacker News new | ask | show | jobs
by asou 2095 days ago
Rust is too strict imo.

I'm fairly experienced and I still can't throw up an HTTP server in Rust, even with libraries.

I almost can do in with NodeJS and Express from memory.

Something like

app = require('express')

app.listen('/', function ( req, res ){ res.send (' Hi Hn') }) ; It's ok for different languages to do different things.

I can't imagine anyone being faster with Rust than Python or JS. Of course eventually Rust gets a performance boost, but it's never going to matter unless you're talking about a larger scale project.

2 comments

I would complaint about Rust as well, but setup a HTTP server in Rust is actually not that hard if you accept the fact that you'll have to use third-party framework. Then, the HTTP server will come to alive in within 20 lines of code.

See: https://rocket.rs/ https://actix.rs/

But, of course, the demo code is always easy. The real nightmare starts as soon as your application became complex enough, that the demo no longer fit and you need to manually spawn something (To handle TCP connection before it hits the framework for example) rather than just "actix_web::main" or "tokio::main".

Maybe it's been fixed , but when I tired Rocket last year I couldn't get it to really work.

I would like Flutter to take over since it combines the best of Java /C# ( types) with the best of JavaScript/ Python ( dynamic variables which can be any type ).

I wrote this as my first Rust program, ever. It was mostly copy and paste, and involves an https server running on localhost.

https://github.com/GWBasic/open_links

I spent a few hours reading the book, but it didn't sink in. I will be honest, though: Rust is still very challenging for me. The learning curve is extremely steep. Perhaps it's because Rust makes some things easy, at the expense of what automatic memory management and runtime type metadata make easy?