Hacker News new | past | comments | ask | show | jobs | submit login

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.




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.


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: