From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: Lightning Bindings
Date: Tue, 01 Jun 2010 20:02:51 +0200 [thread overview]
Message-ID: <871vcqd41g.fsf@gnu.org> (raw)
In-Reply-To: DED46412-5EEA-4A5C-A392-7D05091B2AEF@gmail.com
Hi Noah!
Noah Lavine <noah549@gmail.com> writes:
> Here is my understanding of the three approaches:
>
> The approach in my project was to make machine code a Guile datatype,
> which you could allocate with a special init function and write to
> with writing functions which are just Guile versions of the Lightning
> macros. It could be called as a function through the dynamic FFI.
>
> The approach in the other guile-lightning project is to represent the
> Lightning code as a Guile list which mirrors the Lightning virtual
> instruction set. When a list is completely built, it would then be
> passed to a special function (written in C) to assemble it. It also
> has some infrastructure for labels and a special method of calling
> these functions, neither of which I understand yet.
>
> The approach in your 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.
Yes.
> The reason I did not use the approach of the other guile-lightning, to
> make a list and then assemble it, was that it seemed inelegant and
> possibly slow
It depends on when and how the instruction stream is written. From a
usability viewpoint, having a simple s-exp for asm instructions is
nice (and elegant, IMO).
OTOH, I find the ‘make-integer-id’ example at
<http://github.com/noahl/guile-lightning/blob/master/binds.scm> quite
elegant too.
BTW, note that end-of-buffer situations must be handled, somehow. If
the whole call generation procedure is burried in a single C functions,
it can hide these details to the application. Otherwise, it’d be up to
the application to handle this situation, e.g., by linking two code
buffers together and adding a jump instruction in the first one to the
second one.
Anyway, these are just random thoughts.
Thanks,
Ludo’.
next prev parent reply other threads:[~2010-06-01 18:02 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
2010-06-01 18:02 ` Ludovic Courtès [this message]
-- 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=871vcqd41g.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guile-devel@gnu.org \
/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).