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

Re: [plt-scheme] Adding a language

[ I mistakenly took this off the list -- to sumarize the missing
  conversation for the list, Matt and I agreed that he doesn't want to
  add a language. Instead, he should call methods of the languages that
  are already in DrScheme. Those methods will transform the code in the
  definitions window into Core MzScheme (search for `expand' in Help
  Desk). He will then apply his compiler to Core MzScheme and get, in
  effect, a compiler for every language we have in DrScheme, including
  Algol 60. --robby ]

At Sat, 8 Jun 2002 09:40:20 -0500 (EST), Matt Jadud wrote:
> Robby wrote:
> > Keep in mind that if your compiler can work on the expanded form of
> > programs (see the docs on `expand' in mzscheme and on
> > `kernel-syntax-case') it will work for Algol 60, beginner thru advanced
> > scheme, module, and whatever wierd languages we add in the future (like
> > Java ;)
>    I see what you mean; I just opened the Algo60 language, and used my
> button to see what the expanded code was--and shure enough, if was
> the language of Primitive Syntax(TM).
>    So my strategy question is this: if, for now, I implement this subset
> of the primitive syntax:
> general-top-level-expr is one of
>   expr
>   (define-values (variable ...) expr)
>   (define-syntaxes (variable ...) expr)
>   (begin top-level-expr ...)
> expr is one of
>   variable
>   (lambda formals expr ···1)
>   (if expr expr)
>   (if expr expr expr)
>   (begin expr ···1)
>   (begin0 expr expr ···)
>   (let-values (((variable ···) expr) ···) expr ···1)
>   (letrec-values (((variable ···) expr) ···) expr ···1)
>   (set! variable expr)
>   (quote datum)
>   (#%app expr ···)
>   (#%datum . datum)
>   (#%top . variable)
> do you think I would hit enough programs that it would be useful? 


> Or, is
>   (case-lambda (formals expr ···1) ···1)
>   (quote-syntax datum)

quote-syntax is just a constant, like quote. Probably easy for your
compiler to handle.

>   (with-continuation-mark expr expr expr)
> and the module bits too important to leave out (initially)?

Certainly not.

FWIW, I know that there is some overhead with `module', but there are
lots of tools for manipulating them that will make your job easier in
the end. For example, in a module, you know when `cons' is `cons', but
at the top-level, you don't know if `cons' was rebound.

But, you certainly don't have to do anything like that to get started
-- it would probably be a mistake to start with them, in fact.