6 ms·
On Programming Languages as Languages
- TuringTest 12y ago"We can look at programming languages in two possible ways. They can be a means for us to instruct the computer, and incidentally communicate with fellow programmers, or they can allow us to communicate with other programmers in specific terms that are ultimately executable." If anyone doubted this, of course an essential purpose of programming languages is for communicating with humans. The computer only needs the binary code that triggers the microprocessor's electric signals in the right combinations. What's a shame is that the common features of these languages have been shaped more by the needs of the machine than the needs of the developers - and not just that: by the needs of 1950's computers. A lot of developers understanding of what a programming language is has been shaped by those early efforts, and dragged through 60+ years of PL history. More modern languages have overcome the most glaring inconveniences of early languages, but the core assumption -that a PL's purpose is ultimately and exclusively as a tool to convey instructions to the machine- remains unchallenged. But that's not an essential property of human-machine languages, and programming doesn't need to be that way. From the fields of End-User Development and semiotics applied to Human-Computer Interaction come some alternatives that propose an understanding of programming which is closer to the second way to look at PLs, as a tool for human comunication. An interesting possibility is using computers in a way close to the "augmenting the human intelect" vision that existed before programing languages. In this approach, you don't have the loom-like vision of programs as sequences of instructions that are number-crunched by the machine, but as sets of symbols intended to be shown to humans, who would reason about them and extract meaning. In this view, data and code are interleaved as a single entity, and not all content in the program needs to be executable - only some bits are crunched and passed to the processor for execution as a side-effect of using the tool, but the whole thing is intended as a sort of interactive novel that the user reads and steers to create some content or the other. (This is the approach of Literate programming, and is also related to Live Programming). This can be taken to the extreme by creating instruction sets that work as recipies and can produce different executable code, so their meaning changes depending on the context on which they're executed. Configuration files and XML domain-specific languages may work this way, and it's a very natural way to reason for the human mind, yet this approach has not been fully explored by general-purpose programming languages.
- acangiano 12y agoThis post is unlikely to see the frontpage of HN. Please consider posting your wonderful comment in the comment section of my blog.
- TuringTest 12y agoEarlier I posted a somewhat-related post at Ars Technica about using MS Office as a programming language in the way I describe above. You may find it interesting as well. http://arstechnica.com/gadgets/2014/11/preview-office-for-android-tablets-is-like-office-for-ipad-but-on-android/?comments=1&post=28036889 http://arstechnica.com/gadgets/2014/11/preview-office-for-an...
- tel 12y agoI think much of modern PL research (and with a little poetic license, all of the original PL research) is actually dedicated to developing PLs as human languages for expressing pure, true thoughts. What is "pure and true" in this context? That was the question which originally drove the invention of PLs or logical languages and answers were attempted near the beginning of the 20th century by Russell, Whitehead, Frege, and many others. Church, Curry, and Turing, notable names in early CS, were actually largely driven by Hilbert's mathematical program of formalizing mathematical logic. So what does this effort look like today? PLs of this pedigree are barely at all interested in how binary codes work (unless they are the object of study, of course). Instead, they endeavor to provide valid logical frameworks of massive expressive power. Modern PLs in this vein can formalize mathematical logic through intuitionistic logic which is something like the logic most people learned in school but augmented with a notion of the limits of the Halting Problem. This means that it lives nicely between logic and computer science. So why do we think that PLs are an object of computer commands? Because the popular ones which were both widely implemented and fast had that property. It's essentially a walk in the park to convert Assembly to machine instructions compared to an intuitionistic logic calculus. We then proceeded not by seeking to make Assembly more like its forebearing languages but instead to layer abstraction after abstraction atop it to make the fundamentally alien task at hand more manageable. This is ultimately a flawed program judged that way. Furthermore, it's also less than half as old as the original PL research efforts, but it already had us develop many techniques for efficiently executing complex tasks on a computer. This is an important part of "computer algorithm design" but essentially a side-topic to the larger field of PL research.
- ranko 12y agoReminiscent of Weinberg's 1971 "Psychology of Computer Programming", which discusses programming as a human activity. This is from chapter 1: "Programming is, among other things, a kind of writing. One way to learn writing is to write, but in all other forms of writing, one also reads. We read examples—both good and bad—to facilitate learning. But how many programmers learn to write programs by reading programs?" He goes on to discuss programming as an individual and social activity, with the principle that it's a human activity at root.
- mallamanis 12y agoThere is some recent research has shown that programming languages present some "naturalness": Hindle, Abram, et al. "On the naturalness of software." Software Engineering (ICSE), 2012 34th International Conference on. IEEE, 2012. http://macbeth.cs.ucdavis.edu/natural.pdf http://macbeth.cs.ucdavis.edu/natural.pdf