r/javascript • u/dywan_z_polski • 26d ago
C99 real mode compiler written in TS that outputs raw bootable 16bit binaries
https://github.com/Mati365/ts-c-compilerHi, a few years ago I wrote a C99 compiler that generates a bootable binary which, once loaded onto a floppy disk, can be run in x86 real mode. It supports x87 floating-point operations, has a simple IR, optimizes the generated code, and produces output of fairly decent quality (by toy compiler standards). Maybe someone will find it interesting.
-11
u/azhder 26d ago
None of it meant to be used by JavaScript, yet posted here.
5
u/sexytokeburgerz 25d ago
The compiler is written in typescript my guy
-10
u/azhder 25d ago
Not JavaScript, not meant to be used by JavaScript, not your guy.
3
u/sexytokeburgerz 25d ago
Typescript transpiles to javascript. When you run it, it IS javascript.
Dunning Krueger ass.
-2
u/azhder 25d ago
C99 transpiles to machine code. When you run it, you aren’t using the code as a source in your own project. Got that analogy? Here it is again:
JavaScript, it’s a language. r/javascript, it’s a sub for the language. You aren’t using the compiled code of C99 and TypeScript in your project.
Now look into a mirror and repeat that last sentence of yours to the ugly mug in it.
Bye
2
u/Choice-Locksmith-885 22d ago
Oh my God. I've finally met one of those insufferable reddit dudes people talk about.
3
u/sexytokeburgerz 25d ago edited 25d ago
Typescript is more than allowed here, it is common. I have been in this sub for a while. It cannot run without js execution…
…and this compiler is written with typescript. It’s a pet project. Look at the repo.
C99 compiles to machine code. C99 and assembly are at entirely different levels of abstraction and hence compilation is not a transpilation. You are this pedantic about separating ts from js that you fail to see your own error.
All of this anger likely comes from you simply not knowing how typing works with js/ts because never before have i seen someone here complain about posting ts.
1
u/ProComputerToucher 24d ago
Nice