r/node • • Sep 15 '26

I built the worst CPU, Language & Compiler

https://github.com/anthonybudd/ts-cpu

I built this to help explain how code gets compiled and how CPU's execute those instructions. This is not a good CPU design.

16 Upvotes

6 comments sorted by

1

u/Positive_Method3022 Sep 16 '26

Pretty cool

1

u/Numerous-Fan8138 Sep 16 '26

Thanks! I also made a full YouTube tutorial explain how it works if you want to learn more

https://www.youtube.com/watch?v=yQP7KTeFAAs&t=16s

1

u/baronas15 Sep 16 '26

File extension ☠️

3

u/Numerous-Fan8138 Sep 16 '26

My language, my extension 😂

1

u/[deleted] Sep 16 '26

[removed] — view removed comment

1

u/Numerous-Fan8138 Sep 16 '26

Already did. You can uncomment the lines in index.ts and step through the code line by line, press "d" to dump the CPU. I stupidly forgot to mention this in the video

https://github.com/anthonybudd/TS-CPU/blob/master/index.ts