guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vm branch now uses vm repl by default


From: Andy Wingo
Subject: Re: vm branch now uses vm repl by default
Date: Wed, 10 Sep 2008 21:05:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Howdy,

On Tue 09 Sep 2008 23:01, address@hidden (Ludovic Courtès) writes:

>> On Tue 09 Sep 2008 10:41, address@hidden (Ludovic Courtès) writes:
>
>>> It'd be nice if we could find a way to "do something" with the
>>> `current-reader' fluid at compilation time, like detecting top-level
>>> `(fluid-set! current-reader ...)' statements and use that to switch the
>>> compiler's reader (hacky...).
>
> A use case is the following:
>
>   (define-module (foo))
>
>   (fluid-set! current-reader %my-favorite-reader)
>
>   ;; use non-standard syntax extensions from now on

This doesn't map very well to the current semantics of "guile-vm" -- I
was going to say "the compiler", but the compiler's fine with whatever,
it's more "the expected model of compilation" or something.

Currently when compiling an entire file, the entire file is read in and
compiled to bytecode as if it were all wrapped in a `begin'. The whole
file is compiled at once, because it was all read in at once. But that
means we have no semantic meaning to extract from the code at read-time.
What to do?

I would suggest going down a common-lispy route, and introducing read
macros. This is pretty firmly extension land anyway. Or, you could write
a custom compiler for skribilo -- probably four hours' work or so.

> Anyway, if we are to handle this at all, we're probably going to have to
> pattern-match this in `translate.scm' and switch readers when we
> encounter it.

Ew. You are a bad person ;)

Cheers,

Andy
-- 
http://wingolog.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]