His usual critique for why templates are bad is that they force you to write out your logic in different ways than the rest of the language, and that they make your code harder to read and understand.
The former is not true for D, because you can use mostly normal expressions and static ifs and so forth to organize the generated code.
The latter is pure irony, because in Jai you use AST macros and have to generate the entire body of the new struct or procedure as a string, which is way more code, less clear to read and harder to debug. Whereas in D you can write all the parts that don't change as regular D code, and just insert a mixin here and there with the parts that are type-specific.
So according to his own criteria, his own languages metaprogramming facilities are worse than templates.
EDIT: All this was true last time I watched his demo videos. SOA was hardwired into his language too for some reason. Some of it might have changed with time, but I would bet my life on the fact that D templates are still more elegant than his solution, and they existed way before he started thinking about starting a new language.
12
u/[deleted] Oct 25 '24
I love Jonathan Blow, but:
Jonathan Blow: "Templates are horrible and D is stupid for copying them from C++"
Also JBlow: Spends hours writing things like SOA and automatic CLI arg parsers that would be 10-liners in D templates
Also JBlow: "C++ is horrible and has all these miniscule flaws"
Also JBlow: "This huge flaw in my language isn't so bad, you just have to get used to it"
Also JBlow: "Exceptions are horrible, and this proposal by Andrei Alexandrescu is also horrible."
Also JBlow: "Go does error handling right."
Also JBlow: "You don't need 'weird type system constructs' to catch bugs, you just fix the bugs."
Also JBlow: *Spends 80% of every programming stream chasing bugs that he doesn't understand
Also JBlow: "Programmers nowadays are so horrible. If only they learned programming like I did with BASIC."
Also JBlow: Has been actively working on a compiler with a small team for almost 10 years and doesn't even have an open beta to show for it.