4 ms·
Web-based Turbo Pascal compiler
- speed_spread 3y ago[flagged]
- pjmlp 3y agoI keep having this prevert thought of writing a UCSD P-Code to WebAssembly converter, making Pascal cool again, riding the WASM hype wave.
- andsoitis 3y agoYou probably already know, but FPC (the Free Pascal Compiler) supports two WASM compilation targets: WASI and embedded - https://wiki.freepascal.org/WebAssembly https://wiki.freepascal.org/WebAssembly RemObjects' Elements compiler (which supports Object Pascal, C#, Java, Go, and Swift) can also output WASM - https://docs.elementscompiler.com/Platforms/WebAssembly/ https://docs.elementscompiler.com/Platforms/WebAssembly/
- hnlmorg 3y ago> This is a web-based Pascal compiler that runs a subset of Turbo Pascal 5.5 code. 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
- nerpderp82 3y agohttps://github.com/copy/v86 https://github.com/copy/v86
- hnlmorg 3y agoThat's just one of many. eg + https://github.com/jeffpar/pcjs https://github.com/jeffpar/pcjs + https://js-dos.com/ https://js-dos.com/ The Internet Archive even has a copy of TP7 that you can run in a browser: https://archive.org/details/tpuve https://archive.org/details/tpuve
- rnd0 3y agoYou have a variety of languages (including different versions of Turbo Pascal) to choose from over at pcjs.org ...right in your browser!
- pjmlp 3y agoTP 5.5 was my introduction to OOP, sweet memories.
- zamalek 3y agoTP (and Delphi) was such a great language. A lot of the benefits of a compiled language without all the complexity (accidental complexity for 80% of projects) that C++ pulls in.
- pjmlp 3y agoIndeed, although we should also thank Apple for Object Pascal, whose extensions were the basis for TP 5.5.
- dang 3y agoRelated: Turbo Pascal Compiler in JavaScript - https://news.ycombinator.com/item?id=26207624 https://news.ycombinator.com/item?id=26207624 - Feb 2021 (72 comments) Turbo Pascal Compiler (2013) - https://news.ycombinator.com/item?id=13434318 https://news.ycombinator.com/item?id=13434318 - Jan 2017 (93 comments) Web-Based Turbo Pascal compiler (2013) - https://news.ycombinator.com/item?id=8391364 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 https://news.ycombinator.com/item?id=6572349 - Oct 2013 (81 comments)
- wduquette 3y agoI'm rather bemused by this, as it's targeting a subset of Turbo Pascal 5.5 while emulating the Turbo Pascal 1.0 UI. I used Turbo Pascal 1.0 on CP/M-80, and Turbo Pascal 1.0 through 4.0 (or thereabouts) on DOS (and UCSD Pascal on three different systems before that), and it's fascinating looking back at it how the notion of the "IDE" developed an expanded over that time. 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.
- coldcode 3y agoI bought a copy of Turbo Pascal 1.0 for DOS at the West Coast Computer Faire, where Borland had a little booth. Still is the most productive IDE I have ever used; that sucker was insanely fast. Of course, programming is a lot more complex today, but in 1984, that was magic.
- wduquette 3y agoI got my first copy about that time. I'd just recently gotten a KayPro 4 (a CP/M-80 computer), and had been playing with Basic and couple of other languages that came with it; and then I saw an ad for Turbo Pascal in Profiles, the KayPro magazine. I'd used UCSD Pascal a lot at that time, and the screen shot looked—well, not the same, but reminiscent. The cost was $49.95 (IIRC) for a real Pascal compiler, at a time when compilers were usually hundreds of dollars. I ordered a copy immediately (that is, in the next five minutes), and when it showed up in my mail box it felt like Christmas.
- pjmlp 3y agoYes, it only changed on Turbo Pascal 5, Turbo Pascal 6 brought the Turbo Vision revamp, Turbo Pascal for Windows 1.5 the IDE experience into Windows 3.x, and it finalizing with Turbo Pascal 7 bringing some editor improvements to Turbo Vision based IDE. 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.
- deleted 3y ago
- runlaszlorun 3y agoI'll confess that I do have a sweet spot for Pascal. And I was hoping to see some of that sweet TUI action a la v5.5. Now that gives me a reason to add that to my pet project list. 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.
- hnlmorg 3y agoPascal was also created by Wirth. Albeit I don’t believe he worked directly on Object Pascal nor Turbo Pascal.
- whartung 3y agoIt interesting that they compile into the UCSD P-Code. 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.
- CRConrad 3y agoSo "LOD" = "Line of Descent", or some such?
- ngcc_hk 3y agoI think turbo bridge need 3.3 sadly.