More details on the README with usage instructions
A simple example of a *.c to *.eir and *.eir to *.bf or *.py might help
Reading the slides of the author tells me approximately this:
You should first make the folder. Assuming it succeeds, you get out/8cc the compiler, out/eli the interpreter and out/elc that does the conversion.
out/8cc -Ilibc -S prog.c -o prog.eir this compiles prog.c to prog.eir
out/eli prog.eir this runs the IR source
out/elc -bf prog.eir > prog.bf this compiles the IR to Brainfuck
I have not tested this suite, planning to now
I have just tested it, it is working as intended. The .eir output file from a simple printf("Hello, world!") is ~160KB, the converted .bf output is ~13 MB. Use a good interpreter. Do note that the make will fail if you only download the source as a .zip; you have to check it out through git
This shit is not documented at all. It even has outdated list of supported backends. But there's all options https://github.com/shinh/elvm/blob/a79315d63b09bce3b7384df36617c1f2f90d422b/target/elc.c#L68
I fell like calling it "shit" is a bit much. This repo is a work of genius. I agree the docs could be better, but really, a LISP in bf??? That is awesome!
Indeed it is extremely poor in terms of documentation: how to build and how to use...
I have just tested it, it is working as intended. The .eir output file from a simple
printf("Hello, world!")is ~160KB, the converted .bf output is ~13 MB. Use a good interpreter. Do note that themakewill fail if you only download the source as a .zip; you have to check it out throughgit
or download the zip and complement the links that are missing.