News for hackers. Stuff that matters.
Re:Rust without the async (hard) part by estebank on Thursday June 09, 2022 @12:47PM (#31683532)
> There is no sane way to make async optional in a library and reuse code.

FWIW, there's an effort to do exactly that, but because it will require language level changes and it is just on the drawing board phase, it will likely be a while before it can be widely used.

The "optionality" of `async` while sharing code also applies for `const` and mutability (why do we need `Deref` and `DerefMut`?). Finding a solution that can work for these three (and maybe others?) parts of the language will be a welcome improvement.

Re:Rust without the async (hard) part by api on Thursday June 09, 2022 @12:51PM (#31683578)
Great to hear! That's really the solution.

Rust async code can be a bit challenging until you get it, but I can't think of a way to make it that much simpler without sacrificing the whole "systems programming language" concept or support for embedded. The only good alternative is Go-like fibers and that requires a fat runtime.

We use both Rust and Go at ZeroTier and find that they both have their own niches. (We are slowly moving ZeroTier from C++ to Rust to use a more modern and more importantly safe language.)

Re:Rust without the async (hard) part by mikevm on Thursday June 09, 2022 @01:22PM (#31684087)
Where do you use Go?
Re:Rust without the async (hard) part by api on Thursday June 09, 2022 @01:58PM (#31684558)
Backend to my.zerotier.com and internal analytics code.
Re:Rust without the async (hard) part by mikevm on Friday June 10, 2022 @09:44AM (#31694093)
Do you think that was the right choice, or would you have written that in Rust if you were starting today?
Re:Rust without the async (hard) part by api on Friday June 10, 2022 @10:15AM (#31694521)
Go is great for backend stuff like that. If we rewrote it from scratch today we might consider Rust though just to have only one language in the house... but Go is really good for that case.

We are using Rust for the ZeroTier network hypervisor and core system service though because that's systems-level software that is performance-critical, needs to fit on small-ish devices, and needs deterministic performance among other things.

They're really different languages for different niches. Rust is C++ 2.0. Go is fast compiled Python with a cleaner design. (Python is the best niche comparison I've found for Go.)

Re:Rust without the async (hard) part by mikevm on Friday June 10, 2022 @10:23AM (#31694634)
Very interesting! Thanks for the answers! :)
Re:Rust without the async (hard) part by cercatrova on Friday June 10, 2022 @02:55AM (#31690916)
> FWIW, there's an effort to do exactly that

Could you link where?

Re:Rust without the async (hard) part by estebank on Friday June 10, 2022 @01:50PM (#31697294)