ConstructSubLanguagesDynamically

ThoughtStorms Wiki

Something I've been thinking about for my hypothetical next-generation-language : a language which allows you to write other languages.

Maybe the standard libraries include classes which do LexAndYacc type things. Or maybe it's even more integral with the language, the way regular expressions are in PerlLanguage.

Why?

  • so it's very easy to write little languages for various control and config files
  • you you can define little languages as custom interfaces to complex data-structures and classes.

Actually, I hear rumours that this is something LispLanguage does. One day I really need to have a look at that

SmallTalk allows you to edit the language interpretter, so I guess you can build it out from there.

Yup. LispLanguage does allow you to basically redesign the language, as long as you restrict yourself to the (normal (lisp-ish syntax)), using macros.

That old fave from the Sussex days Pop-11 allows you to go a little bit further since you can dig into the compiler and tack in extra bits of parsing logic - but it's tricky since there isn't a parser/lexer sitting around as a first class thing for you to fiddle with.

Perl 6 looks to be very interesting for writing domain specific languages since it actually has it's grammar as a first-class object that you can tweak to your hearts content. Basically the Perl 5 regexp system has grown up into exactly what you're after.

Just got to wait for somebody to finish an implementation (and the way PUGS is going we probably won't have to wait too long :-)

AdrianHoward

LinkBin

Backlinks (2 items)