Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

hobby C compiler

Name: Anonymous 2016-07-14 18:57

I wrote a (subset of) C compiler as a hobby: http://github.com/bl0ckeduser/new-bpf-tools - it targets x86

It can compile itself, if you are on x86 Linux with 32-bit C libraries installed you can do

$ ./4build.sh

and it will compile itself to 4 levels of depth

Then you can build some test programs like this one

$ ./wcc4 -w test/x86/e.c -o e.elf
$ ./e.elf

which will print the constant e to 1000 places

Name: Cudder !cXCudderUE 2016-07-15 3:40

- BPF is already taken as the acronym for the BSD packet filtering (and more) VM
- parser looks as expected although you could use Precedence Climbing to make it even shorter, simpler, and faster
- tokeniser could be simpler
- I suspect there are buffer overflows in the preprocessor
- GAS syntax is disgusting, why not write a simple assembler for it too, or just output binary...

But overall... http://i.imgur.com/21Ib7fh.jpg

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List