Compiler/virtual machine interpreter: Difference between revisions

Content added Content deleted
Line 6,962: Line 6,962:


In the hope of achieving good speed, this implementation takes advantage of Mercury's support for signed and unsigned fixed-width integer types.
In the hope of achieving good speed, this implementation takes advantage of Mercury's support for signed and unsigned fixed-width integer types.

The speed on mandel.vm seems better than that of my Common Lisp implementation on SBCL. (The Common Lisp implementation is not written for speed.) Neither of these programs is anywhere near as fast as my ATS implementation, which should be about as fast as a quality C implementation.

One huge advantage for Mercury over SBCL is program size. The compiled program for Mercury is 65080 bytes long, with links to shared libraries for Mercury and Boehm GC. With SBCL I get a dumped executable file 13738880 bytes long, and I believe that is after compression; also, it takes a bit of time to start up. My program compiled with ATS is 37264 bytes long and links only to the default C libraries.




Line 7,859: Line 7,863:


{{out}}
{{out}}
<pre>$ mmc -O6 --make vm && ./vm compiler-tests/count.vm
<pre>$ mmc -O6 -intermod-opt --make vm && ./vm compiler-tests/count.vm
Making Mercury/int3s/vm.int3
Making Mercury/int3s/vm.int3
Making Mercury/ints/vm.int
Making Mercury/ints/vm.int
Line 7,874: Line 7,878:
count is: 8
count is: 8
count is: 9</pre>
count is: 9</pre>




=={{header|Nim}}==
=={{header|Nim}}==