unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Noah Lavine <noah549@gmail.com>
Cc: ludo@gnu.org, guile-devel@gnu.org
Subject: Re: Lightning Bindings
Date: Tue, 01 Jun 2010 11:15:43 +0200	[thread overview]
Message-ID: <m38w6zqfk0.fsf@pobox.com> (raw)
In-Reply-To: <DED46412-5EEA-4A5C-A392-7D05091B2AEF@gmail.com> (Noah Lavine's message of "Mon, 31 May 2010 18:49:42 -0400")

Hi Noah,

On Tue 01 Jun 2010 00:49, Noah Lavine <noah549@gmail.com> 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	other threads:[~2010-06-01  9:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-31 22:49 Lightning Bindings Noah Lavine
2010-06-01  9:15 ` Andy Wingo [this message]
2010-06-01 18:02 ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2010-06-01 20:42 Noah Lavine
2010-05-27 21:03 Noah Lavine
2010-05-28 20:49 ` No Itisnt
2010-05-28 21:38   ` Noah Lavine
2010-05-29 20:09 ` Thien-Thi Nguyen
2010-06-01 14:57   ` Noah Lavine
2010-06-01 17:55     ` Ludovic Courtès
2010-06-02 20:47     ` Thien-Thi Nguyen
2010-05-29 21:39 ` Ludovic Courtès
2010-06-01  9:06 ` Andy Wingo
2010-06-01 14:55   ` Noah Lavine
2010-06-01 19:24     ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m38w6zqfk0.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    --cc=noah549@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).