[gambit-list] Thoughts on Scheme

Steve Graham jsgrahamus at yahoo.com
Fri Jan 11 15:34:53 EST 2013

I tried typing this code several times into Gambit on my Samsung phone.  The first several times it simply defaulted to the phones default screen and each time when I invoked Gambit it would act as it should.  This last time it we to the normal Gambit screen, but all that's showing is the header line with a white screen.  I  believe the last time it opted to send a report, which I did.  Advanced Task Killer does not solve the problem.

Restarting the phone does solve this problem.

 From: Mikael <mikael.rcv at gmail.com>
To: Álvaro Castro-Castilla <alvaro.castro.castilla at gmail.com>; Meng Zhang <wsxiaoys.lh at gmail.com>; hendrik at topoi.pooq.com; Jason Felice <jason.m.felice at gmail.com>; Per Eckerdal <per.eckerdal at gmail.com>; gambit-list at iro.umontreal.ca 
Sent: Friday, January 11, 2013 9:25 AM
Subject: Re: [gambit-list] Thoughts on Scheme

2013/1/5 Meng Zhang <wsxiaoys.lh at gmail.com>
While talking about the syntactic-closures, If we ignore syntax-case, I'll disagree that it brings "incredible" complexity. I've been uncertain
>on syntactic-closures for years [..] I found
>the concept of it is quite straight forward. 
2013/1/6 Álvaro Castro-Castilla <alvaro.castro.castilla at gmail.com>

I agree with Meng.
>I see syntax-rules as a DSL for hygienic macros. It is completely "schemey" in the same way libraries like Kanren for logic programming, or FrTime for reactive programming are. The only difference is that when using hygienic macros, your code becomes data as well, to be processed before it actually turns into code.

Meng and Alvaro, ah, note taken, to have a clearer take on them personally, I'd need some serious experience of using them, and until now I did not really dig into them that much personally.

It's really unfortunate, in a sense, that in a hybrid S.C. and define-macro environment, that any use in define-macro of symbol? or any kind of symbol inspection or comparison, easly becomes *Completely Messed*.

Here's a mild example:

(define-macro (debug-print . a)
>   (for-each (lambda (e) (cond ((symbol? e) (print "'" (symbol->string e) " "))
>                               ((string? e) (print e " "))
>                               (else (write e) (print " ")))) a))
>(debug-print 5 + 7 "\n")

What is printed in the place of "+" depends on the particular grace of the SC macros loaded and the expander in this moment and instance.

It could |write| any expander-internal structure really, with any amount of object dependencies.

Now this was a really basic example, if some more extensive one comes to your mind feel free to share.

Though I deadly missed an easy-to-understand, concrete implementation with document for it during the learning process.

Yes! Like, a complete reference of Scheme macro systems: How to use them, strengths and limitations, how to implement them on their own and in hybrid forms, and what the challenges are, including illustrative examples.

This would do well as a downloadable PDF book.

Actually, when you take into account a couple of pitfalls regarding lexical scoping and shadowing and use a variety of techniques, including continuation-passing-style, writing syntax-rules macros are extremely powerful and similar to regular recursive scheme.

Can you give any code examples of use of this variety of techniques for writing extremely powerful syntax-rules macros?

2013/1/8 Hendrik Boom <hendrik at topoi.pooq.com>

On Mon, Jan 07, 2013 at 10:37:08AM -0500, Jason Felice wrote:
>> I don't think efficiency in terms of constant factors should often win
>> versus code which could be more general.   Clearly this is a value choice;
>> however, I wonder how well a compiler can eliminate type dispatching
>> without adding type annotation to the language.
>For me, the value of type anotations is the possibility of static type
>checking, which catches bugs fast.  That the compiler can then use the
>information to generate better code is a pleasant freebie.
>It would be interesting to see if the stragegy in, say, typed Racket,
>could be usefully adapted to Gambit.

Yes, type annotations that catch bugs already at expand time would be of value.

The abstract interpreter might not catch all at compile time of course, but, really enough. I'd be curious to know what kind of performance such a solution would have .. I wonder what Might published recently.

Gambit-list mailing list
Gambit-list at iro.umontreal.ca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20130111/336cb404/attachment.htm>

More information about the Gambit-list mailing list