Project: Some aid for low level programmer

Armin Rigo arigo@ulb.ac.be
Fri, 24 May 2002 14:49:39 +0200 (CEST)


Hello Fare,

On Fri, 24 May 2002, Francois-Rene Rideau wrote:
> A good approach that I'd like someone to take is to take lightning
> 	http://www.gnu.org/software/lightning/lightning.html
> 	http://freshmeat.net/projects/lightning/
> (based on Ian Piumarta's CCG), and port it to a high-level language,
> such as Common Lisp (e.g. using my pattern matcher) or OCaml, etc.

I should mention here that I considered lightning for my Psyco project,
which hackily does things that I would think should be very easy to
implement in a Tunes HLL using the LLL: dynamic specialisation of code. 
It could be interesting for Tunes too to notice why I have troubles with
code-emitters like lightning.  The problem is that they all insist to
consider the *function* as the base unit of code (in the sense of C). All
you can do is generate a complete function that can then be called using
some standardized argument passing convention. I believe that this is only
a small part of what the LLL should be able to do with code. Not only you
have no inspection capabilities and lack precise control flow control
(first-order continuations & co), but more importantly there are
applications (like Psyco) that just don't fit into that code model. For
Psyco for example I have to postpone the emission of code in the middle of
a function, and only when this bribe of code actually runs can the
compiler "sniff" actual run-time values to guide it in the compilation of
the next bribe. 

I believe that whoever is interested in writing a code emitter for OCaml
or Lisp should keep that in mind.


Armin