unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: native compilers
Date: Mon, 21 Jan 2013 19:43:50 +0100	[thread overview]
Message-ID: <CAGua6m3VT1yyvunARxJOf8xEf4PL9hXd-yWMWsSioOtL2cbaOw@mail.gmail.com> (raw)
In-Reply-To: <874nia5vgw.fsf@pobox.com>

[-- Attachment #1: Type: text/plain, Size: 2447 bytes --]

Yeah, this is pretty crazy stuff. But crazy fun stuff!

1. Anyway I think that I could just do away with two table lookups to reach
both
c-function pointers and the goto gosub stuff generated from assembler.

2. A think more work is needed of the extra layer to allow for correct
continuation
properties.

3. Would be good if we could just pass a pointer to the rtl-vm local data
in stead of copying
them into a third vm.

4. Good register handling is needed, right now this is the most simplest
approach you can have
towards native / JIT compiling e.g. take the rtl code and transform it
directly to rtl code. you do get
faster code but it would be nice to actually take advantage of hardware
regiosters. And for that
we would need ideally to compile from something else than rtl bytecode.
Anyway I could imagine an
intrmediate state of guile where we took this simplistic approach to
compiling - it should at least
be very fast to compile the code and if we look at it as some speedier VM
it's actually not a bad idea
appart from beeing hard to maintain with respect to hardware architecture.

5. To simplify further we could design most of the meaty stuff in C-code
and restrict the target registers
for this code and hook everything together with some basic assembler. Then
I don't expect the assembler
work to be that hefty.

6. As Noha later on in the list point out, there is already JIT engines out
there that can work with this without the
extra overhead. But I'm so in love with assembler in scheme that I couldn't
resist hacking this together.

Regards
Stefan



On Mon, Jan 21, 2013 at 5:53 PM, Andy Wingo <wingo@pobox.com> wrote:

> On Sat 22 Sep 2012 23:28, Stefan Israelsson Tampe <stefan.itampe@gmail.com>
> writes:
>
> > I've now coded two version of native compilers for x86-64 linux
> > compiling either the old guile-2.0 VM language or guile-2.2 RTL VM
> > language.
>
> This is pretty crazy and wonderful stuff, Stefan.
>
> > https://gitorious.org/aschm
>
> https://gitorious.org/aschm/aschm/blobs/rtl/module/native/vm/inst.scm
> looks really promising.
>
> I guess I need to consolidate the RTL branch now, and we need to make
> sure that we can plug in a JIT.  I don't want to incorporate all of this
> code at once, so ideally we can make it so that you can load your code
> as a module and Guile will have the needed hooks to run JITted code if
> it is there.
>
> Excellent hacking!
>
> Andy
> --
> http://wingolog.org/
>

[-- Attachment #2: Type: text/html, Size: 3686 bytes --]

  reply	other threads:[~2013-01-21 18:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-22 21:28 native compilers Stefan Israelsson Tampe
2013-01-21 16:53 ` Andy Wingo
2013-01-21 18:43   ` Stefan Israelsson Tampe [this message]
2013-01-21 20:10   ` Stefan Israelsson Tampe

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=CAGua6m3VT1yyvunARxJOf8xEf4PL9hXd-yWMWsSioOtL2cbaOw@mail.gmail.com \
    --to=stefan.itampe@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.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).