Subj : Re: Compiler and an interpreter To : comp.programming From : Vesa Karvonen Date : Fri Aug 05 2005 12:10 pm Gerry Quinn wrote: > In article <1123159636.278503.19720@g43g2000cwa.googlegroups.com>, > robert.thorpe@antenova.com says... > > Gerry Quinn wrote: [...] > > But on a larger scale writing more of the OCaml is quicker. It may > > take you 30 seconds to write the above, but it may take Jon 10 seconds > > to write his. It all adds up. > Given that in either case one could write thousands of LOC in a day if > this were the bottleneck, I don't think it's a real issue. Programming is much more than just "writing" the code. Succesful code is read many more times than written. In the book ``The Mythical Man-Month'', Fred Brooks makes the conclusion that "Productivity seems constant in terms of elementary statements", based on data from several projects. Psychological studies have indicated that short-term memory has a capacity of 5-9 "items" (http://www.well.com/user/smalin/miller.html). Code in first-order languages typically has lots of little details, particularly details related to control flow and resource management, that can not easily be abstracted away in those languages. My own experience and intuition says that those details quickly eat all the available short-term memory and ruin productivity. Higher-order languages, on the other hand, make the construction and use of new (control flow and resource management) abstractions significantly easier. An elementary example is replacing loops by more intentional abstractions, as I briefly argue in http://javautils.sf.net/doc/javadoc/javautils/collections/Algs.html . A slightly more advanced example would be parsing combinators (http://www.google.com/search?&q=parsing+combinators) and other kinds of combinator libraries in general. For example, I recently designed a small combinator library for expressing for-loops in Standard ML (http://mlton.org/ForLoops). My own experience and intuition says that higher-order languages help to reduce the burden on short-term memory and significantly improve productivity. -Vesa Karvonen .