4 ms·
Not convinced... the C preprocessor is tolerated because it is so small. Lua + C would really confuse at least me. But nothing's really stopping you I guess. L
by jacobush 10y ago
Not convinced... the C preprocessor is tolerated because it is so small.
Lua + C would really confuse at least me. But nothing's really stopping you I guess. Lua, or any script-ish language could be used instead of the C preprocessor. Why not Python? Perl?
- ndh2 10y agoYou already answered the question: Because it's small.
- jacobush 10y agoYes I agree
- makapuf 10y agosomething I never understood is why not compile-time C semantics and proprocessor and actually enforce some compiler optimizations ? This is basically the direction of constexpr in fact with C++. I would love a new, slightly fixed/incompatible C17 (not D or subpart of C++, just C11) with - c++17-like constexpr (and its uses anywhere : switch cases, array sizes.. ) - deprecated oldstyle args, undeclared functions, trigraphs - (templates can be mostly done with pure inlining+constexpr) - better keywords (static -> private (by default/explicit public), persist ) - fixed operators precedence (1<<3 +1=16 yay) - typed enums with explicit storage class - reduce preprocessor ability(discourage and just generate from lua/python/C programs if you really need, maybe with a shebang-like line). replace conditional compilation with constexpr ifs,
- shakna 10y agoM4 comes with most Linux distributions. Similar to the cpp, but recurzive with a couple extra features. It's just a little painful to use.