| [programming] | [all tags] [all pages] [home] |
Mercat is not really useful for anything much. It is, on the other hand, an excellent example of how to implement a self-hosted recursive-descent-parsed language and virtual machine. The code is --- I hope --- reasonably easy to understand, and I think the overall design is quite elegant.
README (5.6 kB)
The README file from the distribution, should you require more information.
Features include:
Supported platforms:
Here's some code, taken from one of the example programs, a full-screen editor.
function void MenuInitialise
array Menu menubar;
{
int i;
int j;
int x := 1;
int w;
string label;
for(i:=0; i<sizeof(menubar); i:=i+1)
{
menubar[i].x := x;
w := sizeof(menubar[i].label);
x := x + 2 + w;
for(j:=0; j<sizeof(menubar[i].item); j:=j+1)
{
label := menubar[i].item[j].label;
if (sizeof(label) > w)
w := sizeof(label);
}
menubar[i].width := w;
}
}
core_030.zip (102.9 kB)
The core Mercat code, version 0.3.0.
plus one of these, depending on your platform:
dos16030.zip (42.4 kB)
DOS 16-bit run-time binaries for version 0.3.0. Because this runs entirely in real mode, memory is extremely limited, but it will recompile the compiler.
dos32030.zip (46.3 kB)
DOS 32-bit run-time binaries for version 0.3.0.
linux030.zip (16.1 kB)
Linux-ELF-glibc run-time binaries for version 0.3.0.
If you don't have any of those platforms, or want to rebuild the run-time from source, then you'll want this:
posix030.zip (40.3 kB)
Posix run-time sources for version 0.3.0. Will build any version.
Example programs and documentation are provided in the core file.
If you are of a historical bent, you might be interested in the prior Mercat version, 0.2.1.
core_021.zip (67.0 kB)
dos16021.zip (34.7 kB)
dos32021.zip (39.5 kB)
linux021.zip (12.5 kB)
posix021.zip (35.2 kB)
| Page last updated: 2008 August 12 | © 2008-2009 David Given, unless specified otherwise |