How easy it is to construct an APL or K-like programming language

(by Mohammed Jamal Alrujayi)

This was an amazing article I found on the orange site published just last week. He notes that although APL and K are of the Harvard school of languages, while Lisp is of the MIT school, they are fundamentally related in their minimalism and in how the languages are structured around a single data type: Lists for Lisp, and vectors/matrices for APL. The two schools of thought were unified in the K programming language by Arthur Whitney:

On kparc.com (his personal website) he listed K’s lineage simply as “lisp and apl,” linking to Iverson’s Turing paper and Perlis’s lyrical programming.

I didn’t know much about Iverson’s family of languages (#APL, J, #BQN, K, and so on), but seeing it embedded in just a few lines of code in a high-level language like #Python suddenly makes it so much easier to understand. The syntactic keywords are basically composed of either infix operators of mapping operators, the data (constants or variables) are like leaves of the syntax tree. So all you need are three lambdas: “atom” checks if it’s argument is a number, monad serves as apply or map depending on the type of it’s arguments and abstracts it into a lambda, and “dyad” constructs an infix operator abstracted into a curried lambda. You only need those three rules!

atom = lambda x: isinstance(x, (int, float, str)) monad = lambda f: lambda x: f(x) if atom(x) else list(map(monad(f), x)) dyad = lambda f: (lambda x, y: f(x, y) if atom(x) and atom(y) else list(map(lambda yi: dyad(f)(x, yi), y)) if atom(x) else list(map(lambda xi: dyad(f)(xi, y), x)) if atom(y) else list(map(lambda xi, yi: dyad(f)(xi, yi), x, y)))

Now I definitely want to try this as Scheme macros!

#tech #software #Lisp #APL #KProgrammingLanguage #JProgrammingLanguage #ProgrammingLanguages #PLT

Golfing APL/K in 90 Lines of Python

Lisp + APL = K

MOHAMMED JAMAL ALRUJAYI
Aviation weather for Rafael Hernandez airport in Aguadilla area (Puerto Rico) is “TJBQ 071350Z 08014KT 10SM CLR 29/21 A3007” : See what it means on https://www.bigorre.org/aero/meteo/tjbq/en #rafaelhernandezairport #airport #aguadilla #puertorico #tjbq #bqn #metar #aviation #aviationweather #avgeek vl
Rafael Hernandez airport in Aguadilla (Puerto Rico) aviation weather and informations TJBQ BQN

Aviation weather with TAF and METAR, Maps, hotels and aeronautical information for Rafael Hernandez airport in Aguadilla (Puerto Rico)

Bigorre.org
@tmcfarlane @rsc
□↯[3 3]□↯[3 3]⇡9 #Uiua
<3‿3⥊<3‿3⥊↕9 #BQN
,3 3#,3 3#!9 #K
<3 3$<3 3$i.9 #J
(⊂3 3∘⍴)⍣2⍳9 #Dyalog #APL
advent-of-code-2025

Advent of Code in BQN

Codeberg.org

Reading about trains in the #bqn documentation in preparation for #adventofcode tomorrow feels like

https://www.youtube.com/watch?v=eKpVQm41f8Y

Little Eva - Loco-motion(1962)

YouTube
🌘 BQN 的「巨集」運用 •Decompose 剖析
➤ 解構 BQN 函式,解鎖語法樹操作的無限可能
https://saltysylvi.github.io/blog/bqn-macros.html
本文深入探討 BQN 系統函數 •Decompose 的強大功能,它能分解函式,讓程式設計師存取函式的語法樹(AST),如同 Lisp 的巨集。作者展示如何利用 •Decompose 實現兩種進階應用:自訂訓練(train)語意,以更靈活地組合單子(monad)函式;以及符號微分,可對數學表達式進行符號運算。文章詳細介紹了建構遞迴解析與重組 AST 的輔助函式,並透過具體範例說明如何修改函式結構以達到預期效果。
+ 太酷了!第一次聽說 BQN 有像 Lisp 巨集一樣的東西。•Decompose 感覺能打開很多新世界的門。
+ 符號微分的例子雖然結果有點複雜,但原理很有趣。期待看到更簡潔的實作!
#程式設計 #BQN #函式式程式設計 #巨集 #語法樹
BQN "macros" with `•Decompose`

🐍🐒 Behold, the "Zoo of Array Languages," where letters and numbers come to frolic in a chaotic code safari! 🦓🌪️ #APL360, #BQN, and friends are here to remind you that your keyboard is a weapon, and syntax is just a suggestion. 🤪👾
https://ktye.github.io/ #ZooOfArrayLanguages #CodeSafari #SyntaxFun #ProgrammingAdventure #HackerNews #ngated
ktye

Turbo C++ brings back a bad memory of mine as we were forced to use it in college (2009).

However, https://ktye.github.io/turbo/index.html is cool!

There's some other cool information on #array #apl #j #bqn languages on that website.

TURBO

A few days ago I started learning a language called #BQN https://mlochbaum.github.io/BQN/ I ported some number crunching code I had from #zig into it and it's roughly 10× smaller! I'm thinking about embedding it into some of my code to handle the mathematically heavy parts.
BQN: finally, an APL for your flying saucer

हवाई अड्डाRafael Hernandez में Aguadilla (पुएर्तो रिको) का विमानन मौसम है “TJBQ 161350Z 09014G21KT 10SM SCT021 31/24 A3008” : पर देखें इसका क्या मतलब है https://www.bigorre.org/aero/meteo/tjbq/hi #aguadilla # #rafaelhernandez #tjbq #bqn #metar #aviation #विमाननमौसम #avgeek vl
हवाई अड्डाRafael Hernandez में Aguadilla (पुएर्तो रिको)के लिए विमानन मौसम और डेटा TJBQ BQN

हवाई अड्डाRafael Hernandez में Aguadilla (पुएर्तो रिको)TAF और METAR के साथ विमानन मौसम, नक्शे, होटल और वैमानिक जानकारी

Bigorre.org