Demo of my C compiler

Programming, for all ages and all languages.
Post Reply
codesynth
Posts: 5
Joined: Mon Jul 20, 2026 1:15 pm
Contact:

Demo of my C compiler

Post by codesynth »

It's been a long time since I posted ENV-ROD. But I feel x86 assembly is not too sufficient. It takes a long time to write assembly code. It took nearly a year to make and understand a C compiler. But things got easy with tokens and abstract syntax trees. The compiler is not fully ready, it does not support all of C89 standard features.

But here are things I implemented:
* "void", "char", "short", and "int" data types
* arrays
* pointers
* strings
* "/* */" comments
* "for" loops
* "if", "else", and "else if" conditions
* structures
* "return" statement (can be used with value)

The latest release is 0.4.1, which can be downloaded in my website:
http://hellowww.org/env/ec-0.4.1-linux64.tar.gz

Above archive contains example C code and 64-bit binary of compiler. You need NASM and DOSBox to test it.

Note: I never used AI in my life. Please do not say "it is AI assisted".
JProMi63
Posts: 2
Joined: Sat Jun 06, 2026 10:11 am

Re: Demo of my C compiler

Post by JProMi63 »

In what was this compiler written? Does it have a github repo?
nullplan
Member
Member
Posts: 2043
Joined: Wed Aug 30, 2017 8:24 am

Re: Demo of my C compiler

Post by nullplan »

I know that I will sure as hell not download an executable file from the internet and run it. Luckily, as my distribution is Void Linux, I can't actually execute the file, since Void is a musl distro and your executable requires glibc.

So I'm going to ask what my predecessor asked a bit more forcefully: Source or I'm not running it!
Carpe diem!
codesynth
Posts: 5
Joined: Mon Jul 20, 2026 1:15 pm
Contact:

Re: Demo of my C compiler

Post by codesynth »

JProMi63 wrote: Mon Sep 21, 2026 7:00 am In what was this compiler written? Does it have a github repo?
nullplan wrote: Mon Sep 21, 2026 12:38 pm I know that I will sure as hell not download an executable file from the internet and run it. Luckily, as my distribution is Void Linux, I can't actually execute the file, since Void is a musl distro and your executable requires glibc.

So I'm going to ask what my predecessor asked a bit more forcefully: Source or I'm not running it!
Sorry for not including the source code. I'm planning to create a repository. Here is the example working:
Image Image
Post Reply