3 ms·
That is why i love C, you can model it to do whatever you want, it truly empowers you to program your PC
by Shadonototra 5y ago
That is why i love C, you can model it to do whatever you want, it truly empowers you to program your PC
- Findecanor 5y agoIt isn't pure C. It uses x86-64 assembly language to save register context. It falls back to setjmp()/longjmp() when its not x86-64, but (contrary to popular belief) those don't actually save all the registers, and longjmp() will on some platforms terminate the program if it detects it being abused in this way.
- Shadonototra 5y agoIt 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.
- pjmlp 5y agoSame could have been done in Modula-2 or Object Pascal, to name just two among many, including the Assembly and setjmp/longjmp parts.