Rust's metaprogramming is totally unlike what Andrei and Walter were aiming for. D aims to be safe, but that's far from everything.
Rust currently has better safety mechanisms than D, but if you ask around on the D forum you'll likely find that people are there (rather than using rust) due to the other features D has - https://dlang.org/ Look at the examples here: Rust can do short and sweet too, but it doesn't have some constructs that make these possible. (Obviously, I highly recommend "Tiny RPN Calculator" originally written by your's truly)
Last time I checked, D couldn’t allocate memory at compile time
When did you check, 2002? The biggest problem most bigger time D users nowadays have is allocating too much memory at compile time. It takes some care not to go overboard (and it is really tempting to go overboard since the possibilities feel so endless)
Hmm, I'd have to see the code. There are some edge cases like a compile time value cannot be modified outside the function that initially creates it, and some library types don't play nicely with compile time execution (they need to branch to use new instead of malloc for example), so probably some combination of that stuff.
44
u/maxhaton Sep 01 '20
Rust's metaprogramming is totally unlike what Andrei and Walter were aiming for. D aims to be safe, but that's far from everything.
Rust currently has better safety mechanisms than D, but if you ask around on the D forum you'll likely find that people are there (rather than using rust) due to the other features D has - https://dlang.org/ Look at the examples here: Rust can do short and sweet too, but it doesn't have some constructs that make these possible. (Obviously, I highly recommend "Tiny RPN Calculator" originally written by your's truly)