| 1 : |
anton
|
1.4
|
Vmgen supports the construction of interpretive systems by generating |
| 2 : |
|
|
the code for executing and dealing with virtual machine (VM) |
| 3 : |
|
|
instructions from simple descriptions of the VM instructions. |
| 4 : |
|
|
|
| 5 : |
|
|
This file is about Vmgen-specific issues. Issues affecting both |
| 6 : |
|
|
Gforth and Vmgen (e.g., platform compatibility) are discussed in |
| 7 : |
|
|
README. |
| 8 : |
|
|
|
| 9 : |
|
|
Vmgen generates code for executing VM instructions (with optional |
| 10 : |
|
|
tracing), for generating VM code, for disassembling VM code, and for |
| 11 : |
|
|
profiling VM instruction sequences. A VM instruction description |
| 12 : |
|
|
looks like this: |
| 13 : |
anton
|
1.1
|
|
| 14 : |
|
|
add ( i1 i2 -- i ) |
| 15 : |
|
|
i = i1+i2; |
| 16 : |
|
|
|
| 17 : |
|
|
Vmgen supports several techniques for writing efficient interpreters: |
| 18 : |
|
|
virtual machine interpreters, threaded code, combining VM instructions |
| 19 : |
|
|
into superinstructions, keeping the top-of-stack in a register, |
| 20 : |
|
|
scheduling the dispatch of the next VM instruction, and a couple of |
| 21 : |
|
|
minor optimizations. Interpreters created with vmgen usually are |
| 22 : |
|
|
faster than competing interpreters and are typically only a factor of |
| 23 : |
|
|
2-10 slower than the code generateed by native-code compilers. |
| 24 : |
|
|
|
| 25 : |
|
|
Vmgen has special support for stack-based VMs (but it can also be |
| 26 : |
|
|
used to advantage when implementing a register-based VM). |
| 27 : |
|
|
|
| 28 : |
anton
|
1.4
|
Changes in Vmgen from earlier releases are explained in NEWS.vmgen. |
| 29 : |
anton
|
1.1
|
|
| 30 : |
anton
|
1.4
|
After installation the documentation is available in info form and in |
| 31 : |
|
|
printable form (doc/vmgen.ps). |
| 32 : |
|
|
|
| 33 : |
|
|
There is a simple usage example in vmgen-ex (and a variation on that |
| 34 : |
|
|
in vmgen-ex2). See the documentation for more information on that. |
| 35 : |
|
|
|
| 36 : |
|
|
To report a bug, use |
| 37 : |
|
|
<https://savannah.gnu.org/bugs/?func=addbug&group_id=2672>. For |
| 38 : |
|
|
discussion on Vmgen (e.g., how to use it), use the |
| 39 : |
|
|
bug-vmgen@mail.freesoftware.fsf.org mailing list (use |
| 40 : |
|
|
<http://mail.gnu.org/mailman/listinfo/help-vmgen> to subscribe). |
| 41 : |
anton
|
1.1
|
|
| 42 : |
|
|
You can find vmgen at http://www.complang.tuwien.ac.at/anton/vmgen/. |
| 43 : |
|
|
|
| 44 : |
|
|
Vmgen is currently distributed with Gforth (because it needs Gforth to |
| 45 : |
|
|
run, and Gforth needs it to build), and is installed together with |
| 46 : |
anton
|
1.4
|
Gforth (read INSTALL for instructions). |
| 47 : |
anton
|
1.1
|
|
| 48 : |
anton
|
1.4
|
Note that future versions of vmgen may require small changes in |
| 49 : |
|
|
programs written for the present version (e.g., requiring a few |
| 50 : |
anton
|
1.1
|
additional macro definitions). |