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. each time i used to read smaller content which also clear their
    motive, and that is also happening with this article which I am reading at this time.

  2. Hello there, I do think your web site could possibly be having internet browser compatibility
    problems. Whenever I look at your site in Safari, it looks fine however, when opening
    in I.E., it’s got some overlapping issues. I just wanted to provide you
    with a quick heads up! Aside from that, wonderful
    blog!

  3. Superb blog! Do you have any hints for aspiring writers?
    I’m planning to start my own site soon but I’m a little lost on everything.

    Would you recommend starting with a free platform like
    Wordpress or go for a paid option? There are so many options out there that I’m totally confused
    .. Any tips? Appreciate it!

  4. Hmm is anyone else encountering problems with the images on this blog loading?
    I’m trying to determine if its a problem on my end or if it’s the blog.
    Any responses would be greatly appreciated.

  5. This design is steller! You certainly know how to keep a reader amused.

    Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job.
    I really loved what you had to say, and more than that, how
    you presented it. Too cool!

  6. I’m extremely impressed with your writing skills as well as with the layout
    on your weblog. Is this a paid theme or did
    you customize it yourself? Either way keep up the excellent quality writing, it’s rare to see a nice blog like this one today.

  7. Hey I know this is off topic but I was wondering if you knew of any widgets I
    could add to my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something
    like this. Please let me know if you run into anything.
    I truly enjoy reading your blog and I look forward to your new updates.

  8. Can I simply just say what a comfort to find a person that genuinely knows what they’re discussing on the internet.
    You actually realize how to bring an issue to light and make it
    important. A lot more people really need to read this and understand this side of your story.
    I was surprised you’re not more popular since you definitely have
    the gift.

  9. Nice post. I used to be checking constantly this weblog and I am inspired!
    Extremely helpful information particularly the final
    section :) I deal with such information much. I was seeking this
    particular info for a long time. Thanks and best of luck.

  10. I was wondering if you ever considered changing the structure of your website?

    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
    1 or two pictures. Maybe you could space it out better?

  11. First of all I want to say great blog! I had a quick question that
    I’d like to ask if you do not mind. I was curious to
    find out how you center yourself and clear your head prior to
    writing. I’ve had trouble clearing my mind in getting my ideas out there.
    I do enjoy writing but it just seems like the first 10 to 15 minutes
    tend to be wasted simply just trying to figure out
    how to begin. Any recommendations or hints? Thank you!

  12. Definitely believe that that you said. Your favorite justification seemed to be at
    the web the simplest thing to have in mind of.
    I say to you, I certainly get annoyed while other people think about concerns that they plainly do not know
    about. You managed to hit the nail upon the highest and also outlined out the whole thing without having side-effects ,
    other people could take a signal. Will likely be back to get more.
    Thank you

  13. Do you mind if I quote a couple of your posts as long as I provide credit and sources back to your webpage?
    My website is in the very same area of interest as yours and my
    users would truly benefit from some of the information you
    provide here. Please let me know if this alright with you.
    Appreciate it!

  14. An outstanding share! I’ve just forwarded this onto a coworker who was conducting a little
    homework on this. And he actually ordered me dinner because I found it for
    him… lol. So let me reword this…. Thank YOU for the meal!!

    But yeah, thanx for spending time to discuss this issue here on your site.

  15. Excellent way of telling, and pleasant post to get facts on the topic of my presentation subject matter, which i am going to convey in college.

  16. Hi there! I’m at work browsing your blog from my new iphone!
    Just wanted to say I love reading your blog and look forward to all your posts!
    Carry on the excellent work!

  17. I know this if off topic but I’m looking into starting my own blog
    and was curious what all is required to get setup? I’m assuming having a blog like yours would cost a pretty penny?
    I’m not very internet savvy so I’m not 100% positive.

    Any suggestions or advice would be greatly appreciated.
    Thank you

  18. I absolutely love your blog and find many of your post’s to be exactly I’m
    looking for. Does one offer guest writers to
    write content for you? I wouldn’t mind composing a post or elaborating on some
    of the subjects you write about here. Again, awesome web site!

  19. It’s actually a cool and helpful piece of info.
    I am happy that you simply shared this useful information with us.
    Please keep us up to date like this. Thank you for sharing.

  20. What i do not understood is in truth how you’re not really much more
    neatly-appreciated than you might be right now. You’re very intelligent.
    You recognize therefore considerably on the subject of
    this topic, produced me personally consider it from numerous
    numerous angles. Its like men and women don’t seem to be involved
    unless it’s something to accomplish with Lady gaga!
    Your individual stuffs excellent. Always handle it up!

  21. This is the perfect website for anyone who really wants to find out about this topic.
    You understand a whole lot its almost hard to argue with you
    (not that I really will need to…HaHa). You definitely put a new spin on a subject which has been written about for many
    years. Great stuff, just great!

  22. I’m extremely impressed with your writing skills as smartly as with the structure in your blog.

    Is this a paid theme or did you customize
    it your self? Anyway keep up the nice high quality writing,
    it is rare to peer a nice blog like this one today..

  23. I have been surfing online more than 2 hours today,
    yet I never found any interesting article like yours.
    It’s pretty worth enough for me. In my view, if
    all website owners and bloggers made good content as you did, the net will be a lot more useful than ever before.

  24. I do agree with all of the ideas you have presented on your post.

    They are very convincing and will certainly work.
    Nonetheless, the posts are very brief for newbies. May
    just you please lengthen them a bit from next time?
    Thank you for the post.

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.