https://github.com/ocamlpro/jit_ocaml
A JIT in OCaml for Scilab (part of the Richelieu FUI project)
https://github.com/ocamlpro/jit_ocaml
Last synced: about 1 year ago
JSON representation
A JIT in OCaml for Scilab (part of the Richelieu FUI project)
- Host: GitHub
- URL: https://github.com/ocamlpro/jit_ocaml
- Owner: OCamlPro
- License: other
- Created: 2012-12-10T21:07:56.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-12-17T12:46:21.000Z (over 13 years ago)
- Last Synced: 2023-03-11T18:18:48.157Z (over 3 years ago)
- Language: OCaml
- Size: 332 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# jit_ocaml
A JIT in OCaml for Scilab (part of the Richelieu FUI project)
## Current Status
For now (Dec 15, 2012):
What has been implemented:
- Translation from C++ AST to OCaml AST
- Translation from OCaml AST to C++ AST
- OCaml AST Printer
What has to be implemented:
- Direct Scilab Parser to OCaml AST
- Partial type inference on OCaml AST
- Pattern matching of classical Scilab errors on OCaml AST
- Pretty-printer of Scilab AST
- JIT Compiler
## How to build
- Checkout a new version of Scilab from your favorite GIT mirror
- Checkout this repository in the modules/ sub-directory of scilab
- This directory contains a patch file scilab-GITCOMMITHASH.diff, that
should be applied on this particular GITCOMMITHASH version
- In scilab, use "git checkout GITCOMMITHASH" to go to this particular
version
- Apply the patch "patch -p1 < modules/jit_ocaml/scilab-GITCOMMITHASH.diff
- Now, build and install:
./configure --enable-maintainer-mode --prefix MY_SCILAB_PREFIX
make
make install
- You might need some env variables to run:
PATH=MY_SCILAB_PREFIX/bin:$PATH
LD_LIBRARY_PATH=MY_SCILAB_PREFIX/lib/scilab:$LD_LIBRARY_PATH
LD_RUN_PATH=MY_SCILAB_PREFIX/lib/scilab:$LD_RUN_PATH
export PATH
export LD_LIBRARY_PATH
export LD_RUN_PATH
- Now, you can test it:
scilab
or
scilab-cli
## How to modify
This plugin is composed of two parts:
- A dynamic library, containing the C++ code that serialize C++ ASTs
to strings, and back
- Some static code, included in the 'scilab' and 'scilab-cli' binaries
This static code contains:
- the OCaml runtime (libasmrun.a)
- some C stubs to initialize the OCaml runtime, and register a function
to perform the analysis on the serialized AST
- The OCaml code that does the analysis