3 ms·
I wouldn't be very optimistic. How do you plan on transpiling Scheme to Javascript? The easiest way to transpile would be to write a Javascript interpreter for
by ufo 10y ago
I wouldn't be very optimistic. How do you plan on transpiling Scheme to Javascript?
The easiest way to transpile would be to write a Javascript interpreter for Scheme, but that would completely confuse the Javascript JIT compiler, since all it would see is one big hot loop with very branchy code inside it. That said, Pycket (which is mentioned in the paper) takes exactly this approach. They take advantage of PyPy's meta-JIT framework, which was designed exactly for this sort of thing.
The other way would be to try to transpile Scheme directly into Javascript. But now you face the problem that there is a big mismatch between the two languages. The datatypes aren't the same, Javascript doesn't have guaranteed tail recursion, and so on. Just writing the transpiler will be a lot of work and even if you succeed, the end result is not going to look like idiomatic Javascript, so there is a good chance that the Javascript JIT won't do a good job at optimizing it.