July 4, 2020
The following are questions I submitted to Eric N. Swanson, Syzygy, the creator of POL. He recently returned to POL after a long absence. I asked him if I could query him about POL’s beginnings, architecture and about what he has been up to during his absence. - Yukiko
Yukiko: How did POL come to be? The copyright states 1993 as the starting year but that was before Ultima Online was born. So, unless God revealed to you that UO was going to be created in the near future, POL must have been the final product of something else.
What were your original intentions with the eScript language and the “virtual machine” that runs the compiled eScript code?
Syzygy: At the very start, for POL, I had two impulses:
- I thought it would be an environment where I could try to use the genetic programming stuff (though that never worked out). My plan (which never happened..probably impossible) was to have genetic-programming-controlled populations of rabbits and bears and stuff running around. It's sort of why I started the whole thing. It was a college project in the sense that I worked on it while I was in college.. Maybe I had one course that touched on the topic tangentially, but nothing more than that.
- I envisioned using it to sort of run something like an online D&D, where the DM could use scripting to set up events.
Really, neither of those worked out. I created escript in the spring of 1993, for use in a BBS project I was working on. I started POL around the beginning of 1998.
As far as the design of the emulator... I'm not sure what to say about this. The escript runtime used reference-counting, without locking, because it was less overhead and at the time multiple processors weren't really a thing in consumer hardware. So I thought this trade-off was ok: 1 thread (at a time) could execute scripts, then 1 thread per client could handle their i/o, decryption, etc. Today of course I would do basically everything differently.
Yukiko: I have always wondered why you didn’t use semantic versioning for POL? I always thought it was due to the old file naming scheme of 8.3, eight character names and three character extensions.
Looking back at
docs/archive/core-changes-old.txt, I see for example “11/18/1998 - POL007”.
It was definitely just an incrementing number with leading zeros so that it would be naively sortable.
Version 7, not version 0.07 or 0.0.7. Semantic versioning hadn’t been invented yet.
While it’s true that 8.3 filenames were still an issue at the time (there’s plenty of evidence of that in the source code filenames),
that wasn’t the reason for the versioning scheme. Primarily, I just wanted a simple version number that I could increment with
each release without having to worry about what “1.0” means.
Yukiko: What have you been up to during your absence from POL development?
Syzygy: Since 2003 I worked in the games industry for about 8 years for Sony Online Entertainment (SOE), on PlanetSide and EverQuest II, then for a startup making game. I left POL development in 2003 when I started working at SOE because it seemed like a conflict of interest. Most recently I've been working in JVM languages - Kotlin, Java, Scala.
Yukiko: I have been curious about a couple of things. I found eScript pretty easy to grasp. As I’ve mentioned before, I am familiar with Pascal and a lot of eScript’s syntax and keywords remind me of pascal, eScript’s use versus Pascal’s uses for example. Also, I mentioned that my son, at 15, had no programming experience and he learned to program in eScript in a few weeks, enough to write a UseScript that opened a gump where the user could choose a UO MIDI to play. Did you base the eScript syntax off of any existing languages at the time?
I love hearing about people learning how to program through POL
and eScript. I think a lot of it came from Pascal. I took some
elements from C and BASIC, too, like the for loops. Before landing on the
fully-bracketed syntax (
endprogram) the language had
blocks that began with “
begin” and ended with “
end”, like Pascal. And the
var” declaration seems like it must have come from Pascal, minus the type declaration of course.
Yukiko: Another thing that I found familiar in POL was the architecture of the virtual machine. You start with a high level language. It compiles to pseudo-code that is interpreted by the virtual machine. I don’t know if you are familiar with the UCSD Pascal system but that is exactly the way it operated. There might have been other similar systems at the time but I only knew of UCSD’s work. What made you choose the pseudo-code VM method? Were you familiar with a system similar to UCSD’s and was that your inspiration for the VM design?
Syzygy: I wasn’t aware of UCSD’s system. The VM mostly flowed from the way that the expression parser worked: converting an infix expression to a reverse polish notation, which was straightforward to evaluate with a stack-based VM. That approach came from a textbook by Andrew S. Tanenbaum, Structured Computer Organization (see page 366), which contained an adaptation of the Shunting-Yard Algorithm. From there, it seemed natural to add instructions to jump conditionally or unconditionally, and to build higher-level constructs (IF statements, WHILE statements, and so forth) upon those. I guess that textbook talked about jumps too, but it seems like I just did my own thing.
One major factor for using a this type of VM with POL had to do with the relatively high number of objects in the game world that would be controlled by scripts. There might be tens of thousands or hundreds of thousands of scripts active at once. At any given time, almost all of them would be sleeping, or waiting for an event, such as for a player to click on a target cursor. It wouldn’t have been feasible to have tens or hundreds of thousands of threads running to manage those scripts. Today, co-routines would afford better options.
Yukiko: I have a couple of final short questions and I think I’ll be done.
Yukiko: Is a SRC file a script or a program? I have always thought of eScript source files as programs but I wanted your perspective.
Syzygy: I refer to them exclusively as scripts, but in the context of a running POL server and since they are compiled to an intermediate representation rather than interpreted, it does seem reasonable to consider them to be programs.
Yukiko: You recently gave POL the elvis operator and have been working to clean-up the eCompile. Do you plan on working on POL development regularly as time permits? If so, what would you like to tackle next? I assume refactoring the compiler but is there something else that grabs your attention?
Syzygy: I don’t know about regularly. I am rewriting the compiler. I looked at a lot of the code that I wrote 20, 25 years and it’s just too embarrassing.
Okay, I have a whimsical question that came to mind as this “interview” draws to a close.
Do you know who came up with the parameter name '
who' and do you know why it was chosen?
Syzygy:Pretty sure that was me. It's in all of the control scripts, the "do something" scripts. "who is doing this?"
Yukiko: I use it all the time to represent the character. Mostly because it is short.
Syzygy: Well that's exactly what it's for
though you might just call that '
program click_item( who, what )
item', or even '
cauldron' or whatever but '
character' was too long and '
user' is ambiguous.
Yukiko: Finally, is there anything else that you want to cover or say that I did not ask you about?
Syzygy: No, but thanks for asking!
Yukiko: Thank you Eric for taking the time to answer my questions. I also want to express thanks from all of us who have derived much pleasure, and frustration (The latter mostly from running a shard and dealing with players.) from POL. I wish you success in your career and hope you’ll stick around and continue to work on POL after the “Great Compiler Redesign of 2020”.Back to history...