Scripting-language JIT compilation as data compression

homeblogmastodonthingiverse



Idea: the fundamental source of slowness in scripting languages (Python, Perl, Ruby, etc) is inefficient representations of data.

It is straightforward to convert Python bytecode into C, however this yields little speedup. It still has to do all the same reference counting and hash-table lookups.

Replace the garbage collector with a data compressor that looks for common patterns (eg key-value stores with the same keys / types / values) and replaces them with a new more compact type. It will also look for multiple copies of the same value and convert them into a single copy. Of course it will still also throw out garbage.

Language will look and feel like a modern scripting language. However, underneath it will be a functional, lisp-like language. Perhaps point-free style to facilitate compression. Simulate all the usual mod-cons with a stack of monads -- which you won't need to know about, unless you want to do something funky.

The code will be data too, hence compressible too.




[æ]