<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>BasedPL Blog</title><link>https://bpl.fast.ai/blog/index.html</link><atom:link href="https://bpl.fast.ai/blog/index.xml" rel="self" type="application/rss+xml"/><description>BasedPL, the Based-array Programming Language, is an APL-derived array language, borrowing ideas from J and BQN, with an emphasis on simple, consistent notation.</description><item><title>Introducing BasedPL</title><dc:creator>Jeremy Howard</dc:creator><link>https://bpl.fast.ai/blog/introducing-basedpl.html</link><description>&lt;p&gt;&lt;a href="https://bpl.fast.ai/index.html"&gt;BasedPL&lt;/a&gt; (BPL) is an APL-derived array language written in Rust, borrowing ideas from J and BQN. It comes as a standalone executable, a Python package with a Jupyter kernel, and a WebAssembly build that runs in a browser.&lt;/p&gt;
&lt;p&gt;Array languages express whole-array math in a few glyphs, without loops or temporary variables. Older APL rules still trip up day-to-day programming. 1-origin indexing clashes with Python and NumPy, implicit stranding forces separator glyphs like &lt;a href="https://bpl.fast.ai//glyphs/right-tack.html"&gt;&lt;code&gt;⊢&lt;/code&gt;&lt;/a&gt; next to operators, and positional broadcasting silently aligns the wrong axes when two dimensions have the same length.&lt;/p&gt;
&lt;p&gt;We built BPL to keep APL's glyphs and right-to-left evaluation while fixing those rough edges.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bpl"&gt;avg←+/÷≢
avg 2 4 9                                          ⍝ 5
m←[1 2 3◇4 5 6] ◇ +/⍤1 m                           ⍝ 6 15
sales←["NY" "LA";"jan" "feb"]:[1 2◇3 4]
"NY"⌷+/sales                                       ⍝ 3
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="cleaner-notation"&gt;Cleaner notation&lt;/h2&gt;
&lt;p&gt;Most of BPL's notation changes follow from writing lists in brackets, &lt;code&gt;[a b c]&lt;/code&gt;, as in Python and JavaScript. Bare literals still strand without brackets (&lt;code&gt;1 2 3&lt;/code&gt;, &lt;code&gt;"no" "yes"&lt;/code&gt;), and &lt;a href="https://bpl.fast.ai//glyphs/diamond.html"&gt;&lt;code&gt;◇&lt;/code&gt;&lt;/a&gt; or line breaks inside brackets build higher-rank arrays (&lt;code&gt;[1 2◇3 4]&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Spaces separate runs. Each run evaluates before its neighbours. That removes the &lt;a href="https://bpl.fast.ai//glyphs/right-tack.html"&gt;&lt;code&gt;⊢&lt;/code&gt;&lt;/a&gt; guard in &lt;code&gt;+/⍤1 m&lt;/code&gt; and shows train structure in expressions like &lt;code&gt;⌊ +/÷≢ 1 2 4&lt;/code&gt; (floor of the mean, &lt;code&gt;2ₓ&lt;/code&gt;). Positions and axes count from 0, with negative positions counting from the end, on top of BQN's based array model and leading-axis semantics. Selection is a regular function (&lt;a href="https://bpl.fast.ai//glyphs/squad.html"&gt;&lt;code&gt;⌷&lt;/code&gt;&lt;/a&gt;, or literal subscripts like &lt;code&gt;v₁&lt;/code&gt;) and works on string-keyed axes as in &lt;code&gt;"NY"⌷+/sales&lt;/code&gt;. &lt;a href="https://bpl.fast.ai/principles.html"&gt;Language principles&lt;/a&gt; explains each rule and &lt;a href="https://bpl.fast.ai/comparison.html"&gt;BPL, APL and BQN side by side&lt;/a&gt; compares them on real code.&lt;/p&gt;
&lt;h2 id="named-axes-index-notation-and-autodiff"&gt;Named axes, index notation and autodiff&lt;/h2&gt;
&lt;p&gt;Positional broadcasting hides bugs when a batch axis and a feature axis share the same length. Adding a 2-item bias to a 2-by-2 batch silently adds the bias across batch items instead of features. When axes have names, BPL pairs them by name regardless of position:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bpl"&gt;r←["b":2 "o":2]ρι4ₓ ◇ bias←["o":2]ρ[10 20]ₓ
r+bias                                             ⍝ [10 21◇12 23]ₓ
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Selection pairs axes by name as well. That is how &lt;a href="https://bpl.fast.ai/index-notation.html"&gt;index notation&lt;/a&gt; works. Tacit rank and transposes stay concise for a plain matrix product (&lt;code&gt;x+.×w&lt;/code&gt;), while multi-head attention or strided convolutions get hard to read. With &lt;code&gt;•index&lt;/code&gt;, you write the formula for one element using named indices and fold along a named axis (&lt;code&gt;+.×⍠k&lt;/code&gt;). BPL contracts inner products along named axes directly as matrix products, without building the intermediate grid of products:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bpl"&gt;xu←[2 3]ρι6ₓ ◇ wu←[3 4]ρι12ₓ ◇ [b o k]←•index 2 4 3
∧/, (xu.[b k]+.×⍠k⁝wu.[k o]) = xu+.×wu             ⍝ $t
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://bpl.fast.ai/autodiff.html"&gt;Automatic differentiation&lt;/a&gt; is a primitive operator, &lt;a href="https://bpl.fast.ai//glyphs/partial.html"&gt;&lt;code&gt;∂&lt;/code&gt;&lt;/a&gt;. &lt;code&gt;f∂X&lt;/code&gt; differentiates through primitives, dfns, trains, operators, records, and indexed or sliced updates. Forward mode runs for a single scalar input, and reverse mode runs for many inputs. Higher-order derivatives compose directly (&lt;code&gt;f∂∂&lt;/code&gt;), and &lt;a href="https://bpl.fast.ai//glyphs/partial.html"&gt;&lt;code&gt;∂&lt;/code&gt;&lt;/a&gt; traces functions into replayable typed programs for training loops:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bpl"&gt;+/⊼ ∂ 1 2 3                                        ⍝ 2 4 6
p←["w":2 "b":1] ◇ {3×ω.w + ω.b}∂ p                 ⍝ ["w":3 "b":1]
×/∂∂ 2 3                                           ⍝ [0 1◇1 0]
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="rust-kernels-fusion-and-compiled-loops"&gt;Rust kernels, fusion and compiled loops&lt;/h2&gt;
&lt;p&gt;BPL interprets each function call once and runs whole-array work in compiled Rust kernels backed by &lt;code&gt;rustymath&lt;/code&gt;. Elementwise and structural calls producing 65,536 or more items stay pending until a result is needed, then fuse into cache-sized single-pass blocks that read each input array once. Eligible fused float chains compile to native machine code in under a millisecond, and large calls split across CPU cores. &lt;a href="https://bpl.fast.ai/system/explain.html"&gt;&lt;code&gt;•explain&lt;/code&gt;&lt;/a&gt; reports which calls fused, forced memory reads, or ran through a compiled loop. &lt;a href="https://bpl.fast.ai/performance.html"&gt;Performance&lt;/a&gt; and &lt;a href="https://bpl.fast.ai/foundations.html"&gt;Computational foundations&lt;/a&gt; cover the evaluator, tracing, and numeric domains.&lt;/p&gt;
&lt;h2 id="try-it"&gt;Try it&lt;/h2&gt;
&lt;p&gt;Open the browser &lt;a href="https://bpl.fast.ai/playground.html"&gt;playground&lt;/a&gt; or the interactive &lt;a href="https://bpl.fast.ai/gallery.html"&gt;gallery&lt;/a&gt; to run BPL through the &lt;code&gt;basedpl&lt;/code&gt; WebAssembly package on npm, with no local install.&lt;/p&gt;
&lt;p&gt;For local work in Python, Jupyter, or a terminal:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;&lt;span class="hl-function-call"&gt;pip&lt;/span&gt; &lt;span class="hl-variable-parameter"&gt;install&lt;/span&gt; &lt;span class="hl-variable-parameter"&gt;basedpl&lt;/span&gt;
&lt;span class="hl-function-call"&gt;basedpl-install&lt;/span&gt;
&lt;span class="hl-function-call"&gt;bpl&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;basedpl-install&lt;/code&gt; installs the Jupyter BasedPL kernel and BPL fonts, and on macOS installs a native keyboard layout. Each release also includes a standalone &lt;code&gt;bpl&lt;/code&gt; executable on GitHub Releases for macOS on Apple silicon and Linux on x86-64 and arm64, with no Python required. Inside Python, you can use &lt;code&gt;%%bpl&lt;/code&gt; cells in notebooks or call the &lt;a href="https://bpl.fast.ai/python.html"&gt;Python API&lt;/a&gt; directly alongside NumPy. In the REPL or playground, type a backtick and a glyph name (such as &lt;code&gt;`iota&lt;/code&gt; for &lt;a href="https://bpl.fast.ai//glyphs/iota.html"&gt;&lt;code&gt;ι&lt;/code&gt;&lt;/a&gt;) and run &lt;code&gt;]help +&lt;/code&gt; for built-in documentation. Start with &lt;a href="https://bpl.fast.ai/getting-started.html"&gt;Getting started&lt;/a&gt; for a guided walkthrough.&lt;/p&gt;</description><category>releases</category><category>array-languages</category><guid>https://bpl.fast.ai/blog/introducing-basedpl.html</guid><pubDate>Wed, 02 Dec 2026 00:00:00 GMT</pubDate></item></channel></rss>