Re:How I Start: Rust
by xena on Tuesday March 17, 2020 @12:56PM
(#22607019)
Author of the post here, feel free to ask me anything!
[ Parent
| on HN ]
Re:How I Start: Rust
by correct_horse on Tuesday March 17, 2020 @03:55PM
(#22609558)
Why did you pick Rocket? For example, Actix-Web is a viable alternative that works on a stable compiler.
Re:How I Start: Rust
by camillovisini on Tuesday March 17, 2020 @04:35PM
(#22610060)
Great article, thank you! A suggestion: The code examples were somewhat hard to read. Perhaps you could add syntax highlighting (e.g. via prism or highlight.js).
It was really helpful doing some first steps with rust.
One suggestion: add a warning for macOS users that psutil::host::uptime is not available on macOS. I had to figure that out myself and it was quite frustrating.
I figure you didn't know that, and it's not like the article claims otherwise, but it would be useful to add I think.
Thanks, I had the same issue - and only figured it out because this comment came up in Google results for the error message.
I didn't know that! I've recently switched over to NixOS as my daily driver. I'll see what I can do to fix that for the future.
Why no `cargo run`?
I'm used to doing stuff with WebAssembly, that is beyond the reach of `cargo run` most of the time.
Actually even for wasm you can make `cargo run` work. You just need to write a script for it and use it as the target runner. Especially for WASI this is great where you can just specify wasmtime as the runner and then cargo test / bench / run all work perfectly fine.
I was actually just searching for this the other day but couldn’t quite figure it out. Do you have any guides on doing just this? Thanks!
Re:How I Start: Rust
by artursapek on Tuesday March 17, 2020 @01:00PM
(#22607074)
Do you write code in that color scheme? (Dark green everything on a black background)
No, I'm not sure why the gruvbox theme I use has that for code examples. Here's what my coding view looks like: https://i.imgur.com/oWFlmgB.png