There are of course macros
Yup, and Rust's macros are pretty cool, but in D you can just do:
static if (condition) {
...
}
There's a whole compile-time reflection library as well, so you can take a class and make a super-optimized serialization/deserialization library if you want. It's super cool, and I built a compile-time JSON library just because I could...
You kind of get that with Rust for free
Yup, Rust is awesome.
But in D you can do explicit scope guards:
scope(exit)
- basically Go's defer()
scope(success)
- only runs when no exceptions are run scope(failure)
- only runs when there's an exception
I didn't use them much, but they are really cool, so you can do explicit cleanup as you go through the logic flow, but defer them until they're needed.
It's a neat alternative to RAII, which D also supports.
Some really great work is being done on that pretty much all the time
I still need to try out Cranelift, which was posted here recently. Cranelift release mode could mostly solve this for me.
That said, I haven't touched D in years since moving to Rust, so I obviously find more value in it. But I do miss some of the candy.