News for hackers. Stuff that matters.
Re:Why I rewrote my Rust keyboard firmware in Zig: consisten... by chubot on Sunday March 07, 2021 @01:14PM (#26378141)
But isn't Rust basically getting constexpr from C++? I saw that in some recent release notes: https://lobste.rs/s/lng3c0/announcing_rust_1_50_0

constexpr is basically making more of C++ available at compile time -- e.g. lots of C++11, 14, 17, and 20 are just allowing more of the language at compile time. Including STL, allocators, etc.

Zig simplifies everything by designing in comptime up front, rather than gradually opening it up with ad hoc rules over 10+ years.

My understanding is that Rust is going down the same path as C++. So you're going to have 2 kinds of macros AND comptime-like/constexpr-like compile time execution.

Re:Why I rewrote my Rust keyboard firmware in Zig: consisten... by steveklabnik on Sunday March 07, 2021 @02:49PM (#26379105)
Yes, something very similar to constexpr.

> Zig simplifies everything by designing in comptime up front, rather than gradually opening it up with ad hoc rules over 10+ years.

I am not 100% sure that I agree with these characterizations, personally, but they're both valid strategies for sure.

Re:Why I rewrote my Rust keyboard firmware in Zig: consisten... by girvo on Sunday March 07, 2021 @05:45PM (#26380538)
Regardless of the particular trade-offs the various languages under discussion are choosing to make, it’s exciting to me that more and more languages are adapting, exposing and using “compile time” systems