Does anyone know, is https://github.com/rust-lang/rfcs/blob/master/text/0066-bett... ever going to be resolved? I really do not like the idea of having to create a new variable for something so simple as this.
John Carmack: writing Rust code feels wholesome
71–80 of 85 posts
Re: John Carmack: writing Rust code feels wholesome
#72Many comments in twitter mentions rust still not being ready for server code ( which i start to feel strange since concurrency is the only major issue on the server side, and supposed to be rust strength). Anyone can confirm ?
This will improve a lot once async/await stabilizes. It already works great in nightly if all of the libraries you want to use support it.
Re: John Carmack: writing Rust code feels wholesome
#73Many comments in twitter mentions rust still not being ready for server code ( which i start to feel strange since concurrency is the only major issue on the server side, and supposed to be rust strength). Anyone can confirm ?
https://www.ageofascent.com/2019/02/04/asp-net-core-saturati... That actix you see appearing in most lists and mostly nearly top is written in Rust btw. Fun fact- frameworks managed by microsoft dominate the space ;)
Re: John Carmack: writing Rust code feels wholesome
#74Many comments in twitter mentions rust still not being ready for server code ( which i start to feel strange since concurrency is the only major issue on the server side, and supposed to be rust strength). Anyone can confirm ?
This is because of the removal of the fat runtime and green threads about 5 years ago. Since there was no blessed way to do high concurrency in the language any more, some code started using normal threads, some code (tokio) started using normal callbacks. Callbacks in rust are tricky because of the type system. Around a year ago, async/await became possible due to the development of the Pin idea. async with the awai…
Re: John Carmack: writing Rust code feels wholesome
#75Earlier quoted context omitted.
https://www.ageofascent.com/2019/02/04/asp-net-core-saturati... That actix you see appearing in most lists and mostly nearly top is written in Rust btw. Fun fact- frameworks managed by microsoft dominate the space ;)
IIRC actix was gettin some flack for using very unsafe code to hit those benchmarks. Still cool.
Re: John Carmack: writing Rust code feels wholesome
#76Re: John Carmack: writing Rust code feels wholesome
#77Earlier quoted context omitted.
This is because of the removal of the fat runtime and green threads about 5 years ago. Since there was no blessed way to do high concurrency in the language any more, some code started using normal threads, some code (tokio) started using normal callbacks. Callbacks in rust are tricky because of the type system. Around a year ago, async/await became possible due to the development of the Pin idea. async with the awai…
Porting from futures to async shouldn’t be too hard based on my experience doing it in JS.
Re: John Carmack: writing Rust code feels wholesome
#78Earlier quoted context omitted.
IIRC actix was gettin some flack for using very unsafe code to hit those benchmarks. Still cool.
There is absolutely no shame in using unsafe!
Re: John Carmack: writing Rust code feels wholesome
#79Earlier quoted context omitted.
Porting from futures to async shouldn’t be too hard based on my experience doing it in JS.
Sure, but js doesn’t have rust’s type system. It will probably be straightforward once everything is settled down, but right now Future 0.1 (tokio) and Future 0.3 (async/await) aren’t comptatible and you’ll find examples that use one or the other, or plain threads, or plain callbacks. It’s possible to get up and running quickly with the examples from various libraries, but when you try to mix them, if they use differ…
Re: John Carmack: writing Rust code feels wholesome
#80Earlier quoted context omitted.
I've been programming in C and C++ since sometime around 1992 (and Pascal before that). For the last 3 years, I've been writing Rust professionally. Here's my Rust advice for C and C++ programmers: - Rust is a higher-level language than C. A C/C++ programmer could think of Rust as "C++ without most of the footguns and magic." - Certain types of C/C++ code will translate very easily to Rust. For example, if your code…
I'll probably hold off on learning Rust deeply until they have async/await as keywords. Most of the programming I do involves async, and I currently do my day programming in Dart, which is an absolute joy to do async programming in. They had Future-based APIs from day one, so the whole ecosystem was built around futures starting out. They've had async/await as keywords for over 5 years now. It's so ergonomic it's pai…