Re: [stack] Cat 0.14 Release
"William Tanksley, Jr" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
Christopher Diggins <[email protected]> wrote: > William Tanksley, Jr <[email protected]> wrote: > > Impressive. > Thank you. :-) Talk is cheap -- code (and good specifications) are much harder. > > Can macros be typechecked? > How were you thinking? I plan to add the feature later on that value > variables can have type restrictions, like: > macro { $a:int $a:int add } => { $a $a add_int } That's essentially what I was thinking, yes. I guess I should call those type guards rather than type checks, since they can't make the macro valid or invalid; rather, they force the macro to only apply to text if the types involved match. > For now there isn't such features. That's just fine. > > Are macros specifically checked for > > identity, is it assumed, or can macros cause wildly different results? > The macros are assumed to be compatible with the langauge semantics. Assumptions are just fine, also. > If MetaCat matures later on then it could be concievable that MetaCat > actually defines the operational semantics of the language, which > would be trluy mind-blowing, but not outsiode of the realm of > possibility. Alan Kay I believe is working on something similar. A very interesting point! Actually, this did pop into my mind, since your macro notation reminded me of Kerby's combinator notation. > > Can a macro cause type-conformant code to be non-conformant? > Yep. Is code typechecked both before and after substitution? > > I see that it's implementation-dependant whether a macro is allowed to > > reduce code. I think that makes sense, but I think that should > > probably be formalized a bit, > I agree. ...but saying "should probably be formalized" is a long way from doing the work to formalize them. :-) > > and control over whether a macro reduces > > code that it matches be given over to the programmer (possibly with a > > simple rule to prevent huge delays). But that's a HUGE project, > > obviously. > It might not be too bad, if I add namespaces, macro prioritization, > and macro expansion directives. I can imagine a simple import > directive inside of a namespace, that brings macro rules in to bear on > a specific scope (e.g. curly brace blocks), and other directives that > allow control. True. I was thinking of a system which could express arbitrary identity transformations, and coordinate among them so that the language's entire optimizer could be expressed in its metalanguage. THAT is a big challenge. > The big challenge is to do such things elegantly. Yes, elegance is difficult. > The notion of > namespaces is something that I have been playing with for a while and > have somewhat prepared in the code-base. Cool. > Thanks for the feeback. Thank you for the solid work! > Christopher -Billy