Arc Forumnew | comments | leaders | submitlogin
1 point by almkglor 5944 days ago | link | parent

> Or should I write my own language that says "interpreted languages are supposed to be slow; don't worry about it" for the sake of more powerful (in theory) macros? ^^

You might be interested in Common Lisp's 'macrolet form. I've actually implemented this in Arc waaaaaaay back.

Considering that CL is targeted for direct compilation to native machine code (which is even simpler than mere bytecode), you might be interested in how CL makes such first-class macros unnecessary.



1 point by shader 5942 days ago | link

I'm very interested in both of those. Would you care to explain? If not, do you have any particularly good resources (besides a google search, which I can do myself)?

-----

1 point by almkglor 5942 days ago | link

The macrolet form in Arc: http://arclanguage.com/item?id=3085

As for how CL makes first-class macros unnecessary most of the time, it's primarily 'macrolet and packages.

-----

1 point by shader 5935 days ago | link

So, how does that work, exactly? Does macrolet tell lisp that since the macro is only defined in that scope, it should search more carefully for it, because it doesn't have to worry about slowing down the whole program?

-----

1 point by almkglor 5934 days ago | link

Err, no. It simply means that the particular symbol for it is bound only within the scope of the 'macrolet form. In practice, most of the time, the desire for first-class macros is really just the desire to bind a particular symbol to a macro within just a particular scope, and 'macrolet does that.

For other cases where a macro expansion should be used more often than just a particular scope, then usually the module or whatever is placed within a package and a package-level macro is used.

-----