2 ms·
It is, i had this piece of code in mind: choose { out(ch, int, 42): foo(); in(ch, int, i): bar(i); otherwise: baz();
by Shadonototra 5y ago
It is, i had this piece of code in mind:
choose {
out(ch, int, 42):
foo();
in(ch, int, i):
bar(i);
otherwise:
baz();
end
}
every other languages are too rigid when it comes to DSLs, so you either fall back to a scripting language / bloated XML file, or you use the language itself and write a bloaty and unreadable mess
only C allows that kind of level of customization, so powerful
i love D, i use it more than C, but damn i miss being able to shape the language this way
- throw_m239339 5y ago> every other languages are too rigid when it comes to DSLs, so you either fall back to a scripting language / bloated XML file, or you use the language itself and write a bloaty and unreadable mess C macros fuckery aren't a good thing, at all. The problem aren't macro per say, Rust has them, the problem is the way they are implemented, with basic text substitution. There is absolutely nothing to praise here. > every other languages are too rigid when it comes to DSLs, so you either fall back to a scripting language This is objectively a false statement, Crystal, Rust, Haxe... actually implement Macros the right way. C macros are brittle and a horror to debug.
- Jtsummers 5y agoEvery Lisp ever, as well. Textual macros like C's are useful if they're all you have, but definitely one of the worst options if you have a choice of macro systems.