guile-devel
[Top][All Lists]
Advanced

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

Re: Lightning Bindings


From: Andy Wingo
Subject: Re: Lightning Bindings
Date: Tue, 01 Jun 2010 11:15:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

Hi Noah,

On Tue 01 Jun 2010 00:49, Noah Lavine <address@hidden> writes:

> The approach in [Ludovic's] plan for JIT, as I understand it, is to
> implement this completely in the C layer. The machine code would be
> stored as part of the representation of a procedure, and would be
> invisible from the Scheme side.

Well, one should always be able to disassemble that code, architectures
permitting :) I do think this is the right way to go FWIW, though
perhaps we should only JIT existing procedures after they have been
called some number of times. There is also the Rubinius strategy of
offloading JIT compilation to a separate thread, but that shouldn't be
necessary...

> As for doing it all in C, I am concerned about this because if there
> were bindings available in Scheme, then it might be possible to write a
> nice compiler in Scheme someday, which would do clever things like
> inlining and interprocedural optimization.

I think we'll have this eventually, yes -- but that's at a level above
native code generation. This kind of optimization is best done as
source-to-source transformations of Tree-IL, IMO. See e.g. Oscar
Waddell's thesis.

> What do you think of this? What way should I try to implement this?

Are you most interested in AOT compilation or JIT compilation? If it's
JIT, I would work on something more like Ludovic's solution; if it's AOT
compilation, I would see about making a compiler from one of Guile's
intermediat languages to a new "lightning" language. See "Compiler
Tower" in the manual.

Just my opinion anyway :)

Cheers,

Andy
-- 
http://wingolog.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]