Jovial, JCL, Java and Javascript

December 10th, 2014 No comments

J is for Jovial, JCL, Java and Javascript.

Jovial is rather like Cobol in that it is very widely used in one huge market (software for US DOD systems) and has almost non-existent usage outside that market. I have always heard it described as Fortran-like, however it shares many keywords with Algol 60 and some of the letters from its acronym name are the original name used for Algol (International Algorithmic Language). The design of Jovial was contemporary with both languages and I imagine that there was lots of cross fertilization between the design groups.

JCL (Job Control Language) is what the non-Unix world calls shell scripts.

Java is a child of the Internet. Yes, there were a lot of people unhappy with C++ and very willing to jump ship, but the Internet made the marketing slogan “write once, run anywhere” sound like it truly was the future (which it might well be for some language at some future date).

Java was a wake-up call to compiler vendors who had not being paying attention to the impact that Open source was having on the market. Those who followed the time honored tradition of bolting a new language on to the front of their existing product line soon found they could not sell against free; the sound of scales falling from eyes could be heard around the world.

Up until Java arrived the two ways of making money from a language were selling compilers and training; neither were big enough money spinners to be of interest to a company as large as Sun Microsystems. Word was that Sun thought they could make money from Java, exactly how was never spelled out (but Oracle are certainly going for it). The Java Study Group was set up to investigate the possibility of creating an ISO standard for Java. Sun’s enthusiasm for the work of this group became crystal clear during what was supposed to be a two day meeting at Sun’s offices in Cupertino; half way through the first day we were told that no meeting room was available to host us on the second day, a flurry of phone calls resulted in a meeting room being found for the second day, down the round at Apple. The minutes thank both hosts, with no mention of an abrupt switch of venue.

Javascript would not have existed without the Internet and its ‘design’ must be a contender for the most costly software mistake ever made.

Tags:

INTERCAL and Icon

December 9th, 2014 No comments

I is for INTERCAL and Icon.

INTERCAL is a parody of a programming language whose most widely known statement is COME FROM. With the storm in a teacup that once engulfing goto remembered as ancient history, COME FROM now feels like an in-joke for developers who write assembler.

Icon was created by one of the creators of Snobol 4 and so received more attention that it might otherwise have got. The language’s main claim to fame is that generators, known as iterators in more modern languages, are a fundamental building block of its design (the functionality will look very familiar to Python users); Icon is a late period Cambrian explosion language (CLU supported iterators and started life a few years earlier, but I don’t know enough about the language to make a call on the question of fundamental building block status).

Things to read

Books about Icon.

Tags:

Haskell, HTML and Hack

December 8th, 2014 No comments

H is for Haskell, HTML and Hack.

In the early 1980s every computer science department with any research pretensions had at least one member of staff who had invented and implemented their own functional language; in many cases PhD students were writing a thesis on some particular aspect of their supervisor’s language. One part of history that is universally ‘forgotten’ is the extent to which languages got redesigned to take advantage of neat implementation tricks discovered by these earnest students; yes, it really was implementation details that shaped the structure of so many of these languages. Eventually it dawned on the academics that perhaps the reason the world was not converting to using functional languages was because there was no obvious market leader, so they did what the commercial world had already tried to do several times, they created a language that was to be the market leader, i.e., Haskell (which has had as much success at attracting the rest of the world as its commercial counterparts). The number of new functional languages did drop significantly, but this was due to a change in fashion and nothing to do with the Haskell work.

HTML is the computer language that most non-programmers have heard of that many developers don’t consider to be a programming language (because it is not Turing complete).

Hack is a language I wrote about earlier in the year.

Tags:

GPSS and Go

December 7th, 2014 No comments

G is GPSS and Go.

GPSS (General Purpose Simulation System) is a domain specific language for discrete time simulation. This language gets a mention because it was created during the programming language Cambrian explosion that occurred during the late 60s/early 70s when people created all the programming language concepts we have today (pointers to new ideas that came later welcome); it also gets a mention because there are so few languages starting with G.

Go will be of interest to future software archeologists. Being created in to a world where everything is recorded its brief period of fame and decline into oblivion will be available for detailed scrutiny. How many young guns are creating, without management bothering to take an interest in technical details, the foundations of important corporate applications using Go? One common difference between Corporate source and Open source is that corporate people are often unwilling to give up what they see as substantial investment in existing code (open source developers are no different, but in this environment there are always plenty of other developers, with no stake in existing code, willing to jump in and write something ‘new’). Hopefully I will be around to see the results from analyzing the data from projects developed and maintained over Go’s history.

Tags:

Fortran, Forth, Frink and Flow

December 6th, 2014 3 comments

F is for Fortran, Forth, Frink and Flow.

Fortran is a member of the triumvirate of founding major languages. Its continuing success is due to it doing a good job addressing important application areas (i.e., big engineering and scientific number crunching problems) and the availability of high quality compilers (non-software engineers will pay for good tools and big science problems attract lots of government funding). Computer science types may turn their noses up at Fortran, but they are in the fashion business (which is why Algol 60 died out) and not interested in solving big real-world problems. For many years Fortran compilers reliably generated faster code than C compilers because lots of customers will willing to pay for high quality (C compilers assumed that optimization was the programmer’s responsibility) and because Fortran’s lack of pointer types made it much easier to figure out what code was doing. These days C compilers have been around long enough that high-end optimizations have trickled into them and they also have enough processing power and main memory to figure out what those pointers are getting up to.

Forth and BASIC were the minimalist languages of their day (and Forth still is in some niches). Forth was the techi’s language (who else would be content to write code using reverse Polish) that allowed developers to get that bit closer to the bare metal and talk technical stuff about threaded code. Perhaps the reason Forth has lost the general appeal it once had is because its core users have embraced respectability (e.g., creating a language standard and boasting about the availability of ‘proper’ compilers); returning Forth to its roots of bare metal, threaded code, hell-raising might bring back the following it once had.

Frink supports dimensional analysis of source code, something I am a big fan of (this kind of analysis is a step up from traditional strong type checking). Other languages designed, in a bygone age, to support dimension checking have disappeared, as have proposals to extend popular languages.

Flow adds gradual typing to Javascript; it is from Facebook who seem to be making a habit of this sort of thing, and I hope they succeed. A consequence of OO’s success is that most developers now think of types purely in terms of a mechanism for matching calls to the appropriate method. The idea of intentionally creating type information that is intended to fail to match, as a means of detecting coding mistakes, has been lost to a generation of developers. I would like to predict that languages supporting strong static typing are going to make a big comeback (once word starts to spread about the time saving benefits of static type checking), but things did not turn out that way last time such languages were in fashion.

Tags:

Eiffel, English and Erlang

December 5th, 2014 No comments

E is for Eiffel, English and Erlang.

Eiffel was a contender to be THE OO language of choice for developers. The Bertrand Meyer‘s book on how to write OO software using Eiffel blew me away, I was convinced that this was the way forward. But to be widely used a language needs popular compilers on the mainstream platforms and Meyer’s Eiffel compiler was a commercial product of a company he had started around the language. Eiffel may have been a much better language than C++ back in 1986 (or even today), but Cfront was available for free, for non-commercial use, and the Zortech C++ compiler came out at a very low price point in 1988 (developers hate paying for the tools of their trade). Meyer and his research group are still plugging away at Eiffel today and it probably has supporters all around the world, but I have never met one.

English is effortlessly spoken by hundreds of millions of people; how much easier programming would be if it could be done in English. The fact that little effort is required to see through this idea on so many levels (not least of which is the fact that most people are terrible at writing English) has not prevented a few misguided souls implementing the idea in some form or another. Grace Hopper can be forgiven for thinking that using English keywords in Cobol would make it easier to use, computer languages were brand new in the 1950s.

The Osmosian Order have created an English-like language, plus implementation and IDE written in their language, that is the best of its kind I have seen (I have only read through the compiler source and not written any non-trivial code). The Attempto project would be a good starting point for anybody looking to create an even more ambitious ‘English’ compiler.

Erlang is one of those languages whose usage continues to quietly grow and spread. Having a widely available usable compiler is a necessary but not sufficient condition for a language to grow and spread, the language has to be very good for solving an important and commonly occurring problem. Erlang supports language-level features (i.e., not library calls) that make it relatively easy to write programs that create and manage processes.

Things to read

Object-Oriented Software Construction by Bertrand Meyer (get the shorter, more readable, 1988 edition).

Representation and Inference for Natural Language: A First Course in Computational Semantics by Patrick Blackburn and Johan Bos (an early draft).

Longman Grammar of Spoken and Written English by Douglas Biber, Stig Johansson, Geoffrey Leech, Susan Conrad, and Edward Finegan. For people who need to move up from reading dictionaries.

The Semantics of English Prepositions. Spatial Scenes, Embodied Meaning and Cognition by Andrea Tyler and Vyvyan Evans. Full of delightful examples, targeting a tiny fraction of the language, that are ideal for illustrating that English is not at all simple and unambiguous.

Plain English Programming by The Osmosian Order of Plain English Programmers (I found the compiler source more readable).

Tags:

Dylan, D and Dart

December 4th, 2014 No comments

D is for Dylan, D and Dart. All languages I have read about but never used in anger.

Dylan is a corporate creation that is old enough to have gone through the complete cycle of creation, endorsement by a corporate sponsor (Apple), reasonable adoption by developers in its niche, fall from grace (i.e., loss of corporate backing) and the eventual release of an open source implementation by a dedicated group of true believers.

D shines in the reflected reputation of its creator, Walter Bright, the second most important person in making C++ what it is today. Until Zortech launched Walter Bright’s C++ compiler, in 1988, all the available C++ compilers were based on Cfront, which was a bit of a pain to use (Cfront to C to object code and on to the joys of using a non-C++ aware linker); it was even released before Cfront version 2. Zortech C++ was a good quality native compiler at a reasonable cost and decent documentation (well, at least once version 2.0 arrived). There was a ready market for this compiler in the form of a large number of developers who were already happily using Bright’s C compiler, marketed by Zorland Zortech. Responding to Zortech’s success Borland released Turbo C++ two years later, with Microsoft (as always) being the language laggard with Visual C++ five years later.

If it had not been for Walter Bright, 1) C++ would not have had the name recognition needed for ISO to start investigating the possibility of a standard for the language, 2) there might not have been a usable mass market C++ compiler in time to win the battle against Java in 1995, or 3) another OO language would have come along and taken the market (there were lots of languages that never took off because C++ got there first). Without the success of Zortech’s compiler it is likely that C++ would have been just an interesting research project that never went anywhere.

Dart is about Google management trying to repeat their Android-Dalvik/Java-JVM land-grab success with browsers and Javascript. If it had been the result of engineers with too much time on their hands the language would have never been submitted for standardization by ECMA. Yes, Javascript has more problems than you can wave a stick at, but creating a ‘superset’ language and a whole new virtual machine to run it is so obviously not the solution. I wonder what patents Google own that have some connection with this new VM?

Tags:

Coral 66, CHILL, C, Cobol and C++

December 3rd, 2014 No comments

C is for Coral 66, CHILL, C, Cobol and C++. Writing compilers for languages beginning with C is a surprisingly accurate summary of the first half of my professional career.

Coral 66 is a variant of Algol 60 created by a branch of the UK Ministry of Defence. Apart from being the target language for my first compiler related work after graduating (a preprocessor to implement floating-point double) it also illustrates the difference between the UK and US military establishments, with the former deriving its language from the academically respectable Algol 60 and the later deriving Jovial from the engineering oriented Fortran.

CHILL gets mentioned because I spent 2 years writing and maintaining a front end of a CHILL compiler whose claim to fame may be as the oldest compiler still in production use; I have been half expecting somebody to point to a PL/1 mainframe compiler that is older. The language does support 2-dimensional switch statements, which I have not encountered elsewhere, e.g., switch i, j ... requires matching the value of i against one list of case labels and then matching the value of j against a second list associated with the first matched value.

C, I have written enough about this already.

COBOL is generally mocked by software developers, but it is a surprisingly sophisticated language; I suspect that the real target of the mockery is the thought of business people writing software. Business people have one redeeming characteristic in the programming language world, they are willing to pay good money for good compilers (generally developers are loath to spend money on the tools of their trade). I think that more money has been spent buying COBOL compilers than buying compilers for all the other languages put together.

My company won a contract to produce an optimising Micro Focus COBOL code generator for the Motorola 88000 (the successor to the popular, to developers, 68000) this is where I got to experience the most extreme form of debugging I have ever done. Creating a code generator for a new cpu involves cross-compiling programs from a platform that already supports the necessary tools and eventually cross-compiling the new compiler so that it executes on the target cpu. Porting software to a new cpu and OS invariably uncovers new faults that are specific to that combination of platform; compiler writers have to deal with the uncertainty that the fault might actually be caused by the code they generated. I’m used to handling this extra level of uncertainty, some developers cannot handle it and end up in mindless looping activities until something different to do. It was not until the target hardware was delivered that we found out it contained alpha silicon (i.e., a not yet in beta version of the cpu), and oh, here is an awk script to run your generated code through to map the instructions that don’t yet work to something that does; ever couple of week we would get an updated cpu motherboard, OS update and of course an awk script for that version of the silicon. I am not looking to repeat the ‘excitement’ of using an alpha silicon cpu to test a freshly written code generator, awk script or not. Sean Corfield deserves a lot of the credit for getting this project to work.

C++ was almost a very different beast than it is today. SC22 (the top level committee responsible for ISO programing language standards) did not think C++ was sufficiently different from C to warrant a separate committee. WG14 discussed this issue and gave a formal response to SC22 saying “we are not the committee to standarize C++”. WG21 was created, but without the power to publish any standards, with the task of figuring out what to do. Things came to a head, in a very heated discussion, at the WG21 meeting during early 1992 in London; the meeting minutes are suspiciously brief. The two positions were, 1) C++ is still incomplete and needs time to evolve to become itself before being standardized (I recall the AT&T representative saying that “C++ needed to fulfill its destiny” and banging the table, which got a round of applause), 2) we need a C++ ISO standard asap because C++ is being used now for production work and we have to stop Bjarne making major changes to the language (up until then existing practice was for the group creating an ISO language standard to specify the words for whatever existed at the time, i.e., no invention of new features); the Microsoft representative was the vocal led on this position.

As an outsider it (I had not attended the two previous WG12 meetings) there appeared to be many floating voters in the room and it could have gone either way, but the standardize now camp eventually prevailed.

Stroustrup’s solution to future C++ evolution possibly being stymied by WG21 was to become an active member of WG21 and to recruit like minded individuals to continue the work of evolving C++ within WG21, i.e., an ISO language committee broke with tradition and started doing major language invention.

Why did people care that Stroustrup kept changing the language, why didn’t they ignore him and carry on with whatever C++ compiler they were using? Up until almost the date of the London meeting all but one C++ compilers were based on Cfront, and who maintained and controlled Cfront? Yes, none other than Bjarne Stroustrup himself.

Things to read

The Design and Evolution of C++, by Bjarne Stroustrup. Get the 1994 edition, before history started to get updated.

Tags:

BASIC, Babbage, BCPL, B, BLISS and BLooP

December 2nd, 2014 No comments

B is for BASIC, Babbage, BCPL, B, BLISS and BLooP

BASIC was the Javascript of its day in the sense that it was the language supported by the greatest number of computing platforms in the field; this is likely a very different view of BASIC than the one readers brought up on the various Microsoft products have. Back in the day Basic (lower case to separate it from its original beginners roots) was a language that met a few simple criteria: 1) it could be implemented in a few K of memory and support useful programs that ran in a few more K, 2) it used line numbers for control flow and source editing, 3) it had a print statement and 4) if it supported arrays they were defined using the letter sequence DIM.

Babbage crossed my path during my first job after graduating. It was billed as a high level assembler, but I suspect it was created as a side project by somebody wanting to learn a bit about compilers who found existing languages too hard. Such languages and their implementations continue to proliferate today, but back in the day developers often had to use them for production work because no alternatives were available.

BCPL was a return to simplicity compared to the increasingly ornate languages that designers were coming up with later in the 1960s. These days it is probably best known, if known at all, as the language that most strongly influenced the design of C. I have found that mentioning its name often brings back fond memories in those who used it in an earlier life.

B was the language designed by the group of guys that came up with C some months later. Its main claim to fame is as a source of debate about whether the successor to C should be called P (the third letter in BCPL) or D (the fourth letter of the alphabet).

BLISS is another systems language from the late 60s. Its claim to fame is as the target language of the PQCC project (Production Quality Compiler-Compiler). This project invented, or at least brought all the pieces together in one place, the structure of how compilers are written today, i.e., convert the source to a tree and have lots of passes walk over this tree slowly transforming it to optimized code. PQCC happened in the early 70s and when I encountered it on a compiler project at Intermetrics at the start of the 80s the design approach seemed impractical to me, and others new to the ideas; the resulting compiler would easily exceed the available computer memory capacity of the day (the secret sauce that rarely got talked about was software memory management). By the mid-90s memory was so plentiful that all the compiler research from the last two decades could finally fly.

BLooP is a language that is not Turing complete. It was created by Douglas Hofstadter for his book Gödel, Escher, Bach and fails to be Turing complete in a rather interesting way, by being limited to computing functions that are primitive recursive.

Things to read

The Design of an Optimizing Compiler, by William Wulf, Richard K. Johnson, Charles B. Weinstock, Steven O. Hobbs, and Charles M. Geschke (longish technical report).

I suspect “Gödel, Escher, Bach” got such rave reviews in its day because nobody wanted to admit to not understanding it; I found it overly long and too full of itself. Chunks of it might appeal to a young audience.

Tags:

ALGOL 60, AWK, ALGOL 68, Ada, APL and Assembler

December 1st, 2014 No comments

Having watched other blogs run themed Advent calendars, this year I have plucked up the courage to attempt my own based on programming languages in alphabetical order. The choice of languages covered will be governed by a mixture of my having used them, me thinking they are interesting in some way and for some letters not having many languages to write about.

Off we go…

A is for Algol 60, awk, ALGOL_68, Ada, APL and Assembler.

Over 50 years later its amazing how modern the Algol 60 report feels (some might complain about the lack of object oriented features, but we have to wait until 1967 for these to appear). Unlike Cobol and Fortran, from the same period, Algol is not generally known today, but it has probably been much more influential on what came after it. Randell and Russell’s “ALGOL 60 Implementation” from 1963 was the go to book for compiler writers until the Dragon book appeared in 1977.

AWK is my go to language for simple text processing. It’s one line at a time approach to handling input maps so well on to many real world problems, using a bigger language just feels like overkill.

Algol 68 was just as ground breaking as its earlier namesake. The Chomsky revolution in linguistics was in full swing, everything could be specified using syntax (that messy semantics stuff was tamed!), and programming languages had to get with it. Algol 68 was specified using a two-level grammar, one level of grammar specified syntax rules that were used to specify the second level syntax rules for actual source code (i.e., rules specifying rules). This two-level approach enabled many semantic requirements, on code, to be specified by syntactic rules, which was considered to be a good thing. The problem was language exponents loved to explain the wonderful syntactic goings on to all and sundry, and the language never spread beyond those who fell in love with two-level grammars (yes, your author was young once). One of those involved in early work on Algol 68 thought it such a monstrosity that he left and same up with a much simpler language, Pascal. A blast from Christmas’s past for those who miss pouring over line printer output.

Ada gets a mention because rather than get involved with writing an Ada compiler for somebody else I started my own company working first in Pascal and then C. I’m not sure if anybody yet understands the reasons behind Ada’s failure to become the widely used language that it was intended to be (enough money was thrown at it). Those involved pivoted and these days Ada is touted as somehow being ideal for use in safety-critical applications.

APL. The language that insists you write code that is the antithesis of readability. Despite the need for a special keyboard to write programs this language used to have a surprisingly large following (it was big in financial institutions where the ability to succinctly evaluate complex formula was demanded). The fact that it proved possible to compile APL convinced me that it was possible to write a compiler for any language.

Assembler. How could I not mention assembler?

Things to read

Informal introduction to Algol 68 by Lindsey and van der meulen, for those who find the language definition, A Revised Report on the Algorithmic Language ALGOL 68, a little brain scrambling.

Grammars for Programming Languages by J. Craig Cleaveland and Robert C. Uzgalis is a very readable introduction to two-level grammars.

Rationale for Design Ada Programming Language by J. Ichbiah J. Barnes is full of interesting insights.

Effective awk Programming: Universal Text Processing and Pattern Matching by Arnold Robbins, the 4th edition is out in two months :-)

I have never read any really good APL books. Suggestions welcome.

Tags: