logo

Tiny C Compiler

Posted by guerrilla |4 hours ago |53 comments

fjfaase 2 hours ago[1 more]

The code of TCC (0.9.26) is kind hard to compile, I have discovered in the past year, while developing a minimal C compiler to compile the TCC sources [1]. For that reason, I have concluded that TCC is its own test set. It uses the constant 0x80000000, which is an edge case for if you want to print it as a signed integer only using 32-bit operators. There is a switch statement with an post-increment operator in the switch expression. There are also switch statements with fall throughs and with goto statements in the cases. It uses the ## operator where the result is the name of a macro. Just to name a few.

[1] https://github.com/FransFaase/MES-replacement

veltas 2 hours ago[1 more]

The unofficial repo continuing tcc has geoblocked the UK.

https://repo.or.cz/tinycc.git

gnufx 3 hours ago[1 more]

haunter 3 hours ago[3 more]

There is an actively maintained fork with RISC-V support and such

https://repo.or.cz/w/tinycc.git

https://github.com/TinyCC/tinycc

kristianp 3 hours ago[2 more]

Does anyone use libtcc for a scripting language backend? Smaller and faster than llvm. You'd have to transpile to a C ast I imagine.

pixelsort an hour ago[1 more]

Currently striving towards my own TypeScript to native x86_64 physical compiler quine bootstrapped off of TCC and QuickJS. Bytecode and AST are there!

asdefghyk 2 hours ago

I recall, there where similar items back in late 70s and early 80s .

Tiny C, Small C are names I seem to recall, buts its very fuzzy - Not sure if they were compilers, may have been interpreters....

RobotToaster 22 minutes ago

What advantage does this have over SDCC?

imwally an hour ago[3 more]

Anyone know a good resource for getting started writing a compiler? I'm not trying to write a new LLVM, but being a "software engineer" writing web-based APIs for a living is leaving me wanting more.

senfiaj an hour ago

There is even smaller C compiler that fits within the 512 bytes https://xorvoid.com/sectorc.html

throwatdem12311 3 hours ago[3 more]

This was the compiler I was required to use for my courses in university. GCC was forbidden. The professor just really liked tcc for some reason.

pbohun 3 hours ago[1 more]

There also is an unofficial mirror which has updates.

https://github.com/TinyCC/tinycc

rustyhancock 4 hours ago[4 more]

What a blast from the past TCC!

Sad but not surprised to see it's no longer maintained (8 years ago!).

Even in the era of terabyte NVMe drives my eyes water when I install MSVC (and that's usually just for the linker!)

olivia-banks 3 hours ago

TCC is fantastic! I use it a lot to do fast native-code generation for language projects, and it works really really well.

kimixa 3 hours ago[5 more]

Man I can't wait for tcc to be reposted for the 4th time this week with the license scrubbed and the comment of "The Latest AI just zero-shotted an entire C compiler in 5 minutes!"

markus_zhang 3 hours ago

I mixed it up with LCC which was used in Quake 3. Still this is pretty cool.

deivid 3 hours ago[1 more]

TCC is fantastic! Very hackable, easy to compile to WASM for some interesting in-browser compilation

MarginalGainz 2 hours ago

Comment deleted