The Wasteful Legacy of Programming as Language

A few years ago I visited a friend who is a graduate student in linguistics. After some time he asked me if I was aware of the work by Chomsky on formal languages. I told him that yes, Chomsky work was a basis for much of the developments in theoretical computer science. More than that, I was glad to learn that there was something technical that I could share and discuss with other people in linguistics.

At the time I found this was just a great coincidence. It was only recently, though, that I started to think seriously about the implications of the idea that much of our understanding of computer programming stated with the study of human languages.

Language and Computers

One of the early ambitions in computer science was to understand, or at least be able to parse, human language. In order to do this, computer scientists explored models of how language worked in general. Based on these models, researchers figured out that we could classify languages in terms of complexity. Moreover, many computer languages could be entirely contained in some of the lower levels of this hierarchy, which is called the Chomsky hierarchy.

This was an incredible discovery for scientists working on compilers and interpreters, because its developments resulted in the necessary tools to efficiently parse languages. After that, instead of creating ad hoc parsers, which was the norm in the early period, one could apply a rigorous method to find a parser for a particular programming language.

The insidious side of this success, however, is that it completely changed the perceptions computer scientists have of how to give instructions to computers. We now have a frame of mind in which the important thing in the process of instructing a computer is to define a suitable language – and the more powerful the language the better.

The problem of this line of reasoning is that it creates a number of hurdles that are completely artificial, as we will soon discuss. For example, it makes us believe that there is something fundamentally different between programming languages, when in fact it doesn’t.

Computer Languages versus Human Languages

When we look at human languages, it does make sense that different languages exist. After all, language is a cultural concept. For example, as a speaker of two languages, it is very clear to me that speaking in English conveys different meaning and context, compared to things spoken in my mother language. There are a set of ideas that are better expressed in English, as well as there is a huge subset of thoughts that I wouldn’t be able to express well in anything other than my primary language.

As human beings, we want language to be inexact and able to convey several meanings. Contrary to the popular belief among mathematicians and engineers, this is a good feature of human languages, because it mimics the way we think. The truth about the study of language is that we are dealing with the whole culture of a community, not just with a stream of tokens that convey meaning.

The opposite, however, is true for computer languages. While we might strongly favor the use of human-like language, computers don’t really care if we use a bracket of a “begin” symbol to start a block of commands. Which means that we are, by introducing the subtleties of human language, complicating the task of how to instruct computers. Instead, we could just avoid the subtle differences in programming language and use a simple, uniform representation.

Unnecessary Work

The other problem with using current programming languages is that they create a lot of unnecessary work. Computer scientists have throughout the years devised baroque languages such as C++ and Java in an effort to provide programming instructions in a powerful way. It turns out, however, that the whole steps of writing a sequence of tokens, parsing that stream, and checking the syntax is unnecessary.

Everything in a computer program can be interpreted as a tree of expressions. If you’re encoding that tree in a block generated by a bracketed expression or a for loop it is not important for the computer. There is no reason why we cannot manipulate the syntax tree directly, for example, using a tree model on the screen, instead of parsing tokens used to recreate the tree every single time.

As a result, the use of a language is unnecessary in both sides: computers don’t care where the stream of bits is coming from. It could be coming from a direct binary representation or from a Java program with all variables in German.

Human beings, on the other hand, don’t necessarily need to use the language either. Although it may look like a useful feature, the existence of a language implies the manual labor of keeping a textual representation, as well as the algorithmic work of translating that representation back into a tree of expressions. The point is that, for all we care, we could just as well be moving boxes around the screen to represent variables — there is no necessity to create a textual document representing a program.

Divide and Conquer

Still, the other issue with programming languages is that it tends to divide programmers into artificial categories, one for each language or even flavor of a language. For example the only difference between a Java programmer and a C# programmer is that they use somewhat different keywords and have to program against a different run time library. The only reason C# and Java programmers think of themselves as different is that they use the concept of language to define themselves.

Being more polemic, the only difference between a C programmer and a Lisp programmer is in what their languages force them to do. A C programmer is forced by its language to write pointer-related code. While a Lisp programmer is forced to think in terms of lists of expressions (even when they’re using other data structures).

A language-less programming system, on the other hand, would avoid this kind of issue altogether by providing only the means to do work, without forcing programmers to use a pre-defined way of thinking. Whatever the form used to interact with the program, a language-less system doesn’t care if parts of the program are shaped as s-expressions or C blocks: it just combine them as needed to create a program.

In a program written in this way, using garbage collection is just a matter of plugging the right run time support, which you could get along with the system or you could buy from a third party. Instead, we erroneously consider garbage collection as a fundamental attribute of the language in use. As another example, in a language agnostic system we would would be able to create and call closures by just adding a simple module to the system, not by devising yet another language that supports closures as a first class citizen.

But the advantages don’t stop there. Without the need for a language, it also disappears the need for a compiler. Everything is such a system is already parsed and ready to use. When we combine pieces of code they already know how to glue themselves to each other, so there is no need for a linker either.

A system would regenerate a new executable in a fraction of a second, instead of going through the painful and wasteful process of language interpretation, code generation, linking. For example, what exactly is the need to recompile an entire file when we change only a single character? In a traditional language, that is entirely necessary, because you could be modifying the token “blass” to “class”, which changes entirely the meaning of the whole file. In a language-less system, this could never happen, because each transformation is related to the existing syntax tree, which is already stored in the system. Therefore, a single change like this can only have local effect in the program.

Why Such a System Doesn’t Exist?

There are several reasons, but the least important of them is technology. We have graphical capabilities in any modern desktop computer that are beyond what is necessary to implement the visualization features for such a programming environment. The main difficulty separating us from that goal is the experience we already have as programmers.

Each one of us have been trained to use textual languages as the main way of interact with computers. We have learned to use associated tools, such as grep and make, that are imperfect but that give good results if you are disciplined.

Moreover, it is satisfying to use the huge amount of code available with the existing technologies. Everyone of us have been conditioned for many years to look at what has been done in our programming language, and even reuse the code if needed.

I think that this is the main reason why visual languages have had such a hard time to establish themselves. After using such a language for a few minutes, you immediately feel that it is so much easier to go back and write yet another program in C or Java or Python. Of course, it will always be much more productive to use a tool that you’re used to.

However, we have never been able to really improve a language-less system enough to see their advantages as compared to traditional language-based systems. I believe that there will be a big jump in programming quality the day a group of people decide to develop a true language-agnostic programming system. And when programmers in general learn that they don’t need a language to create valid code they will think that we were just crazy for using, for such a long time, a concept as wasteful as that of programming language.

Photo credit: commons.wikimedia.com

Similar Posts:

Similar Posts

908 Comments

  1. You are so interesting! I do not suppose I’ve truly read something like that before.
    So great to find someone with original thoughts on this topic.
    Really.. many thanks for starting this up. This site is one thing that
    is required on the web, someone with a little originality!

  2. I was curious if you ever thought of changing the layout
    of your blog? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so
    people could connect with it better. Youve got an awful lot of text for only having one or 2 images.
    Maybe you could space it out better?

  3. You actually make it seem so easy with your presentation but
    I find this matter to be really something which I
    think I would never understand. It seems too complicated and extremely broad for me.
    I am looking forward for your next post, I will try to get
    the hang of it!

  4. I have been exploring for a little for any high quality articles
    or weblog posts on this sort of area . Exploring in Yahoo I at last
    stumbled upon this site. Reading this info So
    i’m satisfied to express that I’ve a very just right uncanny feeling I discovered just what I
    needed. I most without a doubt will make certain to
    do not forget this web site and give it a glance
    regularly.

  5. I’m really loving the theme/design of your site.
    Do you ever run into any internet browser compatibility
    issues? A number of my blog visitors have complained about my
    website not operating correctly in Explorer but looks great in Chrome.
    Do you have any ideas to help fix this problem?

  6. I’ve been exploring for a little for any high quality articles
    or blog posts in this kind of house . Exploring in Yahoo I ultimately stumbled upon this web site.
    Reading this info So i’m satisfied to show that I have an incredibly just right uncanny feeling I discovered just
    what I needed. I such a lot no doubt will make sure to don?t omit this website and give it a look regularly.

  7. Magnificent beat ! I would like to apprentice at the
    same time as you amend your website, how can i subscribe for a blog site?
    The account aided me a appropriate deal. I have been tiny bit familiar of this your broadcast provided shiny transparent concept

  8. Simply wish to say your article is as amazing. The clarity to your put up is
    just great and that i could suppose you are a professional in this subject.

    Fine along with your permission allow me to grab
    your feed to stay updated with drawing close post. Thank you one million and please
    carry on the rewarding work.

  9. Woah! I’m really enjoying the template/theme of this website.

    It’s simple, yet effective. A lot of times it’s difficult to get that “perfect balance” between superb usability
    and visual appeal. I must say you have done a excellent job with this.

    Additionally, the blog loads extremely quick for me on Internet explorer.

    Superb Blog!

  10. This design is steller! You certainly know how to keep a reader entertained.
    Between your wit and your videos, I was almost
    moved to start my own blog (well, almost…HaHa!) Great job.
    I really enjoyed what you had to say, and more than that, how
    you presented it. Too cool!

  11. What i do not understood is if truth be told how you are no longer really a lot more smartly-favored than you may be right
    now. You are so intelligent. You realize therefore significantly in the case of
    this topic, made me in my opinion believe it from numerous
    various angles. Its like men and women don’t seem to be
    fascinated until it’s one thing to do with Woman gaga!
    Your own stuffs great. All the time deal with it up!

  12. I absolutely love your blog and find almost
    all of your post’s to be what precisely I’m looking for.

    can you offer guest writers to write content to suit your needs?

    I wouldn’t mind publishing a post or elaborating on a few
    of the subjects you write with regards to here. Again, awesome web
    site!

  13. I’ve been exploring for a little for any high quality articles or weblog posts on this sort of area .
    Exploring in Yahoo I eventually stumbled upon this website.
    Studying this info So i am satisfied to express that I’ve an incredibly just right uncanny feeling I found out just what I needed.
    I such a lot indisputably will make certain to don?t forget this web site and give it a look on a relentless basis.

  14. Hi, I do think your site could possibly be having browser compatibility problems.
    When I take a look at your blog in Safari,
    it looks fine but when opening in IE, it has some overlapping
    issues. I simply wanted to give you a quick heads up! Besides that, great website!

  15. Hey There. I discovered your blog the usage of msn. That is a very well written article.
    I’ll make sure to bookmark it and return to read more of your helpful info.
    Thanks for the post. I will certainly comeback.

  16. Superb blog! Do you have any recommendations for aspiring writers?

    I’m hoping to start my own blog soon but I’m a little lost on everything.
    Would you propose starting with a free platform like WordPress or go for
    a paid option? There are so many choices out there that I’m
    completely overwhelmed .. Any recommendations? Thanks a lot!

  17. Fantastic beat ! I would like to apprentice while you amend your site,
    how could i subscribe for a blog site? The
    account helped me a acceptable deal. I had been a little bit acquainted of this your broadcast provided bright clear idea

  18. Link exchange is nothing else but it is only
    placing the other person’s webpage link on your page at suitable place and other person will also do similar in support of you.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.