[racket] Tools for new languages

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Jul 12 08:37:57 EDT 2011

In the Racket world, OO tends to be a library; it doesn't have to be
baked in a low-level thanks to the macro system (specifically the
racket/class system is probably the most widely used oo system in

Probably the right path is to write a parser (using the parser
collection) that essentially just turns everything into a fully
parenthesized language and then use the macro system from there to
compile into some variant of Racket (you could even start off by
compiling into racket/class if you think that Grace's class system is
going to be a class-based, java-ish class system).

Also, fwiw, we are moving towards a world where users indicate the
language that they are programming in by writing a one-line
declaration at the top, something like:

  #lang grace

or maybe

  #lang grace/bsl

(for "the beginning student language" variant of Grace).

I suggest you use this route; if you decide you would rather have the
students push a button in the IDE to select their language instead of
writing that line at the top of the file, you can do something like
what we currently do in the HtDP teaching languages, where that line
is there in the saved file, but invisible when the file is being
edited in DrRacket. (Although I generally recommend just making them
write that line.)


On Mon, Jul 11, 2011 at 2:55 PM, Chris Fincher <finch42 at gmail.com> wrote:
> Hey folks,
> I'm working with a project that's designing a new pedagogical
> object-oriented language called Grace. My job is to find a good IDE, and so
> far, DrRacket has looked like a good choice. I've been slowly figuring out
> how to get a Grace parser written in Racket, but it looks as if I'm going to
> have to make a decision soon about how I'm approaching this, and I wanted to
> get the input of some more experienced Racketeers about what would be the
> best way to move forward.
> So far, my thinking has been influenced by 3 sources:
> 1) Languages included with DrRacket, such as Swindle and Datalog. Yacc and
> Lex seem to be the way to go. Unfortunately, I don't see anything
> object-oriented included, so I'm still a bit lost on how to, for instance,
> implement classes if I follow their example.
> 2) Danny Yoo's braincuddle tutorial. It's comprehensive, and implements
> everything I'd like to have done in the initial stages of the project, but
> still doesn't offer much in terms of how to get classes involved.
> 3) The remnants of the ProfessorJ project. Since it's a Java implementation
> (or at least tries to emulate it well enough), it's the most object-oriented
> example that I've been able to find. (the only one, in fact) The downside to
> using it is that it's more complex than other languages I've looked at and,
> honestly, more complex than Grace will probably ever be. Also, it's old. It
> was last included with PLT Scheme 4.1, and while at the moment, the only
> compile error that I get is to update the contract protocol, I don't know
> what else might break if I managed to fix that (which is no negligible time
> investment on its own).
> I think the main questions that come out of this are a) is there a better
> example of an object-oriented language in Racket/DrRacket that I don't know
> about yet, b) would it be worth the time investment to try to work out
> what's happening in the ProfJ code, and c) if I end up doing new code for
> this, are yacc and lex worth using, or should I eschew them like in the
> braincaressgently example?
> These are, of course, just suggested questions. I would welcome any input on
> what would be the best way forward (or misconceptions I have). Please don't
> mind the oddly list-based structure of my post. I'm not sure how that ended
> up being the format for today. Thanks in advance for your help.
> --
> cmf
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users

Posted on the users mailing list.