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.

Of course, programming is a lot different now than it was in the early days of Unix. There are so many bits and bytes that the programmers can't keep the pointers straight. Thus, most of the serious work these days uses languages that take all the power out of the hands of the coders. C lives on, though, in the hearts and minds of those who still need to tweak the bits and bytes of the lowest levels of the operating systems and boot loaders. If you're writing a printer driver or fiddling with the context-switching of the kernel, it's still a big star.

While certainly not the first one-letter programming language, C has become somewhat of a granddaddy of the one-letter programming language naming tradition, given its far-reaching popularity. Consider it the B-movie crossover cult classic that became a mainstream hit.

One-letter programming language: D

When the new millennium began, many looked at C and found it both wonderfully flexible and expressive but a bit of a pain. It was one step above assembly language, so it was easy to work with the bits and bytes flowing into and out of the CPU. On the other hand, the language did little else, and programming in C became a constant struggle of juggling pointers while trying not to add security holes.

D's creators wanted to build a language with as much expressive power, but many of the modern conveniences like garbage collection and type inference. You can write simple bit-bashing loops while knowing that the D system will clean up the messy bits of memory and prevent you from doing something truly stupid with data structures. Apple took a similar strategic path when it created Swift.

There are some features, like objects, that everyone expects and some surprises, like constructs for functional programming. If you want to make a variable immutable — a oxymoron, I know — you can do it and use it in a recursive function. It has most of the raw power of C but upgraded with a modern sensibility. If you're writing device drivers, now you can do it without worrying — as much — about memory or simple pointer errors.

D on the Web:

One-letter programming language: F

The first big language was Fortran, and for years the language grew by adding features. Programmers half-joked that they didn't know what the next generation of programming languages would be, but they knew it would be called "Fortran."

This is half-true. Well, one-seventh true — F is a cleaner, simpler subset of Fortran created by the Fortran Company, a group whose motto is "For Fortran Enthusiasts by Fortran Enthusiasts." The mechanisms for working with data are mostly there, so you can feel right at home writing loops, but they cleaned out the cruft (like the EQUIVALENCE statement) that confused beginners.


Previous Page  1  2  3  4  5  6  Next Page 

Sign up for CIO Asia eNewsletters.