From: Timothy J. H. <tim...@ma...> - 2004-05-27 11:18:55
|
I'm thinking about changing our approach to primitives. I've written all of the primitives directly in javadot and the built-in JScheme special forms (set!, macro, if , or, lambda, quote, begin. See jscheme/prims.scm You can try it out like this... > tim% java -cp lib/jscheme.jar jscheme.REPL > > > JScheme 7.0 5/25/04 http://jscheme.sourceforge.net > > ;;;First blow away the old environment ... and get left with just javadot and 7 special forms... > > (.INTERACTION_ENVIRONMENT$ (Scheme.currentEvaluator) > (jsint.DynamicEnvironment.)) > jsint.DynamicEnvironment@c21ece ;; now load up the new prims > > (Scheme.load "jscheme/prims.scm") > #t ;; and run the Scheme Tests successfully > > (load "jscheme/SchemeTests.scm") > > > **************** Running jscheme/ScemeTests.scm ****************** > several warnings should appear below as certain error conditions are > tested > this is to be expected and does not signal a problem with the tests > > ** WARNING: No such instance method "equalsFirst" in class jsint.Pair > ** WARNING: No such instance method "equalsFirst" in class jsint.Pair > ** WARNING: No such static method "hashCode0" in class jsint.Pair > ** WARNING: No such static method "hashCode0" in class jsint.Pair > Tests: 266 Failures: 0 > > All tests have completed with any errors as shown above > Try (run-tests #t) to see both failing and successful tests and their > results > ********************* jscheme/SchemeTests.scm has completed > *********************** > > #t > > (exit) > [Timothy-Hickeys-Computer:~/Research/Software/jscheme] tim% The performance seems fairly close to the current performance. I've downloaded the gabriel benchmarks for scheme and will compare the two versions. I'd like to replace the primitives.scm, Primitive.scm, and primproc.scm in jsint, with jscheme/prims.scm. The idea would be to load jscheme/prims.scm directly into an evaluator with the NULL_ENVIRONMENT. The advantage of doing everything in Scheme is that we get to program in Scheme instead of Java, and I don't think there will be much of a performance penalty. ---Tim--- |