From: Toby A. <tob...@pe...> - 2004-03-10 02:04:41
|
On Tue, Mar 09, 2004 at 06:58:35PM -0500, Ken Anderson wrote: > I think we need to do this carefully. I'd like to hear what Tim has > to say. I completely understand. I'm proposing a fairly major change. > Peter Norvig's original intent was to make jsint.Scheme static "to > keep it simple", basically. However, it does cause problems with > things like Scheme.out$ So for example if you have multiple > using.Active.interactor() windows up only the last one has control of > input and output. > > In fact, i think its fair to say that Peter's design choices were > influenced by Java's capabilities at that time, for example , "keep > the number of classes small" to minimize applet load times ... With > hotspot, we might now make other choices. I haven't considered applet loading performance as I'm not interested in using JScheme in an applet. I don't think anything I've done will cause problems in that department. > We could also run JScheme in JDK 1.02 environments, which i think we > have finally gone beyond. In my initial implementation (which I'm testing right now), I've used some JDK 1.2 classes (and possibly some 1.3 ones), but that can probably be worked around if earlier JDK compatibility is required. > A third alternative to your proposals might be to make certain things > thread local, though i haven't thought about this. I don't think there's any choice but to make some things thread local if you want to avoid passing the execution context (perhaps that's a better name than interpreter) into every method. > Tim came up with the jscheme package in an attempt, i think to clean > the original code a little, by using Interfaces for example, and he > has an example of a mini JScheme where most of the primitives are > written in Scheme. So, we need to consider carefully where your > proposed class goes. I must say that I get confused trying to tell the difference between the jsint and jscheme packages. It kind of looks like jscheme is the interface and jsint is the implementation. > Please don't use the name Interpreter. JScheme is not interpreted. > JScheme code is read, then compiled and then executed. The compiler > is both simple and effective (see how those two words almost cancel > each other out). Many people avoid Lisp languages because they fear > they are interpreted. Also JScheme code can be compiled to Java with > Tim's compiler. Evaluator might be a better class name. Hmm, I'll try to stay out of naming arguments, I always end up with a bad name. I suppose I was misled by the comment at the top of Scheme.java :-) > In fact, maybe this is a time for refactoring. I've been thinking > that jsint.Scheme should be broken up. I think some refactoring would help to sort out what this new class should be called. I don't feel close enough to the philosophy behind JScheme to do any really useful refactoring, so I'm going to prepare a patch that does the minimum I can to get it working and hope that it's of use. Toby. |