No Description

Jeremiah Orians 78ae3c569a Putting the hack back in for now 4 years ago
functions 2b4262f538 Mescc compilability: fix escape sequences 4 years ago
include 99842b1210 Incorporate janneke's mes library 4 years ago
lib 00dc151b55 Converted mes-m2 from array to struct based addressing 5 years ago
mes d69d36169c Work around one more quasiquote bug 4 years ago
module 62e2ebcef9 Implement setenv in Scheme 4 years ago
scaffold 83eba13500 scaffold: Add exit-42.c. 4 years ago
scripts 953d4106fb Import minimal (./configure hardcoded) mescc (needs Nyacc). 6 years ago
test 1cc6aceea1 Removed failing tests 4 years ago
.dir-locals.el 77cb2d53f3 .dir-locals.el: set k&r (?) style. 6 years ago
.gitignore 4afe8eeebe Imported mescc tests 5 years ago
LICENSE 55b619475c Initial commit 6 years ago
README.md 2650b6434a README update 4 years ago
gcc_req.h c81d2320e3 Mescc compilability: Make function pointers work 4 years ago
kaem.run 7f5bfe5dbc Provide escape for broken macro expansion 4 years ago
makefile 480e6c4ffc Add support for nested macro expansions 4 years ago
mes.c 7f5bfe5dbc Provide escape for broken macro expansion 4 years ago
mes.h 0d3eb68f8a Make fuzzing less dangerous 4 years ago
mes_builtins.c 0d3eb68f8a Make fuzzing less dangerous 4 years ago
mes_cell.c 78ae3c569a Putting the hack back in for now 4 years ago
mes_eval.c fed23483f5 Clearing out more segfaults 4 years ago
mes_init.c ed0365f402 Make mes-m2 append behave more like guile's 4 years ago
mes_keyword.c 608c699485 Added initial support for keywords 5 years ago
mes_list.c ed0365f402 Make mes-m2 append behave more like guile's 4 years ago
mes_macro.c fed23483f5 Clearing out more segfaults 4 years ago
mes_posix.c 0d3eb68f8a Make fuzzing less dangerous 4 years ago
mes_print.c b43d9f5694 Imported all of the Ur-Scheme tests 5 years ago
mes_read.c 3b8f00ff8f Fix nested set! bug and matching one found in quasiquote and fix #\; #\( and #\) 5 years ago
mes_record.c fa1011d76a Added support for nul in strings 5 years ago
mes_string.c ed0365f402 Make mes-m2 append behave more like guile's 4 years ago
mes_tokenize.c ed0365f402 Make mes-m2 append behave more like guile's 4 years ago
mes_vector.c 2d0cf3871c Make mes-m2 tail-call form 5 years ago

README.md

mes-m2

Making Mes.c M2-Planet friendly

Goal

The goal of this project is to create a re-implementation of GNU Mes, which can be compiled by M2-Planet and extends the feature set of GNU mes to provide a replacement guile to be used for the bootstrap.

The goal of this project is not to provide a minimally-adapted GNU Mes which can be compiled by M2-Planet and is able to compile the real GNU Mes (and thereby run mescc). If you are interested in this project, have a look at the wip-m2 branch in Savannah's GNU Mes repository. That branch is work in progress and can get rebased without further notice.

Status

At the moment, the project is quite far away from its goal.

It is possible to load a minimal Scheme environment and REPL by running

$ make
$ bin/m2
````

Which can be used to test the Scheme implementation (you will most likely run into bugs when doing so).

Tests can be run by `make test` and the M2-Planet build can be tested via `kaem --verbose --strict`.
Note that this only works when you are on amd64 architecture, and mescc-tools are in your `$PATH`.
If you are e.g. on x86, you can use the scripts from the [mescc-tools-seed](../mescc-tools-seed) repo to build mes-m2 with M2-Planet.

MesCC from the original GNU Mes project is also able to compile mes-m2.

The "original" Mes scheme environment is available if you set `MES_PREFIX=mes`:

```ShellSession
$ MES_DEBUG=100 MES_PREFIX=mes bin/m2

It is able to load modules, and will auto-load many modules (which you see loading when MES_DEBUG is set), but will eventually end with either a segfault or an undefined symbol. (Currently it ends with an undefined symbol).

Note that the macro implementation and quasiquote expansion is known to be buggy, so an undefined symbol does not necessarily mean an error in the Scheme code. If you take a look at the file and the code looks just fine, probably check if you can create a minimal example that uses the same constructs and also shows the same behaviour. (Replacing quasiquotes by their "expanded form" may also help pinpoint the issue).

For really low-level debugging you can export MES_CORE=0 to interact with C primitive version only (and if you don't build with M2-Planet, you can debug with gdb/cgdb).

Once you got the full MES REPL working, you can try running mescc like this

$ MES_PREFIX=mes bin/mes-m2 -s scripts/mescc.scm -- -I include -S scaffold/exit-42.c -o foo.S

You can also compare the execution with guile's:

$guile --no-auto-compile -L module -e main scripts/mescc.scm -I include -S scaffold/exit-42.c -o foo.S

to compile using the MesCC and nyacc included here.