4 ms·
Writing Rust/Actix for server code is a breeze. There's zero complexity. It's practically Java, just with a more Ruby-like syntax. Entirely depends on what you
by echelon 4y ago
Writing Rust/Actix for server code is a breeze. There's zero complexity. It's practically Java, just with a more Ruby-like syntax.
Entirely depends on what you're building.
Edit: You can have a small Actix app up over the weekend and never touch "lifetimes" until you're ready.
- andrewstuart 4y agoAfter my initial failed attempt to learn Rust I then took a second shot at it by writing Actix web code and had alot more success. This is the path I would take if I was returning to Rust. Having said that, I felt that for the most part this approach was just avoiding the task of learning the complexities. But, I do believe that learning something hard starts by learning a little bit of it and building on that initial foothold.
- lossolo 4y ago> Entirely depends on what you're building. Exactly this, if you are building some CRUD app then it's as easy as using Java or Go etc, because basically there you have request -> contact some db -> return result, maybe do some processing of that data, so no need to fight borrow checker at all. But if you build something like multiplayer game server with lots of state of 3D world that constantly changes and interacts with itself, that is operating on self referencing data structures etc then it's not as easy as in GC language.
- brown 4y agoI could not disagree more. The moment you need to do something remarkably simple, such as string concatenation, you are confronted with the reality that Rust is a much lower level language.
- rascul 4y agoIn the simplest form, string concatenation is simple. https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f72521a8b1d86acb4b082326c36ec4e1 https://play.rust-lang.org/?version=stable&mode=debug&editio... I usually use concat() though. https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=78337475ece89b199a6249b4b3c90e78 https://play.rust-lang.org/?version=stable&mode=debug&editio...
- Thaxll 4y agoFor simple CRUD app maybe, but the moment you start to do anything more complicated, aka manipulating data it's a complete different story.
- josephg 4y agoPart of my work involves the braid HTTP spec. Braid uses a custom server-sent events like protocol sent over long lived HTTP connections. I spent about a week trying to get this working using rust & actix. My code became mired in complex lifetimes, crazy iterators, Pin, async and Futures. Hundreds of lines of code later, I gave up and rewrote the whole thing in an hour or two, in about 30 lines of javascript. The whole experience was so bad I've sworn off using async rust entirely until a few more features land. Thankfully, apparently there GAT lands next release - although its not clear to me if it'll work for futures yet, or if thats a later goal. I love rust. But, wow.
- rascul 4y agoI don't know anything about Java or Ruby but I've tried several rust web frameworks and Actix is the one I always find myself using in the end.