Giter Club home page Giter Club logo

markjenkins / mes-m2-rewrite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oriansj/mes-m2

0.0 1.0 0.0 1.67 MB

Continuation of oriansj/mes-m2 rewrite project that was originally mes-m2 slow_lisp branch and became rewrite branch. Plan is to remove mescc code and strip down to more minimal scheme features. May be used to bootstrap https://github.com/markjenkins/lox_compiler_scheme

License: GNU General Public License v3.0

Shell 3.50% C++ 0.56% Scheme 55.38% C 40.14% Makefile 0.38% SWIG 0.03%

mes-m2-rewrite's Introduction

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 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:

$ 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.

mes-m2-rewrite's People

Contributors

oriansj avatar janneke avatar schierlm avatar fosslinux avatar snnw avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.