Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

Attack of the one-letter programming languages

Peter Wayner | Nov. 25, 2014
Watch out! The coder in the next cubicle has been bitten and infected with a crazy-eyed obsession with a programming language that is not Java and goes by the mysterious name of F. The conference room has become a house of horrors, thanks to command-line zombies likely to ambush you into rewriting the entire stack in M or R or maybe even -- OMG -- K. Be very careful; your coworkers might be among them, calm on the outside but waiting for the right time and secret instructions from the mothership to trash the old code and deploy F# or J.

The medical world, including the Veteran's Administration, remains one of the biggest users of the language, but there have always been redoubts in other industries such as banking where there's a need for processing large amounts of data. The M community is proud to crow that the European Space Agency wants to use it to analyze the data coming back from the Gaia mission.

If you're searching through big tables of medical records to find the cure for a disease, this can help you find the answer.

M on the Web:

One-letter programming language: P

There was once something called P-code produced by the Pascal compiler. It was meant to be a machine-independent version like Java class files, but that has little to do with the language that Microsoft calls P today. This version is designed to make it easier to write code for all the little machines in the world, the Internet of things. These often spend most of their time waiting for instructions, then they execute it.

P asks the programmer to construct a "state diagram" filled with nodes. The input from the user will trigger the transition from one node to another. A graphical version of the code looks like a bunch of rectangular blocks representing the states with a bunch of arrows drawn between them. The asynchronous commands trigger a jump from one box to another along one of the arrows.

Microsoft has built both graphical and textual ways of specifying P. The compiler converts your state diagrams into C code, which is, in turn, compiled as usual. In the past, simply handing the state diagram to a programmer produced code that wouldn't always make the right transitions. Asking the compiler to convert the state diagram in a regimented way will generally do a better job than all but the best programmers. Microsoft recently used the techniques to improve its work with the USB stack.

If you're creating code for an elevator controller or a microwave, a car, or any other element of the Internet of things, this offers a simpler way to build out the state diagram.

P on the Web:

One-letter programming language: R

A long time ago when mainframes ruled the earth, R was called S and researchers used it to compute statistics. The names changed when researchers added lexical scoping, but it still feels like an online scratchpad for extracting statistics from large tables of data. You load data, call functions to plumb the data for correlations, then turn these correlations into elaborate graphs.

Using R is a bit easier now thanks to tools like Rcmdr, RStudio, and a half-dozen more, with the interest in big data encouraging the creation of other options. Without R, all you have is a table full of numbers. With R, you can build fancy graphs of elaborate numbers that might even explain what's going on inside that inscrutable table.


Previous Page  1  2  3  4  5  6  Next Page 

Sign up for CIO Asia eNewsletters.