# CVML : Cat (or Concatenative) Virtual Machine Language

## Christopher Diggins — 2008-09-14 01:02:19

    I have started releasing the source code to CVML online. It is not yet

    complete, but for anyone really interested it might be a fun project

    to follow along. The source can be checked out using SVN at

    http://code.google.com/p/cvml/source/checkout or browsed at

    http://code.google.com/p/cvml/source/browse/#svn/trunk (sorry but the

    Google code viewer mutilates indentation)

    This is a C++ project which I am compiling on both VC++ 2008 and GCC

    3.4 under Cygwin.

    CVML is an attempt at constructing an optimizing bytecode compiler for

    a high-level language. The bytecode is a single-stack, functional

    language based on Cat. The high-level language I use is called Heron,

    and resembles Scala or ECMAScript 4 (essentially Java with a Pascal

    twist). What the project does is convert from Heron into CVML (and

    Java for comparison purposes). It then applies multiple optimizations

    to the CVML bytecode, focusing primarily on reducing the size.

    The interesting observation about this kind of bytecode (which I guess

    could be called a concatenative bytecode according to the definitions

    we have discussed in the group earlier), is that we can inline code at

    call-sites (e.g. apply or call functions) without having to modify the

    code being inlined.

    Anyway the project is still under development: I am still missing lots

    of tests and the actualy virtual machine itself, but you can still

    play around with it, and might find the source code amusing.

    Christopher