Michal Wallace on Narrative Programming: Why Learn J when LLMs Code?
Michal Wallace (tangentstorm) loves pedagogy, producing many instructional videos, mostly for J and recently for Decker. For his dream programming course, he made a Forth-ish VM b4 and a REBOL-array-style implish. To as…
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
Michal Wallace (tangentstorm) loves pedagogy, producing many instructional videos, mostly for J and recently for Decker. For his dream programming course, he made a Forth-ish VM b4 and a REBOL-array-style implish. To assist with courses, he’s made tanco courseware around test-driven development and minavo, an “audio-video outliner” (a modern jprez.) Among many other things, he ran a webhost and worked as a professional K programmer, interviewed on the ArrayCast.
What inspired your programming pedagogy (on youtube etc.?) Though a K programmer, on a previous interview you said you’re not only focused on them. This is quite unique as exotic language enthusiasts tend to evangelize their particular paradigm.
I have a long-term vision of making a programming course where I start with b4 (my forth-like VM) (or even more conceptual things like what a bit is and how to think about them)… Then building up from b4 assembly to a little Lisp and/or forth, a Pascal-like language, and then implish. With a lot of graphics and games along the way.
I made a lot of J videos because I think J is neat and because very few other people could make them (simply because the community is so small) while lots of people can and do make Python or Rust videos. The new Decker series is pretty much for the same reasons, plus the extra fact that I wanted to teach my daughter something. (She’s already taking classes in Scratch and will start Python after that.)
I wish I didn’t have to use any particular language in a video and could just talk about ideas. I tend to imagine I’m making a video about math or programming and just happen to use J or Lil or (eventually) one of the languages on B4.
We have my daughter enrolled in various human-lead tutoring programs over the internet. (programming, math, punjabi, englcatish).. We did the scratch (and soon Python) classes because that’s what was on offer. I’m working one on one with her on Decker, but it’s slow going, because she can’t even type. (So one of the next videos will be a typing tutor I made.)
I started working with K at 1010data, but eventually it was bought by Symphony AI. We still use K every day, but most of what I do is in Python or javascript making little widgets to plug into our system or write demos for our API (which I maintain). We also have our own language with xml syntax.
JS has improved considerably. Before LLMs, I was often using a little library I made to abbreviate the routine JS routines in the DOM (browser APIs) (see example towards the bottom) although I don’t use this style at work.
The AI in “Symphony AI” predates LLMs. They were more focused on machine learning and data analytics before, but now I write tools for them in Python. Currently I’m working on an MCP server to expose the 1010 platform as a toolkit that the LLMs can use directly. He no longer works with 1010 data
How would you compare the different array languages you use? You worked with k, but mostly streamed j stuff. Do you find Lil lacks anything?
I miss forks and hooks when I use K, but I think overall I know most or all of K, because it’s very small. J has way more stuff, but I’ve constantly got the NuVoc (vocabulary website) open. (With K a 1-page printout covers it) I often find myself missing scan and insert in lil, but it winds up not being a big deal because explicit each loops are also very short. In Decker, I mostly miss talking to the outside world. (But the “danger zone” addresses that…) At the end of the day, I don’t really have strong preferences about implementation languages.
I don’t know why I don’t use K outside of work. Usually when I write code outside work, I’m either working on something that I want to eventually be a commercial product, or I’m thinking about how I could tell the story of the thing as a video. It stuck in my head that my channel was going to be a “J channel” and I should just stay on topic to build my brand and appease the youtube algorithm, but I guess I’m over that now.
It’s only been relatively recently that there’s been any stable K systems that aren’t toys. (I livestreamed the video game I made in oK, but I never went back and edited or posted the videos).
I’m curious what you think of architecting big systems with these different programing paradigms.
Honestly, I think at a certain size they’re all pretty much the same. Even with 1010 or a cutting edge system like an LLM, there’s a few small parts that are really interesting and it really matters how you build it… And then the rest of it is all just connecting to other systems or generating HTML or moving files around. Important but you could probably write the same thing in COBOL or any language.
Different languages are good for different things, and in my ideal world (at least for personal programming / exploration / thinking with code), I’d have a bunch of small mini-languages that all shared the same runtime, so you could use whichever one you wanted. (This is lot like the racket philosophy, but in a much smaller, “fits in one person’s head” kind of approach.)
I find that big Forth programs are very hard to debug. I made a minesweeper in retroforth, and it has a bug in the floodfill routine that I’ve never been able to track down after numerous attempts over the years. Keeping things very small and using structured programming style helps a lot, but ideally I would bootstrap my way out of it.
I learned Forth by studying the ngaro virtual machine for retroforth 10. Retroforth is actually a mix of Forth and Joy (somewhat like Factor). Like Joy, it has a lot of quotations and combinators… And I found it much harder to learn that stuff than to understand the simple instruction set in the assembly language. On the other hand, there are a lot of things about the retroforth style that are much more modern than “standard” forth. (Like quotations…) The B4 assembler is very much inspired by my time with retroforth. To me a Forth is a system where you have 2 stacks and a dictionary of words, and the words are all about manipulating things on the stacks (especially the main stack). B4 has a bytecode , so in theory there are 256 operations, but the first 128 act as a 32-entry dictionary. You have 32 registers, each named with a single character, and each has 4 opcodes:
^A : call the routine whose address is in register A @A : read register A onto the stack !A : write top value on stack into register A +A : add top value on stack to A, leaving old value of A in its place
Then there’s 32 opcodes that do arithmetic, stack manipulation (swap, dup), read and write arbitrary memory, jump, call/return… Very close to the same operations you find at the core of retroforth or John Earnest’s Mako or the GreenArrays chip. The other opcodes are mostly pluggable so other people can extend the system (I tend to make a single op for each host-language library I want to install.. Like there’s a terminal op that exposes terminal IO, etc…) Anyway, in the assembler, you have these core opcodes and there’s a few built-in macros for structured programming. (Like <condition> .i <then part> .e <else part> .t <back to normal code> is an “if/else/then” macro).
I find that I’m able to write lots of cool things directly in the assembler… But usually when I write that way, I’m writing test-first and structuring it as a lesson plan / programming challenge. Here is pre (a parsing and regex system)’s test suite, which uses retro-style quotations (delimited with the .[ and .] macros) to define and use higher-order parser combinators directly in the assembly language. I built a very tiny Lisp with it. The goal is to blaze a trail for a student to later follow.
(The pre thing is a PEG system, like Rebol and Janet. I ported the concepts almost exactly from Alessandro Warth and Ian Piumatra’s OMeta paper.)
Each test suite is meant to be read and studied interactively, as a series of challenges to guide a student through building their own version of the thing, or at least understanding the existing version, via one of my other projects (named tanco with a prototype “course” at https://learntris.org/ ) All of that was to build up to the point that I don’t really care so much about Forth or even B4a as a language, but you have to start a beginner off somewhere, and B4 is meant to be a small and simple system that you can make yourself in a day or two (or just download one of the existing implementations) and then build your own toolkit.
The plan I had was: establish the foundations with this tiny VM, then build a Pascal/oberon atop it (“retro Pascal”), using the Forth or Lisp (“b4th”/“b4s”) as scaffolding. And then eventually implish would be a high level blend of array languages and red/rebol/rye (which are nothing like racket but share that “make lots of dialects” philosophy)
I’m not great at any of these languages. I’ve used Red a bit. I like that they’re all homoiconic like Lisp, but the syntax is much more flexible. Rye is a red-inspired language made in Go that has good support for tables as a native data type. It’s run by one person and seems to be really well done. Fixes a lot of things I don’t like about red, like removing weird stateful side-effects.
Free Pascal with Lazarus is an amazing tool. I don’t understand why people sleep on it. And Wirth…
Pascal pretty much died with windows 3.1… Microsoft and Apple both had Pascal compilers, but Turbo Pascal blew them out of the water. When windows came, Turbo Pascal became Delphi, and (afaik) way more expensive. I just can’t justify paying for a language like that… And then Delphi got handed from company to company, while Microsoft focused on C++ and visual basic and I guess apple did their own thing. So I think Pascal in general just didn’t have any companies left standing to promote it. (Even Niklaus Wirth moved on to Modula and eventually Oberon.)
I started using free Pascal to revive my old Turbo Pascal code. I didn’t really have anything of value. It was just sentimental. Then eventually I started using Lazarus for some things here and there. I don’t do a lot of GUI programming outside of a web browser, but when I do, Lazarus is definitely in my toolbox.
https://www.projectoberon.net/ is a huge inspiration for my work. One reason I wanted to model retro Pascal after Oberon is that I wanted to “play nice” with his Compiler Construction text… I don’t 100% know what that means in practice. I also just like Oberon. I found the uppercase keywords physically painful to type but I really like the way Oberon code looks, even without syntax highlighting.
I love Oberon, Alan Kay’s STEPS, Plan9… For the next few years, I’m focused on a table first language (k inspired but table first) with Prolog or such on top in a few hundred lines, to build a kOS thing a la duskos
I really admire these small systems like dusk/collapseOS as well, and in some sense I see B4 as my approach to that. I’m not concerned that civilization is going to collapse, but I do expect things to constantly change. 20 years from now, we might all be using Zig or Rust or Janet or your new table language, and I’ll be able to run my tools on top of that.
I think table-based languages are great. I have dreamed for years about making a “microsoft access for the web”, where you combine a RAD tool for building GUIs with a real database. 1010’s app building system isn’t drag-and drop like access, but our app-building system is simila
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。