diff options
author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-01-04 00:28:53 +0200 |
---|---|---|
committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-01-04 00:28:53 +0200 |
commit | 39f497fe31d7a1a72a1e0565e88500eeb214508e (patch) | |
tree | 10ff7c2e452f9bc4666826336cb446590c9eadda | |
parent | b9b5e343accd95b476a8a80e0b713521c7eb6974 (diff) | |
download | ejit-calc-master.tar.gz ejit-calc-master.zip |
-rw-r--r-- | README.md | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..ecde1c1 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# JIT calculator challenge implemented with ejit + +This is an implementation of the +[JIT calculator challenge](https://ochagavia.nl/blog/the-jit-calculator-challenge/) +using my [ejit](https://metanimi.dy.fi/cgit/ejit/) library in C. Possibly not +quite what was intended with the challenge, but at least I had a nice evening. + +## Building + +This repository uses submodules, remember to run +``` +git submodule update --init --recursive +``` + +To build, run +``` +make +``` + +which should produce a `calc` binary. You can add compilation parameters like +``` +make RELEASE=1 LTO=1 +``` + +to build an optimized binary. Remember to `make clean` before you specify new +parameters. + +## `ejit` + +`ejit` is a library that implements a bytecode interpreter for a language +(almost) identical to the one used by the massively cool +[lightening](https://gitlab.com/wingo/lightening) JIT library. The idea is that +`ejit` transparently lowers all bytecode instructions to the equivalent +`lightening` instructions, which in turn are lowered to machine code when on a +supported machine. For machines not (yet) supported by `lightening`, the +bytecode interpeter means that programs written with `ejit` will still function +correctly, just a bit slower. |