Over two years ago (oof), I posted a walkthrough of my Rust implementation of todo-mvp by @gypsydave5 demonstrating how to build a simple Rust API ...
For further actions, you may consider blocking this person and/or reporting abuse
Excellent post! Even though you've demonstrated how using a web framework isn't always necessary, a fun follow-up post would be to show how to write this same application on top of
warp
(since it is also built onhyper
).That's a good idea! I quite like Tokio's
axum
too.Wow, really wonderful😲
std::net::SocketAddr is directly used. Must be lightweight and fast.
I have ever used just f/w such as Rocket and Actix. hyper, a bit.
Thank you for your great article and code😃 Now I feel like learning more about Rust and network... to wholly understand them at first...
Recently I started to consider a compiled language for backend. Currently I am still learning Go aka Golang. Actually I want to use Java, but it will take longer time to learn if I have to proceed to J2EE aka JEE, although Spring framework (Spring Boot) will help quick development.
I have read about Rust a couple years ago, but didn't really want to get started, seeing that it would only fit to system or embedded programming like C/C++.
But when I read an article from qvault.io/rust/rust-vs-go-in-backe...
my mind was open again. Still, I think I don't have time to learn Rust. Maybe, after sufficient learning and working with Golang, I will spend time to read its documentation again.
Go is a tough competitor in terms of web servers. In my limited experience, Go really excels in that space above anything else I've used. I think Rust will ultimately provide better low-level control and general expressiveness, but pragmatically Go might be more than sufficient for a wide swath of web service use cases. Java fits the bill too. There's a lot of types of applications for which Rust is probably overkill.
Once you've invested the time and energy to get over the hump it's likely capable of comparable productivity, but the learning curve is definitely steeper, so you have to decide up front if it's worth the time and energy.
If you're just curious, I mean, yeah. Come on over :)
I have visited the Book again. And like the last time I read a bit about it, I jumped and read a bit about its unique thing : Ownership. I like reading the section that discussed Stack and Heap; this at the same time reminded me of C++ that I wanted to relearn in the correct way (like reading from Stanley Lippman's book of C++ Primer).
I am also glad seeing that Rust provides Struct like in C/C++, and how it defines methods in the context of Struct, Enum or Trait, although it doesn't provide Classes and Inheritances via classes. This way of defining methods immediately reminds me of how Go defines methods using Receiver argument in the context of certain types such as struct.
Therefore, I feel like at the same home when trying to learn Rust in parallel with Go, and actually C/C++ too, since they provide structs and pointers.
I took the liberty of messing with this project.
Please take a look at the individual commits, who knows, maybe you will like something: github.com/deciduously/todo-mvp/pu...
I know you didn't want JavaScript, but I provided a fallback for the bad people :v (Yes, the fallback is worse)
But the real gains would be caching the CSS and SVGs, of course.
Umm, honestly this stuff is way above my head right now. But I do have a question, one you probably get a lot. Which font are you using in your terminal?
Yep, I'm definitely assuming familiarity with Rust for this post :) If you're curious, I recommend starting with The Rust Programming Language, available for free!
I currently use JetBrains Mono in both my terminal and my text editor. I also like Source Code Pro.
This recommendation is very common but the typical audience will usually be disappointed about the level of competence that will be attained after working through a ~500 page tome.
I think this old tweet gives a clearer account of the journey to basic Rust competence:
1 The Rust Programming Language
2 Rust By Example
3 Programming Rust (Another ~600 pages)
4 This is where you start writing your own code.
Also:
Sure, Rust is a complicated topic, but I still recommend starting there. You have to start somewhere. It worked for me, at least.
Pls don't call "spawned tasks" "threads".
Think of the children, this will absolutely destroy them.
Whoops, absolutely correct thanks! I'll fix the post :)