Re: [Chicken-users] Re: first experiments with "simple-macros"

2005-08-10 Thread felix winkelmann
On 8/11/05, Zbigniew <[EMAIL PROTECTED]> wrote:
> 
> - Startup time of either simple-macros or syntax-case is very long --
> 1.7s as opposed to 0.1s without it, and this is on a 1.5GHz machine.

It's not much slower than loading the psyntax macros, though.

> So I am somewhat reluctant to use this very useful and fundamental
> concept except for big, non-time-critical apps.  Is there room for
> much optimization, or is it near the limit?

I can't say, really. There should be room for improvement, but first
we have to get it running properly.

> - Does it make sense to release official eggs using one or the other
> module system (assuming we pass the experimental phase)?  The time and
> the memory penalty give me pause---same reason I don't use TinyCLOS in
> official stuff, seems silly to drag that much code in.

Yes, that's something to keep in mind. It really depends on what
you want: for application code it makes probably more sense to
use psyntax/simple-macros modules. A counterexample is (say)
utf8: here we shadow standard procedures.

> - Does it make sense, given the time and space penalty, to use a
> module system at all for smaller projects?  Obviously, we have gotten
> by without one, but the advantages are tempting.

In small projects I find module systems more a nuisance than a real
help. For medium-sized and large systems it is crucial (the chicken
compiler, for example, should have been done using psyntax modules).

> - I can't get define-macro to work with simple-macros (after importing
> chicken-macros), but I'm sure this is my fault.

Here is a patch:

diff -c /home/fwinkel/stuff/work/kffd/chicken-macros-module.scm\~
/home/fwinkel/stuff/work/kffd/chicken-macros-module.scm
--- /home/fwinkel/stuff/work/kffd/chicken-macros-module.scm~2005-08-06
00:23:28.0 +0200
+++ /home/fwinkel/stuff/work/kffd/chicken-macros-module.scm 2005-08-11
08:07:12.145400736 +0200
@@ -21,7 +21,7 @@
   (import chicken-internals)
 
   (define-syntax include
-(lambda form
+(lambda (form)
   (if (= 2 (length form))
  (let ((count ##sys#read-line-counter)
(filename (cadr form)) )
@@ -38,12 +38,12 @@
  (syntax-error "invalid `include' form") ) ) )
 
   (define-syntax define-macro
-(lambda form
+(lambda (form)
   (cond ((and (= (length form) 3)
  (identifier? (cadr form)))
 (quasisyntax
  (define-syntax ,(cadr form)
-   (lambda exp
+   (lambda (exp)
  (datum->syntax
   (car exp)
   (apply ,(caddr form) (syntax->datum (cdr exp

> 
> Don't get me wrong, it's highly interesting and I will experiment.  I
> am just wondering if the intent is to really USE it all over the
> place, or if it will be relegated to occasional projects.

I wouldn't use it all over the place. I'd use it for self-contained
applications or large-scale library projects.


cheers,
felix


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Re: first experiments with "simple-macros"

2005-08-10 Thread Zbigniew
I too am quite interested in a decent module system, especially after
kludging a few things in the sxml-tools egg to get around the lack of
one.  I have a couple general questions/observations though:

- Startup time of either simple-macros or syntax-case is very long --
1.7s as opposed to 0.1s without it, and this is on a 1.5GHz machine. 
So I am somewhat reluctant to use this very useful and fundamental
concept except for big, non-time-critical apps.  Is there room for
much optimization, or is it near the limit?
- Does it make sense to release official eggs using one or the other
module system (assuming we pass the experimental phase)?  The time and
the memory penalty give me pause---same reason I don't use TinyCLOS in
official stuff, seems silly to drag that much code in.
- Does it make sense, given the time and space penalty, to use a
module system at all for smaller projects?  Obviously, we have gotten
by without one, but the advantages are tempting.
- I can't get define-macro to work with simple-macros (after importing
chicken-macros), but I'm sure this is my fault.

Don't get me wrong, it's highly interesting and I will experiment.  I
am just wondering if the intent is to really USE it all over the
place, or if it will be relegated to occasional projects.

On 8/4/05, Michele Simionato <[EMAIL PROTECTED]> wrote:
> 
> Yes, this is why I waited some time before trying it, to have things
> settled down for me ;) I read the first announcement on c.l.s. a while ago
> and I thought it was too good to be true. What I like the most is the
> module system, I have yet to test it seriously, but at least the
> description in the SRFI document makes sense and it is more or less
> what I had desired for a module system for my first day in Scheme
> (I remember at that time I escaped from the Mzscheme module system
> which I felt overcomplicated; I also hated the fact that it forced me
> to write macro definitions and helper functions in separate modules,
> for reasons that never convinced me). A thing I have always looked at
> with suspicion in Chicken (suspicion of being more complicated than
> needed) is eval-when: OTOH, van Tonder's system works in a pretty
> obvious and reasonable way (by default things are evaluated both
> at compile time and import time; if you want to evaluate things
> at compile time only you say so and if you want to evaluate things
> at import time only you say so: the quintessence of semplicity).
> Still I do not understand why things should be more complicated
> than that and which are the pittfalls of van Tonder's system (if any).


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users