Weird Compiler

Because TeX and SH are wonderful VMs.

Version 0.2: 10 times faster! —

Version 2.0 is out and is about 10 times faster than version 1! The compilation algorithm has been completely rewritten. The main benefits of new algorithm are:

  • If a program does not use higher-order functions, there is no closure creation overhead. So classic programs run as fast if they were written directly in TeX or Shell.
  • Functions may keep their name from the source to the compiled code. For example:
    let threesum = fun x y z -> let k = wcplus x y
                                in wcplus k z
    in ....

    will actually produce the function:

    threesum () {
       wcplus "$1" "$2"
       stackpush
       stackpop 1
       wcplus "$3" "$TMP1"
    }

As usual, the sources are available via git at:

git clone git://git.tuxfamily.org/gitroot/weirdcomp/weird-compiler.git

or via the tar and zip archives.


Categorised as: Uncategorized


Leave a Reply

Your email address will not be published. Required fields are marked *

*

2,312 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>