unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Ian Price <ianprice90@googlemail.com>
To: "Gary V. Vaughan" <gary@gnu.org>
Cc: Guile User <guile-user@gnu.org>, Zile bugs <bug-zile@gnu.org>,
	Reuben Thomas <rrt@sc3d.org>
Subject: Re: Anniversary hack: Zile editor with Guile support
Date: Mon, 25 Mar 2013 06:24:21 +0000	[thread overview]
Message-ID: <87mwtsov3e.fsf@Kagami.home> (raw)
In-Reply-To: 2BDCB6D4-B5B0-42D5-B5C8-FD0F2BD1D72A@gnu.org

"Gary V. Vaughan" <gary@gnu.org> writes:


> I think we are misunderstanding one another somewhere :(
>
> I'm talking about this:
>
>   1. user writes some Guile Scheme, and feeds it to Lua Zile
>   2. Lua Zile runs zlc to translate Guile Scheme to Lua
>   3. Lua Zile runs luac to compile output of (2) to Lua bytecodes, and
>      saves the result to disk
>   4. Lua runtime executes file of Lua bytecodes.
>
> I really don't see how Tree-IL fits in here, or makes loading and executing Guile
> Scheme sources from Lua Zile any easier.
>
> What am I missing?

Two observations:

1. The frequent references to Guile Scheme (as opposed to just Scheme)
imply that Guile compatibility is desirable.

2. The most compatible Scheme implementation with Guile is, quite
obviously, Guile.

So, then, my advice is quite simply to maximise the use of Guile, and
minimise the use of new code when writing this Guile-Scheme->Lua
compiler.

Since Guile is written as a hierarchy of translators, you don't need to
implement Scheme per se, but can instead implement one of the languages
to which we can compile Scheme already, and ask Guile to compile Scheme
to that for you.

e.g. guild compile foo.scm --to=tree-il --output=foo.tree-il

Tree-IL is the "default" option, as it is relatively close to Scheme,
but you won't have to deal with things like hygienic macro
expansion. However, you can pick whichever one you find easiest to
translate to Lua or Lua Bytecode.

I actually intend to follow a similar approach with a
guile-in-the-browser project I would like to write, however, I am
probably going to implement a vm, and have it interpret Guile's assembly
language directly.

I'm not sure I can be clearer than that. If it wasn't enough, well, just
pretend I didn't say anything :)

-- 
Ian Price -- shift-reset.com

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"



  reply	other threads:[~2013-03-25  6:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOnWdoggx6YWV_VUuYcdosvsXFwYXzua57NaUTa7ZT3RiUtvOA@mail.gmail.com>
     [not found] ` <4CB5C160-9728-4784-ABA1-E8BDFC825990@vaughan.pe>
2013-03-22  1:13   ` Anniversary hack: Zile editor with Guile support Gary V. Vaughan
2013-03-22  2:43     ` Mike Gran
2013-03-22  3:10       ` Gary V. Vaughan
2013-03-25  2:13         ` Ian Price
2013-03-25  2:21           ` Gary V. Vaughan
2013-03-25  4:10             ` Ian Price
2013-03-25  4:22               ` Gary V. Vaughan
2013-03-25  6:24                 ` Ian Price [this message]
2013-03-25  7:06                   ` Gary V. Vaughan
2013-03-25  2:52           ` Nala Ginrut
2013-03-22 11:05     ` Ludovic Courtès
2013-03-23  1:32       ` Nala Ginrut
2012-02-13  0:51 Mike Gran
2012-02-13 14:25 ` Bernardo Ezequiel Contreras
2012-02-13 15:37   ` Mike Gran
2012-02-13 22:40     ` Ludovic Courtès
2012-02-13 14:27 ` Ludovic Courtès
2012-02-14  5:46   ` Mike Gran

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=87mwtsov3e.fsf@Kagami.home \
    --to=ianprice90@googlemail.com \
    --cc=bug-zile@gnu.org \
    --cc=gary@gnu.org \
    --cc=guile-user@gnu.org \
    --cc=rrt@sc3d.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).