chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] CVS update: hygienically unhygienic


From: Peter Keller
Subject: Re: [Chicken-users] CVS update: hygienically unhygienic
Date: Fri, 13 Dec 2002 21:34:43 -0600
User-agent: Mutt/1.4i

On Sat, Dec 14, 2002 at 12:02:14AM +0100, felix wrote:
> 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.

Awesome!

> 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]

Will define-syntax still work normally too?

(define-syntax disp
        (syntax-rules ()
                ((_ bar)
                        (display bar))))

I've never seen the other kind of usage for define-syntax.

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

After updating to the current sources, and making, I got this:

make[1]: *** No rule to make target `psyntax-chicken.pp', needed by 
`syntax-case.c'.  Stop.

> 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).

So, is there a lesson to be learned here? To ask a hard question, 
is the method that chicken uses to compile scheme scalable?

> 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.

This is very, very cool!

> 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...

This would immensely help debugging. Please try to get it working if
you can!

> Chicken now compiles on OpenBSD. Thanks to Steve Elkins!

MAC OSX! MAC OSX! :)

Thanks for getting this to work Felix, I don't think you'll be disappointed
by finally unifying hygienic and lowlevel macros so they can be used together.

-pete





reply via email to

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