


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."
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."
Re: (Score:2, Troll)
His (Mark's) sex is known. Proper English dictates that "his" is appropriate while "their" is not.
Re: (Score:1)
I infer the argument is that Slashdot editors are too fucking stupid to know that Mark is a man's name. It tracks.
Memories of interpreted p-code (Score:2)
Yours [DrMrLordX's] comment was the first visible propagation of the AC's brain fart. I do not thank you. Your comment was as vacuous and irrelevant as its. Why did you bother? Maybe you hate thinking that much?
On the story, it certainly brings back old memories, so I'll describe my p-code project to the best of my memory. The boss passed away a few years ago, so I can't check with him.
The target machine was an Apple II where the p-code booted as a special OS. My memory is that it was more like a native OS
Re: (Score:1)
I really can't imagine why anyone would want to resurrect it now.
a) Games
b) there are plenty of "toy languages" on Github, that have AST interpreters and wait for a suitable byte code interpreter. A proven system that covers everything a high level language needs, could define a "new old standard".
If that Rust project gets far enough, I probably would port it to Dart.
Re: (Score:3)
The Oxford English Dictionary traces singular they back to 1375, where it appears in the medieval romance William and the Werewolf.
See https://www.oed.com/discover/a... [oed.com]
Re: (Score:2)
Why didn't you quote the next sentence?
Except for the old-style language of that poem, its use of singular they to refer to an unnamed person seems very modern.
Emphasis added where OED agreed with the AC.
Re: (Score:2)
How’s the Gulf Of Mexico doing? The pope also has a new pronoun.
Re: (Score:2)
What do you think the Pope's new pronoun is?
Re: (Score:1)
Agree. It's retarded. I generally stop reading something when I encounter political use of pronouns. Fuck all that.
If anyone needs it (Score:2)
I have a complete set of Inside Macintosh still lying around somewhere.
Re: (Score:2)
Wizardry series in Rust? (Score:3)
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.
Re:Wizardry series in Rust? (Score:5, Interesting)
Yes, with a caveat. Apple Pascal has some native 6502 routines as extensions to the standard UCSD Pascal. These will have to be translated, ideally to p-Code, and wired into something in the emulator. But I'd *like to* do that, once I have things up and running.
Re: (Score:1)
If you have those 6502 code, I can translate it ...
awesome (Score:2, Funny)
Re:awesome (Score:4, Insightful)
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.
Like when Linux reimplemented UNIX (Score:3)
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.
Re: (Score:1)
It is not for Apple II, it is a general purpose "reimplementation", at least that is what I understand. ... not really the "most portable" format to get it quickly running on a Pi or something.
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
One assumes they meant Armduino (Score:1)
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
Re: (Score:3)
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.
Re: (Score:2)
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.
Re: (Score:2)
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?
Is Pascal still a thing? (Score:2)
Delphi programming language (Score:3)
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
Re: (Score:2)
Re: (Score:1)
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.
Could never figure out.... (Score:1)
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.
/s needed for "..something small like an Arduino" (Score:2)
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.
Finally! (Score:2)
I remember using it, back in the mid-80s. (Score:1)
Re: (Score:1)
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.
I have Borland's Turbo Pascal... (Score:2)
#nostalgia_aint_what_it_used_to_be
Rust Zealots at Work, Again! (Score:2)
Flying Buffalo Games (Score:3)
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.
MehFPC is out there (Score:1)