Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D?
WraithGlade
anonymous at noreply.com
Mon Sep 9 17:39:46 UTC 2024
Thank you all for your very helpful replies and for taking the
time to make them!
It is indeed heartening to see that D supports multiple different
forms of this mechanism.
This is certainly sufficient for the example I gave.
I suggest that something like this should be added to the
standard library and perhaps even shown in early examples in the
tutorial and documentation. Such things are so routine that I
would argue that it should be the most common form of print-based
debugging. It also seems to be becoming an expected/standard
feature among new languages too, for obvious practical reasons.
The prospect of using D does look brighter now, knowing all this.
----
More specifically, I am planning to do a combination of general
application development, game development, and eventually
building a language transpiler of my own (for which I've been
gradually coming up with ideas for over the years). I have grown
tired of dealing with C and C++'s mess and build ecosystem.
D's expressiveness is adequate now that I know what you've all
said here.
I am debating between D, Nim, Zig, and Rust. Each have pros and
cons, although all are clearly great and none would be "bad"
choices (barring unexpected events).
I will consider it for a while longer. I want a stable platform
to build on long-term that is also flexible and pleasant to work
with.
So, tangentially, I'd also be interested in hearing any of your
all's thoughts about that regarding D (and/or the other
prospective languages).
Thanks again for reading and for the fast and extremely helpful
replies! It is much appreciated! I wish you all a wonderful
day/night/week/etc!
More information about the Digitalmars-d-learn
mailing list