Attack of the one-letter programming languages

From D to R, these lesser-known languages tackle specific problems in ways worthy of a cult following

1 2 Page 2
Page 2 of 2

It's worth marveling at the stark power of this one-line program to find all prime numbers less than R. It's barely even half a line:

(!R)@&{&/x!/:2_!x}'!R

In fact, it's less than half a line -- it's exactly 21 characters. You could probably pack a K program for curing cancer into a single tweet. If you're crunching large multidimensional arrays of business data into answers, you can save your fingers a lot of work with K.

K on the Web: http://kx.com/

One-letter programming language: G

A number of projects lay claim to the letter G, but one popular option differentiates itself from the pack in very interesting ways. While people talk about the Internet of things as if it were entirely new, G programmers have been using their code to build physical items from the beginning. The language is widely used to control the milling machines that turn a block of metal, wood, or plastic into an object.

Many versions of G have surfaced in the 50-plus years it's been around. As the machinery became better, G adopted a number of functions for positioning and repositioning the cutting tool. The syntax is largely unreadable to neophytes, and it is more like assembly code than any elaborate computer language. G96, for instance, is a code that changes the relative speed of the cutting tool. It's followed by the speed. This lack of abstractions may be why many operators call it "G-code" instead of thinking of it as a full language.

If you're building the next generation of computer-designed objects, start here.

G on the Web: http://cncinformation.com/G-Code/G-Code.html

Related articles

1 2 Page 2
Page 2 of 2