You may have heard about how array programming languages such as APL, J or K. If you have, you've probably heard that code written in these langua

An imperative introduction to array programming — Elias Mårtenson

submited by
Style Pass
2024-10-31 07:30:09

You may have heard about how array programming languages such as APL, J or K. If you have, you've probably heard that code written in these languages is incredibly dense and unreadable. “Line noise” is a term often used to refer to them.

In this post, I will try to use Kap to give an introduction to the language by using an imperative programming style. Actual Kap code is a mix of terse and verbose styles, but perhaps illustrating the verbose style first provide a different perspective.

If you want to get an introduction to the terse style immediately, you can read the Kap tutorial. Most APL tutorials will also be useful, although there are some differences between Kap and APL (explained here).

This post assumes that the reader has familiarity with various imperative programming languages, such as C, Java or Javascript.

The goal is explain the basic syntax of Kap in a way that is as similar to these programming languages, and then show how adding a little bit of line noise can make expressions much more concise.

Leave a Comment