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

Pages: 1-

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: Anonymous 2016-07-14 21:52

Interesting. I'll look closer at it this evening.

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

Name: Anonymous 2016-07-15 4:34

>>3
kill yourself, don't post with name/trip

Name: Anonymous 2016-07-15 5:57

>>4
/polecat kebabs/

Name: Anonymous 2016-07-15 6:05

>>5
Kill yourself as well, and fuck your memes.

Name: Anonymous 2016-07-15 9:01

>>6
/polecat keredditabs/

Name: Anonymous 2016-07-15 13:27

>>3

OP here thanks Cudder

Name: Anonymous 2016-07-15 16:38

>>3
Cudder. Review scc next.

http://git.suckless.org/scc

Name: Anonymous 2016-07-15 18:28

>>3
Intel syntax is worse than the Holocaust.

Name: Anonymous 2016-07-15 19:05

Holocaust these dubs

Name: Anonymous 2016-07-15 19:07

holocaust my anus

Name: Anonymous 2016-07-16 13:50

>>10
At least Intel syntax is a real thing that happened.

Name: Cudder !cXCudderUE 2016-07-16 14:51

>>9
Too many directories with almost nothing in them, and almost no comments in a ton of files? No thanks.

And... WTF?
http://git.suckless.org/scc/tree/cc1/stallman.msg

Name: Anonymous 2016-07-16 15:15

I wrote a toy C compiler and a few standard functions in Scheme. It did enough to compile my fizzbuzz and rec_fibs examples.

Name: Anonymous 2016-07-16 17:37

>>13
implying implications

Name: Anonymous 2016-07-20 17:54

Name: Anonymous 2016-07-20 17:56

Name: Anonymous 2016-07-20 18:02

It's a hexadecimal message that when converted to ascii prints this:

* g o a t s e x * g o a t s e x * g o a t s e x *
g g
o / \ \ / \ o
a| | \ | | a
t| `. | | : t
s` | | \| | s
e \ | / / \\\ --__ \\ : e
x \ \/ _--~~ ~--__| \ | x
* \ \_-~ ~-_\ | *
g \_ \ _.--------.______\| | g
o \ \______// _ ___ _ (_(__> \ | o
a \ . C ___) ______ (_(____> | / a
t /\ | C ____)/ \ (_____> |_/ t
s / /\| C_____) | (___> / \ s
e | ( _C_____)\______/ // _/ / \ e
x | \ |__ \\_________// (__/ | x
* | \ \____) `---- --' | *
g | \_ ___\ /_ _/ | g
o | / | | \ | o
a | | / \ \ | a
t | / / | | \ |t
s | / / \__/\___/ | |s
e | / | | | |e
x | | | | | |x
* g o a t s e x * g o a t s e x * g o a t s e x *


I think you get it as a warning message if you try to include pragma?

http://git.suckless.org/scc/tree/cc1/cpp.c#n562

Name: Cudder !cXCudderUE 2016-07-21 11:21

>>17-19
How lame.

Name: Anonymous 2016-07-21 22:48

>>22
How dubs

Name: Anonymous 2016-07-21 23:26

Honor thy dubs

Name: Anonymous 2016-07-22 0:01

Shut up, Cuckder

Name: Anonymous 2016-07-22 3:50

>>23
e/g/in cuck meme, /g/ro!

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