Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
Programming Operating Systems Apple

Developer Tries Resurrecting 47-Year-Old 'Apple Pascal' (and its p-System) in Rust (markbessey.blog) 39

Long-time Slashdot reader mbessey (a Mac/iOS developer) writes: As we're coming up on the 50th anniversary of the first release of UCSD Pascal, I thought it would be interesting to poke around in it a bit, and work on some tools to bring this "portable operating system" back to life on modern hardware, in a modern language (Rust).
Wikipedia describes UCSD Pascal as "a version that ran on a custom operating system that could be ported to different platforms. A key platform was the Apple II, where it saw widespread use as Apple Pascal. This led to Pascal becoming the primary high-level language used for development in the Apple Lisa, and later, the Macintosh. Parts of the original Macintosh operating system were hand-translated into Motorola 68000 assembly language from the Pascal source code."

mbessey is chronicling their new project in a series of blog posts which begins here: The p-System was not the first portable byte-code interpreter and compiler system — that idea goes very far back, at least to the origins of the Pascal language itself. But it was arguably one of the most-successful early versions of the idea and served as an inspiration for future portable software systems (including Java's bytecode, and Infocom's Z-machine).
And they've already gotten UCSD Pascal running in an emulator and built some tools (in Rust) to transfer files to disk images. Now they're working towards writing a p-machine emulator in Rust, which they can they port to "something other than the Mac. Ideally, something small â" like an Arduino or Raspberry Pi Pico."

Developer Tries Resurrecting 47-Year-Old 'Apple Pascal' (and its p-System) in Rust

Comments Filter:
  • I have a complete set of Inside Macintosh still lying around somewhere.

    • You probably wouldn't be able to give them away. The shipping cost to anyone likely to be interested - even a "Macintosh museum", if there were such a thing - would be prohibitive. I faced the same problem when I subscribed to Science (and Nature, in alternating years). I really didn't want the dead-tree editions which waited for me on the doorstep when I got home from work, to go to waste, but the only people collecting them to send to, say, third world libraries wanted delivery only at their base 500 mile
  • by ctilsie242 ( 4841247 ) on Saturday May 10, 2025 @06:42PM (#65367487)

    If the p-system can be ported to Rust, I wonder if games that use it, like the OG Wizardry series, can be ported as well.

  • awesome (Score:2, Funny)

    by Anonymous Coward
    They're using a non-portable language so their new interpreter can't even run on the original hardware. They should have just used fucking C as God intended. Except ... Mario Klebsch did this 25 years ago and the main interpreter file is only about 2500 lines of code. If this bozo had already built the interpreter that would be an ok-ish slow newsday Slashdot post but he hasn't even made the interpreter!
    • Re:awesome (Score:4, Insightful)

      by mbessey ( 304651 ) on Saturday May 10, 2025 @07:34PM (#65367575) Homepage Journal

      Why in the world would you want a new interpreter for the Apple II? The one that exists is fine. And yes - people *have* done this before, mostly rather a long time ago. Building another version of the same thing isn't a bad thing, especially if it comes along with better documentation of the internals, in a way that's accessible to a modern audience.

      Unsurprisingly, the 25-year-old project you refer to doesn't build on my system. And neither does the version Peter Miller updated way back in 2010. It's probably worth revisiting projects like this every decade or so.

      • Why in the world would you want a new interpreter for the Apple II? The one that exists is fine.

        Why in the world would Linus Torvalds want a new kernel to run GNU on a PC? The commercial UNIX kernels that existed were fine.

      • It is not for Apple II, it is a general purpose "reimplementation", at least that is what I understand.
        To adapt the byte code to modern CPUs you basically only need to switch to 32bit or bigger pointers, and think about branch and jump instructions.
        Having a base implementation in a modern language might be a good thing anyway.
        The p-Code implementations I saw so far were all either 6502 or Z80 ... not really the "most portable" format to get it quickly running on a Pi or something.

  • by Anonymous Coward

    Now they're working towards writing a p-machine emulator in Rust, which they can they port to "something other than the Mac. Ideally, something small Ã" like an Arduino or Raspberry Pi Pico.

    The whole Rust runtime can't even operate on AVR-based Arduinos, even before you start emulating p-Sysem with it, so one assumes they mean Arm-based Arduinos here. (Yes, I'm aware of projects like avr-rust/ruduino, but they are very small subsets of the Rust. As far as I know AVR remains firmly quagmired in Tier 3

    • by mbessey ( 304651 )

      Yeah, it would have to be an ARM-based Arduino, to use the Rust version. But there are several of those now, and they're not even necessarily more-expensive than the AVR versions.

    • by kertaamo ( 16100 )

      I don't know what does and does not run on a traditional 8 bit Arduino but Rust does not have a run time and it can generate code that runs on 8 bit Arduinos.

      Anyway, back in the day I had a "Tiny Pascal" that worked on a TRS-80 with 4K RAM so this should be doable on Arduino.

    • What do you mean "the whole rust runtime"?

      Not a rust programmer, but C++ runs more than just fine on the Arduino: Arduino is in C++.

      Rust as far as I can tell has a very very similar machine model to C++. It might not be well supported (and well Arduino tends to languish on a decade old version of C++), but I don't see any particular inherent barriers. You'd need an allocator if you want to allocate of course, and no one's ported lib unwind, so no unwinding panics for you, but other than that?

  • It seems like BASIC outlived Pascal. I haven't seen it in use in forever.
    • It seems like BASIC outlived Pascal. I haven't seen it in use in forever.

      "Delphi is a general-purpose programming language and a software product that uses the Delphi dialect of the Object Pascal programming language and provides an integrated development environment (IDE) for rapid application development of desktop, mobile, web, and console software,[3] currently developed and maintained by Embarcadero Technologies.
      Delphi's compilers generate native code for Microsoft Windows, macOS, iOS, Android and Linux (x64).[4][5][6]
      ...
      Delphi was originally developed by Borland as a ra

      • by wwphx ( 225607 )
        Borland will live with us in spirit always! I have/had a Turbo Pascal box set, but sadly lost the disks. LOVED their spreadsheet and word processor. I so wish they were still around, but we can't have everything.
    • There is lots of Pascal out there.
      Freepascal and Embercardo, the former Borland Pascal are around.
      There are a few more which I do not have on my mind.

  • As I was taking Pascal in HS at the time, I got Apple Pascal for my Apple IIGS back in the day. I could never figure out why it had to have its own OS, instead of just running under ProDOS OR Apple DOS. Why? I ended up bailing on it and just kept using Pascal on the Trash-80s the school had.

  • People don't appreciate the limitations of the hardware we were targeting back in the day. Every bit counted. Every clock tick was important. Every register choice was meaningful. Every memory access mattered.

    Now, get off my lawn.

  • This is the first really interesting post on /. in a long time. I've still got my copy of Bowle's "Beginners Guide for the UCSD Pascal System" which included a short appendix on how to get going on an Apple II (once you buy a Language Board add-on). I foresee learning some Rust in my future!
  • I think the Wizardry game used it?
    • I played (tried to play haha), an text adventure with simple graphics. My English was limited, and we had only the game (cough cough) and no manual.

      It was a team of several heroes ... like 4 or 5. But no idea how the game was called. It was in UCSD Pascal.

  • ...somewhere in my basement. Is it coming back too? Should I fish it out?

    #nostalgia_aint_what_it_used_to_be

  • Is it a inanimate language struggling to prove itself in the brainshare--or is it zealots, working to standardize a computer language as a meme?
  • by wwphx ( 225607 ) on Sunday May 11, 2025 @01:23PM (#65368799) Homepage
    I worked there back in the early '80s. Aside from publishing Tunnels and Trolls and the Nuclear War card game, we did play-by-mail computer-moderated games. Our main computer was a Raytheon with magnetic core memory and punched-tape I/O. Those were the days. It was pretty cool in that when the Arizona summer monsoons came in, we'd just flip the power switch and turn it off. Storm passes: turn it back on and resume production. If the machine got wonky, there was a certain cross-beam in the memory cage that you'd strategically place a 2x4 and whap the end of it with a hammer for a couple of minutes to randomize the memory, then reload the OS and you were back to work. I never got to see this happen.

    Fun times. But anyway....

    The head programmer, Steve MacGregor, was an absolute nut for Pascal. Anything that was an in-house game that didn't run on Theo, the Raytheon, he wrote in Pascal on CP/M boxes. And since it was all UCSD p-code, it was easy to port to new computers as they came in over the years, long after I was gone. While I was learning programming at the time, sadly I wasn't into Pascal just then and didn't appreciate it. I wish I had been, I could've learned a lot from Steve as he was quite the wizard.

    Even more sadly, Flying Buffalo is no more, Rick Loomis the founder passed away in 2019. The Tunnels and Trolls and other properties have been bought up and are still available on DriveThruRPG, and it appears the play-by-(e)mail games are still going, who knows how long that'll be up.
  • I used UDSD on an Apple II back in the day and I also had a Western Digital Pascal Microengine. Terrific back then. Today, with compilers like the FPC that can generate really native good code for almost anything, other than for someone who has too much time on their hands I can’t see the value in this.

"Free markets select for winning solutions." -- Eric S. Raymond

Working...