chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] CVS update: hygienically unhygienic


From: felix
Subject: [Chicken-users] CVS update: hygienically unhygienic
Date: Sat, 14 Dec 2002 00:02:14 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529

Hi, folks!

Check out the current CVS version: It uses the most up-to date
version of the Chez portable syntax-case macro system. This turned
out to be quite easy, since the code is well written and some
bootstrapping stuff from the old syntax-case library could be
reused.

This means the following:

1) `define-macro' is now available in combination with `-hygienic'
2) The Chez module system is fully supported. Unfortunately not with
   separate compilation. But still pretty handy.
3) `(define-syntax x (lambda (y) ...))' can now be abbreviated to
   `(define-syntax (x y) ...)' [seems to be getting fashionable
   in PLT circles]

Bootstrapping the syntax-case.scm file from the sources is
a little bit involved. If anybody is interested, I can
provide some info.

A new compiler-option and declaration was introduced, that
was needed to keep compile times in bounds. The macroexpanded
syntax-case code contains a number of very large quoted
data structures which get compiled to C code that constructs
them manually in the toplevel-procedure of the respective
module. The code was about 40000 lines of C, with roughly
half of it in the toplevel procedure! Compiled with optimizations.
GCC swapped my machine to death, so I added the switch/declaration
`compress-literals' that compiles literals beyond a certain size
to strings and reads the data at runtime from that string.
This vastly reduces the code size when large literals are used
(50% in this case) but makes the library
unit when `use'd or `require'd take longer to initialize
(There is now a noticable startup delay in both chicken
and csi - we have to see how much of an annoyance this is).

Theoretically we can now have all missing macros (let-id-macro,
let-macro, etc.) under the hygienic macro system. That has to
be done later. Even `match' can be included (as source file), but
I have done only very simple testing on that.
The one feature still missing is that the source-line information
is not retained properly (I think it only gives the line-number
of the toplevel expression). The syntax-case sources say something
about `annotations' and a hint to contact the authors. We'll see...

Chicken now compiles on OpenBSD. Thanks to Steve Elkins!

I will fix the `read-line' procedure (as proposed by Joerg) ASAP.
Promised.


cheers,
felix




reply via email to

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