[bitc-dev] DISCUSS: To macro or not to macro?
Sandro Magi
naasking at higherlogics.com
Mon Jul 21 09:30:19 CDT 2008
I also just came across this which looks interesting:
First-class Macros Have Types
In modern Scheme, a macro captures the lexical environment where it is
defined. This creates an opportunity for extending Scheme so that
macros are first-class values. The key to achieving this goal, while
preserving the ability to compile programs into reasonable code, is the
addition of a type system. Many interesting things can be done with
first-class macros, including the construction of a useful module
system in which modules are also first-class.
http://people.csail.mit.edu/alan/mtt/
Sandro
Sandro Magi wrote:
> I mean multistage languages ala MetaOCaml. For instance, see "Macros as
> MultiStage Computations: TypeSafe, Generative, Binding Macros in
> MacroML" [1].
>
> However, if macros are the way you're going, I've heard good things
> about [2].
>
> Sandro
>
> [1] http://citeseer.ist.psu.edu/440438.html
> [2] http://www.cs.utah.edu/plt/publications/macromod.pdf
>
>
> Jonathan S. Shapiro wrote:
>> Sandro:
>>
>> Can you say what you mean by "multistaging"?
>>
>> It is certainly true that a well-structured macro system can be
>> implemented in a pre-processor. There are two differences:
>>
>> 1. The macro expansion is integrated into the compiler front end.
>> This is mainly a matter of implementation.
>>
>> 2. The macro mechanism is extensible. It is certainly possible to
>> build extensible preprocessors, but most preprocessors have
>> not been extensible in this way.
>>
>> shap
>>
>>
>> On Fri, 2008-07-18 at 13:16 -0400, Sandro Magi wrote:
>>> Ever since learning about multistaging, I've never seen the point of
>>> macros. I'd imagine that BitC would only want to permit one stage, and
>>> using staging has the advantage of retaining important type information.
>>>
>>> Staging can also permit a limited form of reflection/polytypism [1]. I
>>> suspect that you might consider even a single stage as a tad too
>>> ambitious though. :-)
>>>
>>> Sandro
>>>
>>> [1] http://okmij.org/ftp/ML/#gprint
>> _______________________________________________
>> bitc-dev mailing list
>> bitc-dev at coyotos.org
>> http://www.coyotos.org/mailman/listinfo/bitc-dev
>
> _______________________________________________
> bitc-dev mailing list
> bitc-dev at coyotos.org
> http://www.coyotos.org/mailman/listinfo/bitc-dev
More information about the bitc-dev
mailing list