Escaping Function-Based Programming
2025-01-04
Use a version of XXX (Lua, Rust, Python, etc.) that runs on bare hardware, not on an operating system.
Forth did that. Lisp 1.5 did that. Smalltalk ran on top of micro-code and used an O/S to handle file systems, display management, networking.
The original idea of an operating system, was to provide a few common routines (file systems management, display management, networking, etc.). This concept has grown into a bloated monster. Instead of bolting the common routines together via asynchronous message passing, as if the libraries were implemented on isolated pieces of hardware, we bolted them together with synchronous function calls. This has resulted in a huge, strongly-connected blob of software that causes scaling headaches and extreme fragility.
Function-based programming is a diversion supported by the existence of context-switching.
Context-switching, itself, is inefficient and needs extra software and hardware (MMUs, etc.) and is based on 1950s concerns about time-sharing needed to amortize the co$t of CPUs. Time-sharing, actually, does not provide multi-tasking. It just time-shares a CPU so quickly that humans can’t see what’s really going on.
Synchronous programming languages make it more difficult than necessary to express asynchronous behaviour. Hence, we get a continuous string of gotchas, like callback hell, .then, etc.
Function-based programming is a powerful paradigm, but becomes a burdensome crutch when over-used.
Compile to bare-hardware state machines and 0D[1].
Compile to bare-hardware Statecharts[2].
Compile to CPU-less 1972 Pong[3]. The original Pong didn’t use a CPU. The design was massively parallel. In spite of that, the designer managed to design Pong and didn’t need to use a synchronous programming language.
Modern versions of Pong, say written in Lua[4], are just as complicated as the original schematic. They’re just different. We’ve moved side-ways, not upwards.
The Production Engineering Piece is Missing
Too much emphasis on how to optimize the development experience based on 1950s primitive ideas about IDEs (aka “programming languages”), instead of optimizing away bloatware.
[from https://programmingsimplicity.substack.com/p/the-future-of-programming-244?r=1egdky]
See Also
References: https://guitarvydas.github.io/2024/01/06/References.html
Blog: guitarvydas.github.io
Videos: https://www.youtube.com/@programmingsimplicity2980
Discord: https://discord.gg/65YZUh6Jpq
Leanpub: [WIP] https://leanpub.com/u/paul-tarvydas
Gumroad: tarvydas.gumroad.com
Twitter: @paul_tarvydas
Bibliography
[1] 0D from https://github.com/guitarvydas/0D
[2] Statecharts from https://guitarvydas.github.io/2023/11/27/Statecharts-Papers-We-Love-Video.html
[3] The original Pong video game had no code and was built using hardware circuitry. Here's the original schematics from Atari from https://www.reddit.com/r/EngineeringPorn/comments/ul49zt/the_original_pong_video_game_had_no_code_and_was/
[4] CS50 Pong in Lua from


