Prompts for Programmer: A Memoir
The human-side prompts that developed and steered the draft, in conversation order. Assistant responses, button replies, and interface metadata are omitted. Unlike the other prompts pages, this one is lightly edited at the author’s request: a few personal details and remarks about other people are left out, marked […], and a handful of prompts are omitted whole.
The seed, 6 November
In a future essay for the blog, we will compare Rust and OCaml, and wonder what the best possible general-purpose programming language is, intrinsically speaking.
You can brainstorm questions for me about the direction the outline would take.
Compile times are in; what’s out is what’s social whim conditioned.
Is Koka where OCaml might be headed? Zig and Swift are out, not to my liking. I’d add Lean 4 and Bend2 to the comparison. Haskell could be a foil if you agree, or you can argue for it against me.
Yes, as the foil
Turning it personal, 15 November
Let’s continue exploring, for a bit, the future essay idea around the best programming language. I want to shift this essay idea to be even more personal. Look back at which programming languages I learned, used, and maybe why I haven’t learned some languages. For example, I haven’t learned Rust and Swift. I used basic Pascal, C++, Lisp, OCaml, Haskell, TypeScript, Python; of which OCaml and C++ the most. On top of that, I learned LOGO, Prolog (did a buggy C++ implementation of Object Prolog at the end of highschool).
“basic Pascal” -> “BASIC (Amos), Pascal” (sorry speech rec fail)
Ah I also learned Java, and taught a course on it (so only used it to implement the course ideas). Is the Java course on my GitHub, probably no?
No, I learned Object Pascal quite early on, since my cousins were using it, and I started using it as soon as I moved from Amiga to a DOS/Windows PC.
I haven’t used LOGO, I learned it in the abstract – I was very software-starved on the Amiga, I lived in the country side before the age of the internet propagated to there.
C++ came from my choosing, in highschool we had HyperCard on Macs (rather unusually).
I also learned Motorolla assembly on the Amiga, but I failed to make meaningful use of it; was above my un-mentored age-capped skill ceiling. Later I learned and used assembly for the ST-Microelectronics microcontrollers, for my dad’s electric safety cricuit monitor and breaker.
The implementation (of Object Prolog) is how I got one.
Languages, one by one
Speagram originated with Lukasz Kaiser, I joined the project and was driving (ideas and code) a major rewrite. I learned Coq and played with it (I wouldn’t say “used”). Notably, never learned Scala. I used Haskell first to implement exercises for a course I was a teaching assistant (only the lab, no impact on the lecturing from me), and some 3-4 years later I used it at my internship at Google (the whole work I did was in Haskell).
I found out ML from scavenging libraries at the university, via interactive theorem provers. I picked OCaml in favor of SML because of the richer type system (objects and polymorphic variants). Soon after we had a functional programming course in OCaml, the course was doing OCaml and SML on alternate years. I attended a few classes in the prior year covering SML.
I implemented a short text adventure game in DOS shell (BAT files).
I bounced off Rust but I haven’t had any significant incentive to try harder. I was very disappointed that Swift doesn’t have full-fledged pattern matching, I was originally led to believe it’s functional programming adjacent.
Q8: I think a memoir is more of the direction for the essay, but I’d like to cover Lean 4 and Bend too. I first learned and used Emacs Lisp (e.g. I implemented an overhaul of a pmwiki Emacs mode), but I also used Lisp for Macsima, and learned / explored the ACT-R implementation.
I also learned a bit of Lua, and learned and used Matlab for TA’ing a neural networks course.
I don’t know anything about Koka, Claude brought it up. I’m open either way. For Lua I could have played with Luasteer.
At the internship, we used kind polymorphism over algebraic data types.
I also learned and used Octave, as alternative to Matlab for the NNs course and later for a PGM online course (Stanford).
The old files
You can check today’s downloads at ~/Downloads/ – I fetched some old resources from my Dropbox.
Speagram was always on OCaml, I implemented a new, more efficient formalism.
I think I convinced Lukasz Kaiser to use OCaml, in particular he liked Meta OCaml that I pointed out to him.
Mine was the second rewrite of Speagram, first was by MRW that LK hired for a summer.
I didn’t learn Nemerle. I didn’t see the point, being a Linux user and OCaml programmer.
Any other questions for me?
Laziness was a pain because it caused hard to fix bugs in an FFI I needed to write, and also a couple times easier infinite loop bugs.
I learned C++ quite extensively because I was interested in object-oriented programming starting from my exposure via Borland Pascal, and Bjarne Stroustrup’s writing is good.
This reminds me that I also learned a bit of one of the early object-oriented programming languages, maybe Smalltalk. I don’t remember the resources, but at least from Bjarne Stroustrup and maybe from somewhere else.
Yes, probably Simula.
I wrote some HyperTalk for my highschool lab. Polymorphic variants learned their place in my code somewhat. I don’t count the code that agents write as languages I use. I used Python exclusively and somewhat extensively in my last year and a half at Google (where we got moved to Google Brain and worked on RL infra). My relation to Lean and Bend is via following progress on X/Twitter. In 2021, I was following the early work on using LLMs for automated theorem proving in proof assistants.
“which theorem prover led you to ML” – probably NuPRL
Q9: yes, MRW is Michal Ryszard Wojcik; Haskell file is the surviving tiny bit of internship code; my dad’s breaker was a product, and my dad filed for a patent, unfortunately got refused for a poor reason (some prior art registered in India). I haven’t asked my dad, but it’s super far in the past by now, he and my mom hand-manufactured the product for a couple years.
Yes, the same Michał Wójcik.
Any chance you could dig into the Speagram history on SourceForge?
What does remain unanswered?
I forgot that I learned and used R for a data mining course where I was a teaching assistant and owned the laboratory. There’s three more archives (also unpacked) in ~/Downloads/ now, should include the Java slides.
I downloaded four more archives (and also unpacked them). One of them is for the data mining course.
Object Prolog was my own idea and design.
HOL work was for a course, so I was only filling in the assignment part.
Evolutionary Algorithms was for a laboratory I owned of a course I was Teaching Assistant for.
Answers to the open questions
Q1: I guess Rust’s syntax felt bloated? Not sure. Q2: I believe objects are a valid design part of OCaml, but I never used them. (Except maybe briefly via Pottier’s visitor pattern.) Maybe one thing I miss is type-aware metaprogramming for DSLs. At some point I thought I miss modular explicits that have now arrived, but I was overcomplicating the design. Q3: the Resource acquisition is initialization (RAII) idiom. E.g. I implemented and interesting LRU cache mechanism for efficiency with safety guarantees. Q4: Lean 4 because of autoformalization and other agentic use; Bend because the author is active, overlapping uses of agentic programming, cool ideas with connections to what I studied (e.g. Girard’s linear logic). Q5: Even at the very beginning of 2025 agents were very proficient in OCaml, more than they thought. I think both agents and humans benefit from strictness and exhaustiveness checks. I’m very curious about formalization that goes beyond this level of guarantees, but not necessarily convinced. Q6: Amiga. I’m sad to have lost my resources, both the Amos code and the graphics I created for my games. Q7: no, let’s make it a memoir essay. Q8: leave out Koka. Q8: we can tell plenty, we keep Kaiser’s relation to Nemerle […]. Q10: a system I designed from scratch built around hierarchical fact stores. The bugs were about recursive unification of the same relations and about memory unsafety crashes. Q11: MRW’s design was a CFG parser with unification, my design was using failure shortcuts via maintaining the lattice solutions (a bit Datalog-style now that I think of it). Q12: I made the MetaOCaml case before Lukasz Kaiser decided to switch away from Nemerle. Q13: before my Amiga, I programmed in Commodore 64 Basic with a neighbor on his Commodore. […] The move to PC was maybe second year of highschool, +/- a year? (We were still Amiga fans in highschool.) Q16: I’m open to suggestions which things should end up on GitHub and whether as separate repos.
[…] Google internship was summer 2014. I started at Google October 2015, right after my PhD defense. […] Master’s took +1 year, PhD took maybe 9 years? Split 1/3 on my PhD thesis, prep for my teaching, and colab with Lukasz Kaiser on Speagram and Toss. I owned the full course design, lecturing and laboratory for the Java, OCaml and Pascal courses. OCaml and Java was in English with only a handful 3-4 foreign students each. Pascal was a real, big hall course, couple dozen students IIRC. (Was an emergency as the intended lecturer was on […] leave IIRC.)
I might have written all of the Coq material? What’s in it?
Yes, I gave that seminar talk on a students-plus-faculty offsite in Polish southwest mountains.
The Amiga
In AMOS, notable games I remember are: (1) A top-view two-person “spaceship shooter”. (2) A top-view single person game with a pong paddle that also shoots at enemy spaceships, with the spaceships behaviors scripted in AMAL. Multiple levels with programmatically composed backgrounds (but manual maps). (3) A pseudo-3D open world adventure game scaffolding, with plains, forests and creatures, but I didn’t get to actual gameplay (so only wandering around available).
(Pseudo-3D means first-person, with manually derived formulas for scaling and paralax, and slideshow-style steps rather than animated.)
Write the memoir outline in notes/research, thanks!
One more resource, ~/Downloads/ox4d/ is a 4D noughts-and-crosses, I originally implemented in AMOS with a plainer GUI, then reimplemented in OCaml with the 4th dimension folded into a piechart. At the beginning of the university (before OCaml), I implemented a 4D Rubik’s cube, with an animation of folding and unfolding between 4D space projection and 3D layout.
The Rubik’s cube was in C++ with wired 3D animated graphics, nothing survives.
I also wrote a coupe demos in AMOS, with some very basic 3D elements, I think even an image rendered on a floating square? (But it wasn’t “general 3D routines” like the Rubik’s cube.) Other things I implemented in AMOS: a simulation of a 1D universe (plus time) with particle interactions; Conway’s Life seeded from pictures; a line editor; playing with Amiga’s voice synthesis library. One of the first things I implemented on the PC in Pascal was a text GUI (now would be called a TUI) jointly for a few toy programs.
Is it worth mentioning more? Somewhere around early university I think I implemented a program for my mum for book-keeping style work at a (large) bakery she worked for briefly. And around early 2015 I implemented this fork https://github.com/lukstafi/subte
I don’t remember if the bakery program was in Pascal or in C++
More remembered
Q2 Object Prolog: classes held the clauses. Other things: pmwiki-mode work is from 2007, I couldn’t find the repo since what SourceForge versions is up to 2005, but the 2007 work is here: https://sourceforge.net/projects/pmwiki-mode/files/pmwiki-mode/
I remembered something: I fixed a bug in Emacs’ built in calculator rendering for matrices (2D rendering), and a bug in its algorithm for computing something (I don’t remember what). With the latter only because it turned out to be the same algorithm as in an old Soviet book I borrowed from the technical university’s library. This was early university, right after I switched from Windows to Linux, possibly before OCaml. The FSF mailed me some stickers and a form for passing over ownership. I mailed the form back but I or the post messed up and it didn’t arrive, so they couldn’t merge my changes.
“Right after” is not correct, since I needed to learn Emacs first, and I’m not sure if I started using Emacs right after switching. I remember implementing my own editor in TclTk first. Wow, I forgot about that.
I don’t remember the barest thing about Tcl. Now I remember that I also learned PHP, not surprising since I was using pmwiki.
Lisp is bigger than the systems behind it, I also read up on it, no later than early university, from some possibly academic book about it.
Yes LOGO was first, but from the accessible Brainstorms book.
Yes, Papert’s Mindstorms, in Polish.
It came out at the beginning of 1996, I would be likely to have it sometime 1996.
Maxima was during my undergrad (second half but not last year). ACT-R was sometime later but not long after. Haskell lab was 2008 (is it 3rd year of my PhD studies?), it’s now downloaded under ~/Downloads/progTWI/
I spent a lot of time with Toss on various aspects, with two papers I think that I was equal contribution coauthor both for implementation and I’d say for concepts. Does it belong in the essay?
What notable books about Lisp do you know? Not ones that would be considered of popular appeal, otoh do include early ones. Maybe I manage to remember.
I’m leaning it was “Anatomy of Lisp”. Was it translated to Polish?
My first encounter with computers was when I was maybe 5 to 7 years old, at a family visit somewhere, the 8-bit computer was rendering ellipses in the envelope of a circle. Then my contact was via my cousins, three brothers, one of them an academic (an electricity PhD). They had an Amstrad first, then PCs (XT and AT).
Q4: I’d say can be technical with details shown. Q5: timeline sounds nice. Q6: ambivalent, I have poor autobiographic memory. ox4d_v2.ml is dated March 2003, and ox4d.ml dated May 2007, the “autosave” dated January 2005 – have this from Dropbox.
[…] The money for the first computer I earned myself was as a dancer from a dance tour.
Not a teenager. I started dancing when I was 22 years old, with contemporary. Year later I started ballet. This was maybe three years after that, I was woefully unprepared.
I started physical activity two years before dance, with ~9 months of Kung-Fu (Long Fist and White Crane styles), and ~2 years of Aikido (one year overlap with dancing).
Publishing the old code
commit the outline and the Speagram files. Then let’s reconsider the GitHub repos, for a final decision before we create them.
Yes, not publishing the Java slides, they’re low value. Is there code for a Settlers-style simulation in the Java dirs?
Yes the Java simulation is mine, written for or along the course.
subte work was for a small town/municipality near where
I grew up. The data entry and static page generation were used; […] The
titles aren’t convincing, I would prefer a bland “Programmer: A Memoir”
but open to other suggestions.
[…] for the upcoming prompts file, let’s keep it lightly edited for overly personal info.
My dad agreed to publish the BZU programming. Let’s copyright it with me and him as co-authors (Piotr Stafiniak).
No licence means it’s free to read but not free to use?
Let’s add MIT licences to luasteer and ocamlode, leave the rest unlicenced.
I don’t remember the background behind luasteer, is there no trace of it on the internet? (I don’t remember why I would learn Lua and bind there. But I was sympathetic to Lua, unlike Python at the time.)
Ah wow, I forgot or maybe even wasn’t aware of the response?
The draft
Would you like to draft the essay?
Revisions
The ST6 assembly interval on the figure is too narrow
Let’s make it start in October, to make it more salient.
Ah because it’s to scale. Never mind then, it’s ok.
“a text-mode interface shared by a few toy programs” -> “a text-mode windowed interface shared by a few toy programs”
“Another course had us prove theorems about unification in HOL Light” – that was much later, but maybe the junction is fine.
“Polymorphic variants have earned their place in my code, somewhat.” remove “somewhat”
“Around the same time I wrote a program for my mother” I have no idea when that was. If it was anywhere about so late, maybe it would be in OCaml, so maybe it was earlier.
Let’s remove “I see now that it worked a little as a Datalog engine does.” I also downloaded two more folders, ~/Downloads/Toss/ with some documentation, and ~/Downloads/hmg_arith/ worked on at the beginning of my PhD, what later became InvarGenT.
The dates are latest modification dates. I pitched the idea of the project already when I applied for the PhD, and I stuck to it till the eventual success.
FTR, I see the modification dates in Dropbox, oldest is pa_lettry.ml from November 2006, next oldest is q_hmg.ml from August 2007
I would guess the 2006 date is when I created the directory, so it would also confirm when I started the PhD. I was busy with other things including studying myself during the first years.
Bringing Speagram into Toss was Łukasz Kaiser’s idea. Speagram nevertheless remained its own thing, not integrated the way Lukasz intended. Toss, as the hypergraph hybrid logic, is separate from its Speagram subdirectory, which inherits directly from the original project.
“The neural networks lab was in Matlab, and the files are signed 2005” That’s very strong evidence I started the PhD in 2005.
Yes, I was already a doctoral student then, part of the obligation.
“and a shell script that ran each submission against tests with a time limit” – I’m not sure if I wrote it or inherited it.
“Under good I put the parameter modes …” and also nested function definitions.
“I would have chosen none of them for my own work.” This sounds too strong, even though it’s close to a fact. For example, I chose R for the data mining course, although the lecturer was using Java (the Weka toolkit).
Maybe “The languages I encountered”?
What do you think of the essay? Worthwhile or navel gazing? Ready for the final editorial pass.
I TA’d the Linux lab and prepared the exercises fully myself. Not sure if it fits in the essay, though. I take back the finality, I have a few more ideas. One is around how my times were the golden age for learning programming. One faced the computer, in the 8-bit era, responding with a programming prompt. And a language like AMOS was very kid-friendly. The second is to maybe add more color on my early OCaml community history. The third is to bring up the reaction of the OCaml community to LLMs. The general community is between skeptical and hostile, while the companies like my sponsor Ahrefs and especially JaneStreet are embracing them.
Q1: the direct mode (nowadays called REPL but with graphics integrated), commands for sprites and sound. Q2: no prompt on Amiga so a bit more challenging, and the distributed Basic was not kids friendly, so it took some time until I discovered AMOS.
I think Rudi Grinberg was fond of my GADT related work, and more recently (a couple years ago) he noted my activity around Dune.
The current LLM discussion links:
https://discuss.ocaml.org/t/is-ocaml-org-slop-now/18568 (negative) https://discuss.ocaml.org/t/ocaml-compiler-implemented-in-c-its-not-just-faster-it-also-increases-trust/18576 (more positive) https://discuss.ocaml.org/t/rejecting-ai-generated-code/18360 (rather negative) https://discuss.ocaml.org/t/opam-repository-package-contributors-should-have-a-human-behind-them/18466 (neutral)
The JaneStreet source: https://signalsandthreads.com/the-changing-craft-of-programming/ includes transcript of the podcast.
“I work on the companies’ side of that line, and I read the forum.” is awkward, maybe better simply remove this sentence.
Needs changing to “Since a few months, agents write all of the code on my projects.” (And I hesitate to say “my”, as I’m glad to share ownership with the agents.)
My last major piece of manually designed and partially manually written code was the implementation of concatenation in OCANNL. It was maybe December 2025? OTOH, before December 2024 all code was written by me IIRC.
Then this settles that before late December 2024, I wrote all code and did all debugging myself. Somewhere there, January 2025 maybe, I installed Cursor. Are there traces of this?
Not on this machine though, on macbook-pro
Ah we’re lucky, indeed I had a mini-PC and a not in the fleet before these dates. (The mini-PC I could still dust off from a drawer, but no need.) Dynarray is the first autonomous agent code, for the month before that I used tab completion.
Should we be pedantic ocaml-metal is a good clue. It’s fully written by agents, but with at the time careful crafting of the context by me.
Worth another editorial pass? Let’s add an index entry, commit and push. Thank you!
One thing occurred to me: what I miss from the old days is working out code design details in my head, for example when I would join my girlfriend for hikes.
Maybe also “Now, my hard thinking happens interactively and iteratively with agents.” […]