Here’s to Andy

Guile 1.9.0, the first in a series of alpha releases leading to 2.0 by the end of this year, has just been released. The number of improvements listed in the NEWS is impressive: you may well find that most, if not all, of your pet peeves against Guile are a thing of the past, and also relish one or three features that are hard to find in other schemes. As for me, after working with the development version for some months now, i’m sold. Here are some of my favourites goodies:

The new compiler and virtual machine:

** Guile now can compile Scheme to bytecode for a custom virtual machine.

Compiled code loads much faster than Scheme source code, and runs around
3 or 4 times as fast, generating much less garbage in the process.

which comes with automatic caching of object files, and provides a language tower that is beginning to fulfill Guile’s foundational goals:

** New language: ECMAScript

Guile now ships with one other high-level language supported,
ECMAScript. The goal is to support all of version 3.1 of the standard,
but not all of the libraries are there yet. This support is not yet
documented; ask on the mailing list if you are interested.

Yes, Guile has now multi-language support and, what’s more important, a clearly defined way of adding new languages to the mix (full Elisp support comming).

What must be the most infamous Guile misfeature is over:

** The psyntax expander is now hygienic with respect to modules.

Free variables in a macro are scoped in the module that the macro was
defined in, not in the module the macro is used in. For example, code
like this works now:

   (define-module (foo) #:export (bar))
   (define (helper x) ...)
   (define-syntax bar
     (syntax-rules () ((_ x) (helper x))))

   (define-module (baz) #:use-module (foo))
   (bar qux)

It used to be you had to export `helper' from `(foo)' as well.
Thankfully, this has been fixed.

thanks (thanks, thanks!) to the new psyntax:

** psyntax is now the default expander

Scheme code is now expanded by default by the psyntax hygienic macro
expander. Expansion is performed completely before compilation or
interpretation.

Notably, syntax errors will be signalled before interpretation begins.
In the past, many syntax errors were only detected at runtime if the
code in question was memoized.

with such additional niceties as allowing docstrings in macros (docstrings is problably the Guile extension over standard scheme that i like most). Note also that now Guile knows about syntax-case and syntax-rules by default, no need to import additional modules to get that.

And, to finish my laundry list, some new modules for good measure:

* New modules (see the manual for details)

** `(srfi srfi-18)', more sophisticated multithreading support
** `(ice-9 i18n)', internationalization support
** `(rnrs bytevector)', the R6RS bytevector API
** `(rnrs io ports)', a subset of the R6RS I/O port API
** `(system xref)', a cross-referencing facility

The last one, in particular, being put to good use in Geiser. And, by the way, ‘multithreading’ here means native multithreading.

While it’s true that there are still some bugs and rough edges to be smoothed, the future looks bright for Guile, and 2.0 will be a landmark in its history. All these goodies are the result of the combined effort of several hackers, but, without meaning to belittle any of them, i must bow to the amazing hacking powers of Andy Wingo. During this last year, almost single-handedly, he has brought us the compiler and virtual machine, the ECMAScript language, and the psyntax expander. I must remember to introduce myself as “Andy’s coworker” more often!

Happy hacking!

Posted in Scheme. 2 Comments »

2 Responses to “Here’s to Andy”

  1. popurls.com // popular today Says:

    popurls.com // popular today…

    story has entered the popular today section on popurls.com…

  2. Top Posts « WordPress.com Says:

    […] Here’s to Andy Guile 1.9.0, the first in a series of alpha releases leading to 2.0 by the end of this year, has just been released. […] […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: