5 ms·
Does the syntax of most programming languages get into the way of macro systems? Is that why most of the languages in the article are Lisps?
by kruhft 9y ago
Does the syntax of most programming languages get into the way of macro systems? Is that why most of the languages in the article are Lisps?
- kmill 9y agoIt's possible to have metasyntactic variables in languages with more syntax than a Lisp. Some examples are MetaML, MetaOCaml. Terra (a Lua-like language) also has metaprogramming[1]. Or TemplateHaskell. Having a complicated grammar does make it more complicated because you have to allow metasyntactic variables at different places, vs s-expressions where you just need a comma (which is just shorthand for the unquote form). [1] http://terralang.org/getting-started.html#meta-programming-terra-with-lua http://terralang.org/getting-started.html#meta-programming-t...
- kruhft 9y agoIt's possible, but I only really see successful, integrated metaprogramming done in low syntax languages.
- deleted 9y ago[deleted]
- tempodox 9y agoJulia has a macro system that's suspiciously close to CL's.
- kruhft 9y agoQuasi Quote looks to be ':', comma is '$', but syntactically, Julia looks pretty sparse other than mathematical expressions: Reference: https://docs.julialang.org/en/release-0.4/manual/metaprogramming/ https://docs.julialang.org/en/release-0.4/manual/metaprogram... But the question is, do people actually do much metaprogramming in Julia? Unlike CL, which is almost what it's designed for (or something that fell out of the design), rather than an after thought addition to the language (although Julia's does look rather well designed or an addition).
- gumby 9y agoThey strongly do get in the way. A good example is the C++ template system, which was designed the way it was because, as Stroustrop said to me once, "that ecological niche had been polluted [by the C preprocessor] so [templates] were the best available." Thinking of them as a semi-general templating facility made them much easier to use, and more useful, but still I miss the legibility and expressive power of the Common Lisp macro system every day.