Tell me about your ideal programming language.

Suppose you could create the specification for your ideal programming language. It must be possible to implement (it can’t solve undecidable problems, etc), but other than that the sky’s the limit. What would you put in it (what kind of syntax, intrinsics, etc)? For what sort of applications would it be used? What other features would it have? Would the interpreter/compiler do anything unusual? Tell me anything you want about your ideal language and the tools that go with it. You’re welcome to answer some of these questions if you don’t have answers to all of them.

I’ve been asking variations of this question to all sorts of people, and it’s fascinating seeing where they agree and where they don’t.

Leave a Reply


    • Static typing, with sane type inference, like ML.
    • Automatic polymorphism, like ML.
    • Availability of good immutable data structures, with the syntax to make them awesome (again, like ML)
    • Higher-order functions, because nothing makes sense without them.
    • Useful, non-hamstrung (…Python, I’m looking at you!) anonymous functions.
    • Partial application and currying. Not as a feature (Python’s partial module) but as the way every function works, every time. (I keep coming back to “Like ML”…)
    • Classes
    • Type Classes, as they make operator overloading sane.
    • Operator overloading, because I once had to add together two BigIntegers in Java.
    • Being able to define new operators, like ML.
    • A sane module system; #includes fill up the namespace, C++s namespaces are weak. I want something like Python’s (or Haskell’s) system, where I can do anything from from math import sqrt to from math import * to import math as M. ML-style functors would be cool, too.
    • Whitespace-based control flow, like Python or Haskell. At this point, I’m convinced that letting people decide much at all is a bad idea: Python allows people to decide how far to indent, and whether to use tabs or spaces, and that’s not a good thing. Pick a standard, and make everybody use it; Python already taught us that people will adapt if the standard is sane. Decide that indents are two spaces, or four, or whatever, and make everybody do it that way.
    • A top-level interpreter. So very helpful.
    • An optimizing machine-code compiler. Nothing so far interferes directly with the goal of a fast-running language, and speed matters.
    • A reasonable collection of libraries that come installed. The overhead of finding a useful library, installing it, and so on is huge. Again, Python has the right idea here.
    • A sane way of embedding machine-readable documentation in the source. Literate programming ain’t gonna happen, but Javadoc is a hack. Python’s docstrings are the right idea, but I’d like to see something more powerful.
    • Garbage collection. Of course.
    • Type safety. Of course.
    • A not-embedded-in-strings way of doing regexs, like Perl. “\\w+” is stupid.
    • An implementation-defined (NOT standard-defined) spec, so there’s actually some sane idea of what “correct” means. (See this), and that implementation better be as free-as-in-everything as possible (BSD-like, for preference)

    And I’m sure I’ll think of some more stuff later.

  1. Also, actual optimization of tail recursion (what the hell were you thinking, Java?) and Python’s BRILLIANT sprintf hack. It’s genius.

    Syntactic sugar for generators is cool, too. List comprehensions. Dictionary comprehensions would be nice.

Enable Javascript to Leave a Reply

Your browser has Javascript disabled right now. You must enable Javascript in order to leave a comment. This is done to prevent spam (most comment spam comes from bots that do not render Javascript correctly). If you need instructions for enabling Javascript, look here.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


You must wait 5 seconds after loading this page before you can submit a comment. This is done to reduce comment spam.