Skip to content

Comment on Metaprogramming: Ruby vs. Javascriptparent

Comments

In his defense, I'd say that the line between "metaprogramming" and using the features a dynamic language gives you is fuzzy. I'm not sure if I consider changing the semantics of a data type in Lua through its metatable metaprogramming or not, for example.

Generating source code at runtime definitely counts as metaprogramming, but doing that and having to re-parse it is probably the coarsest and most error-prone way. Lisp routes around this by working with ADTs directly, but that forces a lot of other trade-offs in the language design.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.