A comic-book print: a dog in goggles flies a red biplane under a banner, Fly your own airline!, and below, a dog chef serves dog biscuits under a banner, Eat your own dogfood!

The first post in this series ended on a split: when I want to build something, I reach for Rust, and when I want to demo a concept, I reach for an interactive language: APL, Lisp or Forth, or one of my array languages. This post is about the array language, X_eTaL, which I have been building in Rust since September. It has become what I use for nearly everything I want to understand and show: machine learning, the deep learning papers I implement, graphics, games, and even hardware.

Why an array language, and why my own

I learned APL on a 2741 decades ago, and thinking in arrays has shaped how I program ever since, even in languages that don’t have arrays. X_eTaL’s README asks the question in one sentence: what would APL look like if it were designed today for composition, readability, tooling, and machine learning? It is typed in plain ASCII on an ordinary keyboard and drawn as notation, it infers static types, and it borrows on purpose from APL, BQN and J, Haskell and Rust (Array Languages #1 has the details).

I started X_eTaL because I wanted a simpler language than my earlier attempt, sw-MLPL, which has machine-learning features baked into the language (Machine Learning #9 shows one). In X_eTaL they live in libraries and extensions instead. I envisioned a Rust-inspired macro facility, tooling, and library ecosystem applied to an APL-inspired language, with Haskell-inspired static typing and a functional-programming orientation that other array languages generally lack.

I already preferred Rust over Python, but Rust is a much larger language than X_eTaL. I think I have demonstrated that X_eTaL is small yet powerful.

The model is the program

Most of what a machine-learning framework hides behind layers and modules is array algebra. A dense layer is an inner product and an addition. Softmax is an exponential, a sum and a division. Attention is two matrix products and a softmax. In X_eTaL each of those is a short expression over whole arrays, so the program is the model, and nothing sits between you and it:

ᵘs̲oftmax ← { v →
  e ← e̲xp v − 'm̲ax r̲/ v
  e ÷ '+ r̲/ e
}
ᵘs̲oftmax 1.0 2.0 3.0           ⍝ 0.0900 0.2447 0.6652
W ← 2 3 r̲eshape 1.0 0.0 1.0 0.0 1.0 1.0
x ← 1.0 2.0
ᵘs̲oftmax x '+ '× i̲nner W       ⍝ 0.0900 0.2447 0.6652

That is why I use it for learning and teaching machine learning. X_eTaL-ML’s demos show a model’s weights and every intermediate array with its shape, in the browser. X_eTaL-fine-tuning’s lessons hold to the rule that every number on a page comes from the X_eTaL program it shows. And when I implement a deep learning paper, as in finding circuits in GPT-2 Small or the four papers now in progress, the method is written in X_eTaL first, where I can read it, before anything is made fast.

One program, many machines

A Sipeed Tang FPGA board drawn as a glowing blue wireframe, its header pins along the top edge What’s an FPGA? A field-programmable gate array is a chip of logic blocks, memory and wiring whose connections are set by loading a configuration file, called a bitstream, rather than fixed at the factory. Load a different bitstream and the same chip becomes a different circuit: an adder tree, a small processor, or a calculator. It sits between software, which runs one instruction after another, and a custom chip, which cannot be changed.

An array operation already says what can happen in parallel, so the same X_eTaL program can be run in very different ways:

  • At the command line, by X_eTaL’s own evaluator, written in Rust.
  • In the browser, compiled to WebAssembly, which is how the live X_eTaL demos linked from this blog run, with no server.
  • On a GPU, through X_eTaL-gpu’s OpenCL path, or through Mojo on Metal and CUDA. The ray tracer runs the same source on the CPU and the GPU.
  • As a circuit, in X_eTaL-fpga, where c ← a + b on eight numbers becomes eight adders, and a 4-bit calculator machine runs on a Tang Nano FPGA board.

The point is not speed but the concept: one typed program, realized as time, as threads or as space, with the same answer.

Graphics and games are arrays too

A first-person view down a narrow street of half-timbered houses toward a castle tower, in a browser page titled Evolving Game: The castle
Evolving Game, castle-siege games written in X_eTaL: walking the streets to the keep. Click to enlarge.

A screen is an array of pixels, a scene is arrays of positions, sizes and colors, and many game rules are a single array operation. X_eTaL-games is built that way: each game illustrates an array idea and happens to be playable, from a vector moved by one expression to an entity-component system as one matrix. A voxel world finds the faces worth drawing by rotating a chunk of blocks six ways and comparing. X_eTaL drives Blender by working out a scene as arrays, and it draws the slides of the video series that teaches it.

Dogfooding

a terrier beside a red bowl heaped with dog foodOne reason I use X_eTaL is dogfooding. By implementing papers in it, I discover bugs and missing features, and I can analyze how best to support more use cases. One example: the Sage bird, a combinator for recursion, needed lazy arguments to stop, so X_eTaL gained laziness, only where asked for. Small puzzles exercise it too: the latest demo, Advent of Code 2026, solves the first two days, each part one expression over the whole input, after a set of published TinyAPL solutions.

Not every use case warrants adding a feature to the base language, like a new data type. When possible, I prefer to add to a library, a macro, or a dynamic library (usually in Rust, but not limited to that). Array Languages #16 calls these changes page faults: a program reaches for something missing, and the fix usually lands outside the core. Coding agents in the various repositories that use X_eTaL often ask for new language features, so I have to push back and suggest other ways to accomplish their goal.

Mistakes, caught early

A terse language makes it easy to write the wrong thing. X_eTaL’s inferred types catch many of those before a program runs: in a model, a shape or type mistake in a layer is an error before the forward pass, not a wrong number after it. Array Languages #14 follows the whole ladder, from the editor through macro expansion, types, lints and tests to run time.

That matters even more because X_eTaL has been built by coding agents since its first week, and AI coding agents are one of the audiences its README names. Small, deterministic programs with typed interfaces and tests are work an agent can do well and I can check.

What it costs

a tall stack of gold coins, with three more lying beside it

What costs? X_eTaL seems to achieve pretty high performance. Coding agents have no problem coding in it. And it is, in my opinion, easier to extend than other languages. Few people know it so far, but more and more people are being made aware of it, through Discord, meetups and Zoom calls.

A debugger that steps back

The terminal debugger stopped at line 8 of a small program, with breakpoints on lines 2 and 5, and panes for the stack, the variables, the watches, the breakpoints and the program's output
xetal debug in a terminal: stopped at line 8, with the variables, watches and breakpoints beside the source. Click to enlarge.

X_eTaL now has a debugger, finished in the last few weeks. Editors that speak the Debug Adapter Protocol drive it through xetal dap: VS Code, Emacs and Neovim. xetal debug FILE is the same debugger full screen in a terminal, and the live demo’s Debug button opens it in the browser, on the file being edited.

It has what you would expect: breakpoints (with a condition or a hit count), the call stack, each scope’s variables and watches, and an array viewer that draws an array as a grid, as slices, or in the browser as a block of cubes. And it travels back in time: Step Back goes to the statement before, Reverse Continue to the breakpoint hit before, and stepping forward again reaches the same states, without printing the program’s output twice.

An expression explorer, in development

xetal explore in a terminal: a function typed in ASCII beside its rendered form, the subexpression 10 times b highlighted in both, a focus pane, every subexpression listed with its value, and the program's output
xetal explore in a terminal: the cursor's subexpression marked in the typed and rendered text, and every part's value below. Click to enlarge.

A debugger steps through a program statement by statement. In an array language a single line can do a great deal, so the next tool works inside one expression: the expression explorer. Its first version landed on December 2, in the live demo as an Explore mode and in the terminal as xetal explore, and it is still being developed.

You type in ASCII and see it rendered, and it runs again shortly after you stop typing, within a step budget, so a long loop cannot freeze it; if the new text fails, the last good result stays beside the error. Point at any part of an expression, with the mouse in the browser or the cursor in the terminal, to see its value, its type and how many times it ran; or choose a value to go to the expression that made it. A tree view, shown or hidden by a toggle, draws the expression as a tree with each node’s value, and a train is drawn by its shape (a fork, an atop, a hook).

Closing

I’m pretty happy with the progress I’ve made along many fronts with X_eTaL, and I continue to work on its tooling and on dogfooding. There are plenty of interesting areas to explore: typing, performance, debugging, dependency management and more. It is a fun project, and it has helped me learn more about AI tools, machine learning and deep learning. I am also working on an X_eTaL Idiom Finder web application. Programming Language Tools #1 covers X_eTaL’s tools.