My advice on implementing stuff in C:
My advice on implementing stuff in C:
Posted Oct 18, 2010 22:45 UTC (Mon) by HelloWorld (guest, #56129)In reply to: My advice on implementing stuff in C: by cmccabe
Parent article: Russell: On C Library Implementation
That code uses two GNU extensions, statement expressions and typeof. It's not possible to do this in C89 or C99.
Also, you're still missing the point. The point is that the preprocessor doesn't understand the language, which is a _fundamental_ shortcoming of that facility.
> So in other words, it's just yet another code generator.
Wake up.
The preprocessor, cpp, is "just yet another code generator", it generates C code from a (pretty dumb) macro language.
The C compiler, cc1, is "just yet another code generator", it generates assembly from C code.
The assembler, gas, is "just yet another code generator", it generates machine code from assembly.
Just because all this stuff is hidden from you by the compiler driver, gcc, doesn't mean it doesn't exist. However, unlike gcc's compiler driver, the java compiler allows you to hook up arbitrary stuff, like lombok. Being flexible is an advantage in my book.
> And writing a domain-specific language in Ruby is easier still. Apparently high-level languages do high level things better than low-level languages do.
You clearly have _no_ idea what Lisp is about. Here's a hint: it's not a low level language, and it's _at least_ as suitable for writing domain-specific languages as Ruby. Actually, it had most of what ruby has before ruby even existed.
