← All stories
● Covered by 1 source · 1 reportLow impact1 neutral

POP-2 Language Features ALGOL-like Syntax with Concatenative Evaluation

🔄 Updated 3h ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • POP-2 uses ALGOL-like syntax with infix assignments.
  • The language features an explicit operand stack for evaluation.
  • A POP-2 compiler for Uxn is under 800 lines and 2.5kb.
  • Functions return multiple values by leaving them on the stack.

Syntax and Evaluation

POP-2 integrates an ALGOL-like syntax for its structure, including infix notation for assignments. However, its evaluation mechanism is deeply concatenative, relying on an explicit operand stack. For example, an assignment like `123 -> foo;` can be broken down into two statements: `123;` which pushes a value onto the stack, and `-> foo;` which consumes it.

Interpreter Efficiency

The language's design allows for a highly efficient interpreter. A compiler for POP-2 targeting Uxn is notably small, consisting of less than 800 lines of code and occupying only 2.5kb of memory. This demonstrates the language's elegance and compact nature.

Core Language Constructs

POP-2 statements begin with keywords, followed by expressions, and are terminated by a semicolon, resembling Pascal. Evaluation progresses by placing values onto the stack as needed. Functions, declared in an ALGOL fashion, handle recursion by leaving arguments on the stack. Control flow includes `if/then/elseif/else/close` statements, where each case pushes a value onto the stack rather than returning a value or performing an assignment. Loops are implemented using simple `GOTO` statements, as there are no built-in iterators.

Variable and I/O Handling

Variables are allocated using a `vars` statement and can be of varying lengths; in a 16-bit system, a variable defaults to two 8-bit cells. Comments are block-style, spanning text until a terminating semicolon. For I/O, the language, when implemented on the Varvara host system, can utilize multiple output destinations, such as outputting ASCII characters to console port numbers.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →

The daily brief

One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.

One email a day. Unsubscribe in one click, any time.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~7 min · 6 stories · Aug 30

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Reporting from

The POP-2 programming language combines ALGOL-like syntax with a concatenative evaluation scheme, utilizing an explicit operand stack. Its interpreter is compact, compiling to under 800 lines of code and fitting within 2.5kb of memory for Uxn. This design allows for a small, elegant language that processes operations via a stack machine.