C Compiler written in TeX
TeX
Latest commit 801232b Nov 19, 2016 @hak7a3 Update README
Permalink
Failed to load latest commit information.
sample Add files Nov 5, 2016
8cc.tex
LICENSE
README.md
elc.tex Add files Nov 5, 2016

README.md

8cc.tex

This is a TeX source of 8cc built on ELVM. In other words, this is a complete C compiler written in TeX.

This was very influenced by 8cc.vim.

Usage

printf \\000 | cat sample/hello.c - | od -A n -t d1 -w1 -v | tex 8cc.tex # compile C code to ELVM IR.
echo 0 | cat 8cc.tex.elvm.out - | tex elc.tex
cat elc.tex.elvm.out | xargs printf "%03o\n" | xargs -I_ printf \\_ > hello.tex # compile ELVM IR to TeX source.
tex hello.tex # execute
cat hello.tex.elvm.out | xargs printf "%03o\n" | xargs -I_ printf \\_ # show stdout