Find Related products on Amazon

Shop on Amazon

Show HN: Transputer emulator in JavaScript (fast enough to be useful)

Published on: 2025-05-14 08:59:44

Transputer emulator in Javascript This is a Javascript port of my transputer emulator written originally in C for my series of articles about the transputer processor. In the old times, Javascript was an interpreted language, but since many years ago it is implemented as a JIT (Just-In-Time) compiler, so it can approach speeds closer to the C language. Other implementation caveat here is that Javascript treats bitwise operators as generating 32-bit signed integers. This was avoided using the >>> 0 operator (logical right-shift) because it generates a 32-bit unsigned integer. You can try 0x80000000 >> 0 and see how it gives back a negative number, while 0x80000000 >>> 0 preserves the unsigned value. saves memory, as there are several of these arrays (including one of 40MB to hold the entire hard disk drive!). For the drive images, I tried using an initialized array but the source code used 20 megabytes for a binary of 3 megabytes. I figured a good trick to reduce the Javascript sourc ... Read full article.