lua-users home
lua-l archive

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


On Fri, Nov 11, 2011 at 10:22 AM, Gopalakrishnan Subramani <gopalakrishnan.subramani@gmail.com> wrote:
All,

What are the toolset/libraries available in Lua to write the interpretter in Lua for a Domain Specific Language? Can you point the different way of implementing interpreter like

1. Should I convert the language to Lua byte code convention before execution?
2. The core framework will be written in Lua say for example print "hello" in the domain specific language calls a Lua print or similar function writing in Lua. I am not sure whether to map to lua function or should I generate Lua byte codes.

Looking for general advice, where as I never had experience writing interpretter myself, but this is going to be long term project for us. Any basic/intermediate/advanced tutorials or examples would be appreciated.

Thanks,

Gopalakrishnan

Hi Gopalakrishnan,

I've implemented several DSLs on top of Lua - mostly stack-based ones,
so I'm sure that other people are going to be much more able to advise
you about syntax than me :-) - the main links are:

  http://angg.twu.net/dednat4.html
  http://angg.twu.net/miniforth-article.html
  http://angg.twu.net/miniforth-article.html#bootstrapping
  http://angg.twu.net/littlelangs.html

All my DSLs are easy to bootstrap and to extend - but it took me years
to find the easiest ways to attain that, so there's some chance that
you will find some nice tricks there.

I am sure that there are lots of people here who implement DSLs all
the time, but most of these languages are too simple to deserve being
announced publically... Can you say more about what you want to do,
give samples of the syntax that you would like to support, how much
would you mind if this syntax would be changed to make it easier to
implement, etc?

  Eduardo Ochs
  eduardoochs@gmail.com
  http://angg.twu.net/


P.S.: Jon Bentley: "Little Languages" (CACM version)
  http://classes.eclab.byu.edu/330/docs/p711-bentley.pdf