Info on Smalltalk DSLs or Metaprogramming...

Ralph Johnson johnson at cs.uiuc.edu
Tue Aug 15 11:25:41 UTC 2006


On 8/14/06, Rich Warren <rwmlist at gmail.com> wrote:
> Great! Thanks. That should let me bootstrap the things I need.
>
> Does anyone know of any general references to writing interpreters/
> DSLs/Metaprogramming in SmallTalk?

Writing interpreters is so easy in Smalltalk that people don't even
talk about how to do it.  See the "Interpreter" pattern in "Design
Patterns".  This was my attempt to explain it, though we did it in a
language independent way.  Basically, you just build a class
hierarchy.  In fact, I bet that most of the time Smalltalkers use the
Interpreter pattern, they don't think of what they write as an
interpreter.  This means that they don't think of the class hierarchy
as a grammar or the tree of objects as an abstract syntax tree.  They
don't think of the instance creation methods as their parser, even if
they work hard to make the syntax natural.

Smalltalkers usually don't use the phrase "DSL", but instead talk
about frameworks for a particular domain.  Also, look at
http://adaptiveobjectmodel.com for some papers on DSL that are either
in Smalltalk or are similar to ones that are.  Again, the papers
usually don't mention the phrase "DSL".

-Ralph Johnson



More information about the Squeak-dev mailing list