Web-based Turbo Pascal compiler
github.com
github.com
Turbo Pascal Compiler in JavaScript - https://news.ycombinator.com/item?id=26207624 - Feb 2021 (72 comments)
Turbo Pascal Compiler (2013) - https://news.ycombinator.com/item?id=13434318 - Jan 2017 (93 comments)
Web-Based Turbo Pascal compiler (2013) - https://news.ycombinator.com/item?id=8391364 - Sept 2014 (6 comments)
Show HN: My Turbo Pascal compiler in JavaScript - https://news.ycombinator.com/item?id=6572349 - Oct 2013 (81 comments)
The IDE shown here is, as I say, pretty much the Turbo Pascal 1.0 IDE...and it truly was an IDE. Being able to run your code with a keystroke or two—and then to see your next syntax error in the editor—it was mindblowing.
I used to have a 3.5" HD floppy with that classical editor shown here, with MS-DOS 3.3, and a couple of other utilities, to plug into the computers on the high school computer lab.
Given how powerful modern computers are, you could run the original TP in an emulated DOS virtual machine from the browser.
I get this is a hobby project though. Looks a fun thing to work on
+ https://github.com/jeffpar/pcjs
The Internet Archive even has a copy of TP7 that you can run in a browser: https://archive.org/details/tpuve
I do think that the Turbo Pascal style TUIs did hit a sweet spot between more complex GUI technology and simplicity. Oberon from Niklas Wirth (RIP) is another interesting one.
Arguably, why not. It’s specifically designed to execute Pascal. Why reinvent the wheel.
One of the most interesting p-code instructions is LOD. This get the value of a local variable. The trick is that it takes two arguments. One them is simply the offset to the variable. The other, however, is from which procedure environment.
Pascal supports nested procedures. And because of that, within each nested procedure, they have access to all of the local variables in scope. So in order to access a parent local variable, the engine has to walk the stack references to the parent scope.
This walk is a first class concept in the p-code. It’s not just simple primitives like CPU. Most are, but much of the meat are the very architecture specific operations.
Similarly, calling procedures work hand in hand with the segment concept built into the system. A segment is much like a library. A collection of procedures, with an offset table for routing.
Much of this segment concept was pretty much lifted wholesale by the original Mac OS, as well as the Apple II GS. It’s a strikingly powerful system lurking within a pretty simple OS.