Peri Hankey

Peri Hankey is an independent software developer based in the UK. He has recently published the LanguageMachine - a toolkit for language and grammar - at http://languagemachine.sourceforge.net as free software under the Gnu GPL.


WikiMailBox:

Hi Peri, because I am one who WritesCompilersAsaHobby (as you have probably seen) innovative languages like your LanguageMachine and e.g. LogixLanguage are very interesting for me. My hobby compiler is also one, that allows most surface parts of the language to be specified in the language itself - like your approach. But I am wondering: Are you doing everything with term-rewriting? Are there further data-structures? How'd you handle e.g. liveness analysis and register allocation or dead-code-elimination? -- GunnarZarncke

Hi Gunnar, I wan't sure whether to answer you here on or your page - I'm new to this WikiMailBox lark - by the way there is a mailing list for the LanguageMachine.

I think that the best way to understand the LanguageMachine is to look at the LmDiagram. The form of the diagram that is output by the machine itself shows what is happening as it happens - the central algorithm is an online algorithm - at any time it really knows only about a current goal symbol and a current input symbol. I think that in backend rules, it can operate as a term rewriting engine, but this is because of the control you have over the form of the material that is passed to such rules. As an engine, it knows only about sequences of symbols and variable bindings.

Within the left- and right- sides of rules, you can write code that is rather like a subset of Javascript, with associative arrays for associating information with symbols. Function calls are treated as calls on external procedures, and there are two different ways of interfacing to external procedures. I'm not trying to reinvent everything, and for actual code generation I would use external code generators - there's the start of an interface to GCC, and a usable interface to the TinyCeeCompiler. But there is a very small example of register allocation for a 3-address notation at http://languagemachine.sourceforge.net/grokreg_experiment.html.

I hope that helps. Did you manage to download and try the software - I can never understand anything until I have tinkered with it. --PeriHankey

Sadly I didn't have time to try it out yet, I just read what was on you page, but I could relate to the basic ideas very well. I put my own compiler on hold recently and focus my CopiousFreeTime on my OpenRepository? thingy currently (but I will need a language for that earlier or later, so...) and have few time for languages now. Anyway, your term rewriting looks promising. Your diagrams look new, I wonder if there is some research work behind it, which I would be interested in. Even if not, I can very well understand, that the language is somewhat ad-hoc still and that you do not want to reinvent everything (but instead smartly reuse). I assume, that you have a well-defined structure in the back of your head, that you would like to realize given enough time (money, support...). I wish you good luck. -- .gz

Hi Perry,

Interesting, that you found GraphReWritingCompiler related to lm - its by me :-) -- GunnarZarncke


CategoryHomePage


EditText of this page (last edited October 19, 2005) or FindPage with title or text search