Concatenative programming and stack-based languages by Douglas Creager @StrangeLoopConf
Concatenative programming and stack-based languages by Douglas Creager  @StrangeLoopConf
Uploaded October 2023 | Updated September 2026, 3 weeks ago
In this talk we’ll explore stack-based programming languages, in which your program operates directly (and only!) on a stack of values. It might seem daunting at first to program without variable names, but the simplicity of stack-based languages makes them interesting to reason about mathematically, and also fun to tinker with! We’ll look at how stack-based languages are concatenative, letting you break apart your program into arbitrary pieces without affecting its meaning. We’ll compare them with combinatory logic, and see how small we can make our language while still being Turing-complete. And we’ll show how they make good low-level (but still readable!) assembly languages, by examining a Uxn program and running it on a variety of interesting hardware.

References:

* Henry Baker. “Linear logic and permutation stacks — The Forth shall be first”. SIGARCH Computer Architecture News 22:1, March 1994.
* Jeremy Gibbons. “Continuation-Passing Style, Defunctionalization, Accumulations, and Associativity”. The Art, Science, and Engineering of Programming, 2022.
* Brent Kirby. “The theory of concatenative combinators”.
* Slava Pestov, Daniel Ehrenberg, Joe Groff. “Factor: A Dynamic Stack-based Programming Language”. ACM SIGPLAN Notices 45:12. December 2010.
* Smullyan, Raymond. To Mock a Mockingbird. Alfred A. Knopf: New York, 1985.
* Manfred von Thun. “The mathematical foundations of Joy”.

Douglas Creager
Walland Heavy Research
@dcreager

I’ve been thinking about, and using, programming languages for a very long time. By day, I manage GitHub’s Semantic Code team, figuring out how to understand and analyze ~every programming language under the sun. By night, I balance family life with hacking on my own language, like any good PL enthusiast would!

----
Recorded on Sept 21, 2023 in the PWLConf track at Strange Loop 2023 in St. Louis, MO.
thestrangeloop.com
https://pwlconf
Concatenative programming and stack-based languages by Douglas CreagerExperimentation: putting research papers into prod by Leemay NasseryPython Performance Matters by Emery Berger (Strange Loop 2022)Ectype - bringing type safety (and more!) to vanilla JavaScript by Holly Wu (Strange Loop 2023)Outperforming Imperative with Pure Functional Languages by Richard FeldmanFormal semantics for multi-language programs by Amal AhmedSymbolic Numeric Programming in Julia by Shashi Gowda (Strange Loop 2022)The Vera C. Rubin Observatory Legacy Survey of Space and Time by Andrés Plazas MalagónWhy is a Monad Like a Writing Desk? by Carin Meier (2012)Exploring deep space and deep ocean with AI guidance by Daniel Van HoesenCat Hicks: Fostering a learning culture in coding teamsFelienne Hermans: How patterns in variable names can make code easier to read
Strange Loop Conference |

"Concatenative programming and stack-based languages" by Douglas Creager

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER