// HACKER NEWS — CYBERSECURITY
Pop-2000, a lingua-franca POP-2 dialect
Devine (of Uxn fame) and I have been talking a lot about POP-2, a language from the 1970s originally used in the same circles as the first Lisp dialects.
Devine had been looking into writing a new assembler for Uxn in a high-level language to aid in bootstrapping a Uxn system, while I personally have always been interested in languages that would make for good "tiny compilers", and we came upon POP-2 as something that would make for a good lingua-franca between all of these tiny systems.
A bit of a crazy title, I know. Don't get me wrong, I love the concatenative programming paradigm- its way of forming new functions/constructs via juxtaposition and composition are really elegant. But something that I tried to make clear in the paper I wrote for ok is that I don't feel particularly drawn to concatenative languages for those features- rather, I like concatenative languages because they're ridiculously easy to write an interpreter/compiler for while (often, not always) allowing for some low-level control- at least, compared to the other languages that I like playing around with, like C or Odin.
Coming from someone who originally made conlangs (a LOT of conlangs) before they'd even begun to touch computer programming, I care more about the langdev-side of things than actually making software. Specifically, when I'd work on an idea for a programming language, I typically had the following goals in mind:
Concatenative languages, and languages targeting small/low-level stack-based VMs in general, just happen to map really well to these sorts of constraints. I don't like concatenative languages because I think concatenation as a paradigm is inherently better, but rather, I like them because concatenation makes the implementation problem of creating a programming language delightfully small. The benefits of this naturally stretch further into the classic arguments in favor of these types of systems (i.e. permacomputing and whatnot).
If you look at the goals for language design that I outlined earlier and compare them to the goals outlined in the original POP-2 Papers, they're basically identical:
Devine's POP-2 article lays out a good overview of a POP-2 dialect written to target Uxn, but to summarize, a minimal POP-2 implementation supports declaring multiple variables at once with vars x y z;, declaring functions with function myfunc a b; (followed by the function body and then an end), basic if/elseif/else control-flow, I/O with =>, as well as looping via labels and gotos. The neat thing about POP-2 is that values manipulate an underlying stack- from Devine's own article:
Could just as easily be written this way, since the arguments to sum just get pushed onto the stack, and the value returned by sum also just gets pushed to the stack- that, and encountering an operator like + just looks ahead at the next element in the expression, pushes that to the stack, and then pops that and the next element off of the stack to add them together:
With this inherently stack-based nature, adding just some basic memory management, support for different-width values for different systems, and a more universal I/O system would be all that's needed for a convenient, beginner-friendly language that could be made to run on tons of tiny systems- not as a replacement for those system's existing languages, but more as a social exercise by allowing newcomers to start off with a language that's both easy to learn and runs on tons of our small systems, while also being a language that's easy enough for us, the creators of these small systems, to implement a compiler for.
POP-2000, (or POP2K, we aren't completely set on a name yet) is a standardized dialect of POP-2 with the goal of adding the support for systems-level stuff that we'd like on our small systems, while also being very clearly defined (if you pour through the reference section of the POP-2 papers, the grammar is defined but it's very hard to get through).