Skip to content

hak7a3/8cc.tex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

C Compiler written in TeX

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages