[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [plt-scheme] Adding a language



> languages other than Scheme -- (eg Algol 60).

>   - have this button get the current drscheme:language:language<%>
>     (this tells you how to compile the program in the definitions
>      window into Scheme) and use the front-end method to
>     get Scheme code out.

	So using the front-end method, I can extract the text directly from the
Definitions window. Whereas the Algo 60 implementation must parse and compile,
I can treat the contents of the window as S-expressions in a fairly direct
manner (yes?). For example, looking at the Algol60 tools module

(let-values ([(port name) (if (...) (... file or text ...))])
	(lambda ()
                (if (eof-object? (peek-char port))
                    eof
                    (compile-simplified ; <--
                     (simplify (parse-a60-port port name) base-importing-stx)
                     base-importing-stx)))))

This is where I do my work, essentially. (I'm on a 28.8 connection, and don't
have the MrEd docs right now; I seem to remember that I can grab a text<%> as
S-expressions; I'll look it up in an hour when it downloads...). A question I
have: by defining a module with some 'define-syntax'es for forms that my core
language doesn't support, can I get MzScheme to do the heavy lifting for
syntactic transformation, and then pass the resulting, expanded code to my
compiler? (Or something similar?) I assume so.

>   - invoke the Scheme -> Forth compiler on that code and somehow
>     hook that up to the LEGO Mindstorm.

	Ideas on this later.

	Thanks,
	Matt