Рет қаралды 12,709
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
pwlconf