Menu

Try Scheme / News: Recent posts

Tomorrow: actually correct

The next thing to work on is automated testing. I have an existing test suite (tests/tests.txt), but there's much work to be done:

- Port it to Scheme (right now it's written in shorthand that is parsed by a Python script--don't ask)

- Get it to run against Guile and mzscheme (as a sanity check)

- Get it running against (command line js + Try Scheme 0.1.1). All the tests should pass.

- Get it running under (tryschemec + js + Try Scheme devel) and fix all the bugs this reveals.... read more

Posted by Jason Orendorff 2007-05-30

Yesterday: smaller and faster

Yesterday I fixed a compiler bug and suddenly the output of "tryschemec psyntax.pp" dropped from 1.6MB of buggy code to 0.5MB of buggy code. Firefox was very happy about this. And just think of all those bugs that are no more!

It was an interesting compiler bug, so I'll describe it briefly. First I have to describe the compiler a bit. One of the key things it does is take plain Scheme code and transform it to continuation-passing style, or CPS. This is a transformation that produces code with no procedure calls except tail calls. The continuations, which are implicit in regular Scheme code (neglecting call/cc), all become explicit.... read more

Posted by Jason Orendorff 2007-05-30

Compiler debugging continues

Still fixing compiler bugs. Steady progress. (reduce-depth) now has no known bugs.

Compiling psyntax currently generates about 1.6MB of JS code. This gives Firebug fits and renders Venkman completely useless. Firefox takes a few seconds to process all that JS code. It's probably acceptable, with enough UI hackery. Also, the amount of code can likely be reduced.

Posted by Jason Orendorff 2007-05-29

A speed bump

Well, my performance work has hit a speed bump. The compiler now successfully compiles psyntax.pp into JavaScript, but I've had no luck running it in the browser. The resulting JS code is quite complex--lots of nested anonymous functions--and Firefox is having a hard time running it.

But I did manage to contribute a patch to CodePress. They're pretty responsive. What a great project.

Posted by Jason Orendorff 2007-05-25

Three tracks

I'm working on three things. Bad news first.

1. I've been looking into dojo.storage. I really want the ability to load/save files, but it's been very frustrating so far. Dojo is the opposite of CodePress: big, complicated, hard to debug. And it needs debugging, because it doesn't work.

2. Work on the new, faster macro-expander (by compiling psyntax.pp to JS) continues apace. There were technical difficulties last week, so some debugging remains to be done.... read more

Posted by Jason Orendorff 2007-05-22

What's going on

The next step is a faster psyntax.

There's some newish code under /scm/compiler. It's a Scheme-to-JavaScript compiler. The generated JavaScript code depends on the Try Scheme runtime (that is, on all the code in /js/scm), but there's no arraycode in sight.

The generated code is in continuation-passing style except where the compiler determines it's ok to just call a function directly. (This is the case for standard procedures like `car` and `cdr`.) So the compiler has full support for continuations, space-efficient tail calls, procedures can return multiple values, and so on. (Without the last two, it wouldn't be able to compile psyntax.pp.)... read more

Posted by Jason Orendorff 2007-05-15