unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Noah Lavine <noah.b.lavine@gmail.com>
Cc: guile-devel@gnu.org
Subject: Re: A Working (but Minimal) JIT
Date: Sat, 20 Nov 2010 14:37:04 +0100	[thread overview]
Message-ID: <m3oc9k15hb.fsf@unquote.localdomain> (raw)
In-Reply-To: <AANLkTimGPtG18P4w6K6BggU1ppm38a7f7HXozDS0FMGS@mail.gmail.com> (Noah Lavine's message of "Fri, 22 Oct 2010 00:29:52 -0400")

Hi,

On Fri 22 Oct 2010 06:29, Noah Lavine <noah.b.lavine@gmail.com> writes:

> After not emailing for a while, I have some good news: a JIT engine is working!

Great news!

I have been behind on things a bit, so apologies for taking a month to
get back to you, and then only partially. In any case Ludovic probably
knows more both about assembly and JIT work, so I'm happy to not be a
"gatekeeper" of sorts here...

That said, I am concerned about complexity. The current VM, though
obviously slow, does have the advantage of being relatively
simple. Adding a JIT complicates things. Well, adding another form of
compilation complicates things, JIT or AOT or whatever -- so my primary
concern is that, as we add native compilation, we need to keep things
mentally tractable.

I have worked with many people who seem to be able to keep an inhuman
number of names and relationships in their head at one time. I fear I am
not such a person, so we will have to keep things extra-simple :)

So what I would really like to see would be:

  * Ideally, a 4-word objcode representation that includes native
    code.

  * A well-defined convention for that native code. That's to say that
    the native code could come from JIT compilation, or from AOT
    compilation.

  * A uniform way to invoke native code from the VM, and VM code from
    native code -- *preserving tail calls*. This seems to require either
    trampolines within the VM or platform-specific tail-call assembly.

  * A uniform interface to create JIT code as needed, in the call
    instructions. i.e.
        if (SCM_UNLIKELY (SCM_NEEDS_JIT (proc)))
          scm_jit_x (proc);
    or something.

We should be able to merge all of that into Guile before any JIT code
goes in, and maybe even before 2.0 if the patches were small enough and
came fast enough ;-) Then we could take our time experimenting on how
best to do native compilation.

So, to reiterate: *simple*, with a good *tail call* story. If we can
find a solution that has those characteristics, fantastic :)

Andy
-- 
http://wingolog.org/



  parent reply	other threads:[~2010-11-20 13:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-22  4:29 A Working (but Minimal) JIT Noah Lavine
2010-10-22 21:46 ` Phil
2010-10-27 21:17   ` Ludovic Courtès
2010-10-27 21:10 ` Ludovic Courtès
2010-10-27 22:53   ` Noah Lavine
2010-11-02 22:51     ` Ludovic Courtès
2010-11-20 13:37 ` Andy Wingo [this message]
2010-11-28 20:56   ` Noah Lavine
2010-11-29 21:25     ` Andy Wingo
2010-12-02  3:58       ` Noah Lavine
2010-12-06 22:06         ` Andy Wingo
2010-12-06 22:53           ` Noah Lavine
2010-11-28 20:58   ` Noah Lavine
2010-11-28 22:36     ` Ludovic Courtès
2010-11-29  7:18       ` Ken Raeburn

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=m3oc9k15hb.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=noah.b.lavine@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).