My Programming Language Wish-List
Posted by postfuturist on 2010-01-14 02:13:03

I write custom software for a living. It's usually fun, sometimes challenging, often tedious, but overall gratifying in a number of ways. One of these ways is that I get to be creative and build my own tools that help me write better software that is quicker to write, easier to support, and is more stable. Software is often boring, and the boring parts get all the tools, abstractions, DSL's, and the like. Programming languages provide the abstraction layer to build these things. We use programming languages like tools in a tool belt, pulling out the "right tool, for the right job." Many of these "right tools" are just general purpose programming languages that happen to have a feature or abstraction that another general purpose programming language doesn't. Even though we've been developing programming languages for the last 60 years, software is still being written in languages that are so severely lacking that programmers are little more than data entry drones.

I don't propose that any particular language is THE ANSWER. Such a thing does not exist, at least not yet. There aren't even any particular fantastic ones. The more I investigate other languages, the more I see features that I wish existed in the languages I use to get things done with every day. So, I'd like to compile a list. There's no reason why these things can't coexist in the same programming language. Most of the programming languages we use are very old and as certain ideas drift into other languages, the need for backwards compatibility causes new features to be implemented in strange ways. For example, object oriented programming being tacked onto old programming languages has created all sorts of syntactical abominations: C++, Perl 5 blessed references, and Objective-C to name a few.

Last rant before the list: I've been told that every Computer Science student takes a class on compilers and yet, we still write programs in PHP, Java, and C++. I'm just a lowly English major but I think we can do better. I've been reading Coders at Work, a collection of interviews with important software developers. Many of the interviews are with designers or people influential in the creation or design of popular or important programming languages such as JavaScript, Haskell, Erlang, Common Lisp, and Smalltalk. It's really interesting stuff, but it shows how most of these languages have flashes of brilliance, pieces that add to the puzzle, but are also missing out on a lot of innovations. That said, here is my list:

1. Classes and namespaces. It doesn't need to be object oriented, as that implies that everything has to be an object, even the entry point of your program. Java is object oriented, and I consider it a fault. Too many objects and too many classes. That said, classes of objects are nice abstractions that allow the programmer to arrange code and data in useful ways. Similarly, namespaces are a nice way of avoiding name collisions and organizing code. I want to be able to put stand-alone or helper functions in namespaces, and not be forced to create static functions as part of class definitions. Not everything has to be part of a class. Python gets this right (modules as namespaces).

2, Arbitrary data structures. Sometimes data enters a program from an external source like a database, or from a web browser, or a file. It is very handy to be able to take something like a string of JSON or XML and just convert it into a schema-less blob of data, native to your programming environment. JavaScript does this particularly well with dynamic objects and arrays that can nest in arbitrary ways. The literal notation for such lists and objects is so simple and straight-forward in JavaScript that it is the de facto standard for data exchange, thanks in part to Doug Crockford who codified it. Most languages we would consider "dynamically typed" do a decent job of this like Python, Perl, Ruby, and even PHP. Most languages we consider "statically typed" do not. Do I even have to name names?

3. First class functions. Functions need to be able to move around, breathe, combine and create other functions. This allows the programmer to create innumerable abstractions. C++, Java, and PHP just completely fail at this. Python does a half-assed job--sorry, but Python just kind of sucks this way. JavaScript, Perl, and many other languages do a better job.

4. Static and dynamic typing. I want it all. There are compelling reasons for both. I see no reason why I can't have both. Some languages already have this, like Boo, C# 4.0, Delphi, and maybe PHP. Maybe what I want is called optional static typing. That's not quite right, as it is really is a matter of perspective. It could be called optional dynamic typing, too, I suppose. In any event, it's not voodoo. I don't know why stubborn languages like Java and Python will not allow optional "other-style" typing. A lot of energy is spent with statically typed languages dealing with arbitrary data structures in sane ways or initializing objects with excessive typing: "Circle mycircle = new Circle()". Conversely, people in the purely dynamic languages camp spend a lot of time agonizing over compiler and runtime optimization when it would be so simple for the programmer to just let a profiler tell him where the "hotspots" are so he or she can just go in and add a few hints or type constraints into the code which allow the compiler or runtime to generate much faster code. In Python, you generally "drop down to C" to optimize the bits of code that run too slow. That's a shame, since it can destroy the cross-platform capability of your code and/or tie it to a single language implementation. It is also needlessly complex. Boo is really the best language I've seen in this space. It looks like a dynamically typed language but it actually uses type inference and is statically typed by default but allows explicit dynamic typing.

5. Good Concurrency Options. I like Erlang's actor model. I don't care much for the rest of the language. Much has been written about concurrency recently so I won't say much. There needs to be a way to share data between different threads and/or processes in a safe, sane way and the ability to effectively utilize multiple processing cores efficiently.

6. Clean syntax. I normally can adapt pretty well, but some languages just drive me bonkers with their awful syntax. Perl is one of those languages. I am not a fan of Lisp and it's many direct offspring. S-expressions are so mundane as to be mind-erasingly boring. Those languages sorely need some variation--some different operators or something. There is a healthy balance, leaning toward the simple. Python and Ruby are both decent. CoffeeScript, a mini-language that compiles to JavaScript has some neat ideas in this space. Using different symbols and operators allow languages to be expressive, and make it easier to catch the meaning of a bit of code at a glance, but are often superfluous. Most commas, semicolons, and curly braces you see are completely useless. 99% of the time, statements are separated by new lines, why do you need a semicolon, too? You don't. Items in a list are often separated by a comma and some white space, usually one space character. Do you need a comma? You don't. Usually when you see curly brackets, only one of them is adding any meaning to the code: the last one.

There are more things that I want from programming languages, but those are some big ones. If I could find a language that does them all, I'd be a happier programmer. Ultimately, software development is about getting things done and no profession has a perfect set of tools, but I still think that we can do much better.


blog comments powered by Disqus