A JavaScript-based Transputer emulator has been developed and is performant enough for practical use. It emulates a T425 Transputer, including its 32-bit processor, on-chip RAM, and link interfaces for connecting multiple virtual Transputers. The emulator aims for accuracy and speed, leveraging WebAssembly and other optimizations. While still under development, it can already run various programs, offering a readily accessible way to explore and experiment with this parallel computing architecture within a web browser. The project's website provides interactive demos and source code.
This Hacker News post introduces a newly developed emulator for the Transputer, a pioneering parallel processing architecture from the late 1980s, implemented entirely in JavaScript. The author emphasizes that the emulator's performance is sufficiently high to be practically useful, a notable achievement given the complexities of emulating a parallel architecture within a single-threaded environment like a web browser.
The emulator, showcased on a dedicated webpage, allows users to experience and experiment with Transputer code directly within their browsers. The post highlights the inclusion of several demonstration programs, including a Mandelbrot set fractal generator, illustrating the emulator's capability to handle computationally intensive tasks. The author provides background information on the Transputer architecture, emphasizing its innovative use of on-chip communication channels for inter-process communication, a feature central to its parallel processing capabilities. This core concept of channel communication is faithfully replicated within the JavaScript emulator.
The implementation utilizes a technique of compiling the Transputer's Occam programming language, specifically a subset targeting the IMS T800 model, into WebAssembly. This compilation process facilitates the emulator's speed and efficiency by leveraging the performance benefits of WebAssembly. The post details the process of generating the necessary WebAssembly code from Occam source code, including using a custom toolchain involving the Kent Retargetable Occam Compiler (KROC) and the LLVM compiler infrastructure. It also mentions the integration of a rudimentary filing system, crucial for loading programs and data into the emulated environment.
The author expresses enthusiasm for the potential of this project to revive interest in the Transputer architecture and its unique approach to parallel computing, making it accessible to a wider audience through the ubiquity of web browsers. They also invite exploration and feedback from the community, suggesting possibilities for future development and improvements. The provided demonstration programs, particularly the Mandelbrot example, serve as a tangible demonstration of the emulator's capabilities and a starting point for users to explore the world of Transputer programming.
Summary of Comments ( 2 )
https://news.ycombinator.com/item?id=43578190
Hacker News users discussed the surprising speed and cleverness of a JavaScript-based Transputer emulator. Several praised the author's ingenuity in optimizing the emulator, making it performant enough for practical uses like running old Transputer demos. Some commenters reminisced about their past experiences with Transputers, highlighting their unique architecture and the challenges of parallel programming. Others expressed interest in exploring the emulator further, with suggestions for potential applications like running old games or educational purposes. A few users discussed the technical aspects of the emulator, including the use of Web Workers and the limitations of JavaScript for emulating parallel architectures. The overall sentiment was positive, with many impressed by the project's technical achievement and nostalgic value.
The Hacker News post titled "Show HN: Transputer emulator in JavaScript (fast enough to be useful)" linking to a Transputer emulator written in JavaScript generated several comments discussing various aspects of the emulator and Transputers in general.
Several commenters expressed fascination with Transputers and their unique architecture, reminiscing about their past experiences with the technology. One commenter recalled using Transputers for parallel processing in university and praised their elegant design. Another highlighted the innovative nature of the Transputer's inter-process communication channels. The general sentiment was one of nostalgia and appreciation for the Transputer's historical significance in parallel computing.
Performance was a key topic of discussion. Some users questioned the "fast enough to be useful" claim in the title, prompting the original poster (OP) to clarify that the emulator achieves about 1/10th the speed of a real Transputer. While not as fast as native hardware, this speed was deemed sufficient for certain tasks, such as running old demos and exploring Transputer programming. The OP further explained that the emulator's performance is bottlenecked by JavaScript's garbage collection, particularly when dealing with the emulated memory operations.
The choice of JavaScript for the emulator was also discussed. While acknowledging the performance limitations, the OP explained that JavaScript's accessibility and ease of sharing through a web browser made it a suitable choice for this project. This allowed for wider reach and easier experimentation for those interested in Transputers without requiring complex setup or specialized hardware.
Several commenters expressed interest in the potential applications of the emulator, including educational purposes and preserving historical software. One user suggested exploring WebAssembly as a potential avenue for performance improvement. Others discussed the possibility of integrating the emulator with existing Transputer development tools.
There was also discussion about the differences between emulation and simulation. One commenter pointed out that the project is an emulator, mimicking the hardware, rather than a simulator, which would model the behavior at a higher level.
Finally, some commenters shared links to related projects and resources, including other Transputer emulators and archival material. This contributed to a broader discussion about retrocomputing and the preservation of older technologies.