[plt-scheme] just starting, comming from j2ee

From: Dominique Boucher (dominique.boucher at nuecho.com)
Date: Tue Nov 2 14:00:11 EST 2004

Hi Jaime,

> I found this page
> (http://sisc.sourceforge.net/comparison.php) that compares 
> Kawa, JScheme, Bigloo and SISC, and I went to their web sites 
> to read, but I havent test myself anything (I need to learn 
> Scheme first, I guess :)

Don't base your decision on benchmarks like those. Choose 
a Scheme system that suits your needs (libraries, features, 
compliance to a standard, etc.). Unless you have to implement
very CPU-intensive algorithms, almost all Scheme implementations
will do, in terms of performance (at least in the context of web 
applications). Even interpreted systems will do well.

> What I didn't like from Kawa is that you have to compile and 
> deploy your servlets like regular java servlets, and you 
> don't have a REPL so you loose some of Scheme's good 
> qualities. (Is that so in your experience? )

First, you are not required to compile your Scheme code. You
can simply load all your Scheme files at startup time, and the
performance will not suffer that much. 

Also, Kawa does provide a REPL. I use it all the time to test my
code. But like many other Scheme systems, it does not let you 
inspect local stack frames when an error occur (like in Gambit-C). 
You're dumped to the top level.

> There are also some restrictions about continuations, tail 
> recursion, etc but at this point I don't know it those will 
> matter at all for my project. 

In my case, I missed tail calls only once in the last year or so.
But YMMV. Depends on you problem domain. 

> Same for the slower JScheme and the faster Bigloo.

Also, last time I checked, Bigloo required the -noverify flag to
be passed to the JVM. You don't want this in a production 
environment like Bea Weblogic or IBM WebSphere...!

> SISC is the more flexible but then, I don't know, would it be 
> possible to build a highly scalable site on top of an 
> interpreter made in java? 

I don't have a lot of experience with SISC. I can't comment.

> I would really appreciate if you tell me a little about your 
> experience with Kawa.

I use Kawa Scheme at work for the development of a DSL 
(domain-specific language) for developing industrial-strength 
speech (VoiceXML) applications for use by large call-centers, as well as 
some other speech-related technologies. (The speech applications
are web-based.) The DSL is itself a S-expression-based language, 
with embedded Scheme code fragments/scripts (instead of 
the usual XML/JavaScript pair). 

(Last year, one of our applications served about 70,000 calls in 
three weeks on 48 phone lines. This may not seem much for a 
web application, but for a speech application, it is. Also, the 
Java/Scheme application server was by far the most stable part of the 
whole solution.)

I chose Kawa because most of our clients work in J2EE 
environments and for its speed. I also looked at Bigloo, but
didn't like its Java-Scheme interface.

Kawa itself is quite stable. When you find a bug, Per Bothner 
(the author of Kawa) is very responsive and usually fixes
the bug in a matter of hours. 

Since I must interface my Scheme code with a lot of Java code 
(written by me or my colleagues), I have to use the Eclipse 
environment. But Scheme is not supported in Eclipse, and all
Scheme plugins available were of poor quality.  So I wrote my  
Scheme editor plug-in for Eclipse: http://schemeway.sourceforge.net.
It is quite stable now (I will release the latest version this evening)
and is a fairly decent editor, with lots of customizations. 

> I was wondering if it would be to much of an "impedance gap" 
> between the java libraries (say, jdbc,
> jndi) and Scheme as a language. Can you really "think in 
> Scheme" having to use libraries that weren't designed for that?

Kawa does a nice job of interfacing Scheme and Java. With the
help of a few macros, one can turn a Java API into a new mini-language
embedded inside Scheme. But whatever Scheme system you choose,
you'll have to interface with existing libraries (usually in C). You will
face the same "impedance gap". Macros are the key, here.

And how do you defined "think in Scheme"? For me,  this means:
 - dynamic typing (tagged values)
 - S-expressions and the list data-type
 - closures with indefinite extent
 - higher-order functions
 - powerful macros for building syntactic abstractions
 - tail-call optimization
 - continuations
Most of my problems do not require the last two. But all others
are very important to me. For this reason, I tend to minimize the interface
between Java libraries and my own Scheme code. 

I think the real question is: why are you interested by Scheme? 
If it's the concept of continuation-based servers, then take a 
closer look at SISC and PLT-Scheme. IMHO, this could 
be the future of web server technologies (even if there are
a number of challenges that still need be addressed, like Matthias
pointed out in another message).


Dominique Boucher
Lead Developer
Nu Echo Inc.

Posted on the users mailing list.