Comment

Comment by mntmoss

What ad-hoc code generation lacks, as a rule, is type constraints and structured expression(syntax and semantics). If it has those, it is bordering on being a complete compiler.

But if your base environment doesn't have notions of types or structured expressions either, which is mostly true of assemblers, then you are free to use macros to program at a higher level. The expressive power you gain by leveraging macros doesn't have a real downside because the core language is already so limited that it won't be more legible or maintainable to do it by hand.

parent mntmoss 6 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton