If you want to sell your great new programming language to me for use in my day job, perhaps in 2020, it had better provide me with a way to define functions.

Now, hopefully most of you will be mystified by this requirement. Isn’t that a bit like saying I’m not buying a car unless it has a steering wheel?

Well, some cars don’t have steering wheels and there are languages that don’t have functions and I’m old enough to have had to use some of them for doing real work (like writing compilers). No doubt, there are still designers out there that are hard at work at creating languages without the means to define functions. I expect that these days such languages will be labeled as “non procedural”, “declarative”, “domain specific” or some such label of intrinsic merit.

I don’t want to discourage such innovation, but I also don’t expect that even by 2020, I shall be able to dispense with the luxury of defining new functions. It is the way I have been thinking about computation since at least my Middle School days. It is dyed in my wool and I’m not giving it up.

But I do have some additional requirements: When I say function, I don’t mean this sort of thing:
   function SayHelloFromJavaScript(targetAudience) {
      alert(“Hello “+targetAudience");

I want my functions to return something and I want that something to be predictable. In other words, the result must depend on the arguments and nothing but the arguments. I don’t want to have to worry about where and when I call a function. Given its arguments and the definition of a function, I want to know it all.

Now, I’m not asking for a programming language that does not provide a way for programs to cause and detect changes to the environment they run in. I just want to look at a function call expression and know with absolute certainty that the function call will have no side effects and will do something that can be predicted solely from the argument values and the function definition. I run into this requirement a lot in my everyday programming. It is hard to compose programs from libraries, while also reasoning with certainty about their correctness, security and ability to run parts of the computation in parallel. I need help from the programming language.

Of course, languages like Haskell and F# already do this, and they still have lots of life left in them. So why aren’t I using them for my every day programming? I often wonder myself. Haskell is not an option since I live in Visual Studio and target .NET. F# is harder to explain. Part of it is my home turf at the bottom of the software stack. F# tends to be a better consumer of .NET libraries than a producer. Much of what makes it special needs to be forgone if you want to produce libraries that C# programmers can use. Another part of it is sheer inertia. I have C# built into my finger tips. The C# tools are just better than anything else. Moving to another language feels like I’ll be giving up just too much.

I also have some qualms about the syntax. C# is no beauty either, but I have resigned myself to its warts. But getting myself from nodding familiarity to deep expertise is just that much less appealing when the syntax seems stranger than necessary. I have never been a fan of the LISP “syntax” and the ability to omit the outer parentheses does not seem to increase my tolerance. It is interesting that this feature has been so strongly conserved in the functional language family. One is tempted to conclude from that this feature must be really valuable. But I can’t find a compelling reason for it and it does not seem to have much uptake in other language families. I wonder if this is just another instance of the QWERTY effect.

It certainly seems to me that it is a bit of shame to use blank spaces as semantically meaningful delimiters, when we have no shortage of other delimiters. I also suspect that features that I find nice in C#, such as overloading and default parameters, become much more difficult to contemplate because of the lack of the disambiguation non blank delimiters can supply.

Perhaps by 2020 all of this will be moot and editors will have advanced to the point where languages are no longer linear strings of mostly ASCII characters.

At any rate, what I’m looking for are functions that are obviously pure, look like the ones I encountered in middle school mathematics, are first class values, capture immutable state when nested, behave well when run in parallel and can be distributed across time and space. And it has to be in a fresh new language that is small and easy to learn, but which does not make me feel like I’m giving up just too much.

If this sounds like just too much to ask for, remember that 2020 is still 8.5 years away. Who knows what might happen between now and then. I look forward to it.