{"id":429,"date":"2004-03-16T07:23:00","date_gmt":"2004-03-16T07:23:00","guid":{"rendered":"http:\/\/www.dresan.com\/blog\/?p=429"},"modified":"2004-03-16T07:23:00","modified_gmt":"2004-03-16T07:23:00","slug":"more-on-languages","status":"publish","type":"post","link":"https:\/\/dresan.com\/blog\/2004\/03\/16\/more-on-languages\/","title":{"rendered":"More on Languages&#8230;"},"content":{"rendered":"<p>Most of my concerns last time were about syntax, which might strike you<br \/>as superficial.  So before I get any further into syntax, let me recognize<br \/>the importance of a clean underlying language model.<\/p>\n<p>There&#8217;s a lot of value to a pure language model.  A clear low-level imperative<br \/>model enables languages like C and FORTRAN to be translated into efficient<br \/>machine code, making them good system and scientific computation languages, <br \/>respectively.  A clear object model enables packaging vast quantities of code<br \/>into rich libraries for reuse, making Smalltalk and Java good languages for <br \/>experimentation and rapid development, respectively.  Pure functional <br \/>orientation makes correctness proofs and parallel transforms easy,making<br \/>Haskell and Objective Caml darlings of the language design movement.<br \/>And pure logical design makes it easy to specify what you want to do,<br \/>rather than how, and that makes languages like Prolog and Mercury <br \/>popular in certain artificial intelligence circles.<\/p>\n<p>But, in my mind, pragmatics ultimately trumps all.  There&#8217;s a reason<br \/>C++ was built on top of C, a reason Java has bare-metal types,<br \/>a reason Lisp has (progn) and (loop), a reason Prolog has cut.<br \/>Programmers have to be able to use the language to solve useful<br \/>problems, or the language is a toy.<\/p>\n<p>Now, this isn&#8217;t intended to denigrate language designers who have<br \/>taken one element of the paradigm to the max while at the same<br \/>time focusing on pragmatic concerns like execution efficiency,<br \/>expressiveness, and ease of use.  But, to be frank, most language<br \/>designers who do leap onto the fundamentalist imperative \/ functional<br \/>\/ logic \/ object-oriented bandwagon don&#8217;t even bother to address<br \/>such concerns &#8212; because they are fundamentally incompatible <br \/>with the programmatic consequences of the delusions and lies that <br \/>their religious views force them to adopt.<\/p>\n<p>Which brings us back to syntax.  Time and time again, I&#8217;ve heard<br \/>language designers say &#8220;I don&#8217;t like such-and-so features, so I&#8217;m not<br \/>going to put them into my language.&#8221;  Balderdash.  That&#8217;s not a valid<br \/>reason to do something in a programming language <strong>that<br \/>other programmers are supposed to use<\/strong>; it&#8217;s just childish<br \/>foolishness.  Oh, you don&#8217;t wan&#8217;t multi-line comments, nested comments,<br \/>or function types in your language? Too bad. Grow the fuck up.<\/p>\n<p>What&#8217;s a good reason to do something in a language?  It&#8217;s about the<br \/>consequences.  Multiple inheritance was omitted from Java because<br \/>it caused problems in the semantics and construction of C++ which<br \/>made it difficult for programmers to construct correct programs.  Similarly,<br \/>at the syntactic level Java uses a separate assignment and equality <br \/>symbol and removes the equivalence of integers and booleans<br \/>to prevent a class of common programmer errors.<\/p>\n<p>On the flip side, having expressive syntactic notations like the slice syntax, <br \/>list comprehensions and hash table constructors makes it possible for<br \/>programmers to write programs that accomplish a great deal concisely.<br \/>Lisp, my favorite language, makes it hard to write concise programs<br \/>because of its over-reliance on parentheses as its single list \/ grouping<br \/>\/ code block \/ function definition \/ macro \/ what have you construct.<br \/>I understand completely why ultimately a real Lisp dialect has to be<br \/>reducible to something like an s-expression comprising functions and<br \/>data.  But programmers should not have to <strong>write<\/strong><br \/>all of those s-expressions if there&#8217;s a more concise way to represent<br \/>it, nor should they have to rely on squinting at flashing parens and<br \/>reformatting indentation in their syntax-aware graphical editor just<br \/>to know whether or not they&#8217;ve written the right number of enclosing<br \/>parens on whatever godawful cond-lambda-reduce-map construct<br \/>they had to construct to get their job done.<\/p>\n<p>So my plan moving forward: collect examples of syntax I like, and<br \/>show how they might reduce to s-expressions in a variant of Lisp.<br \/>Ultimately I want to push this back to collecting examples of semantic<br \/>features I like, and derive a clean model that would be both expressive,<br \/>interpretable, compilable and efficient.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most of my concerns last time were about syntax, which might strike youas superficial. So before I get any further into syntax, let me recognizethe importance of a clean underlying&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11],"class_list":["post-429","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-development","ratio-2-1","entry"],"_links":{"self":[{"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/posts\/429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/comments?post=429"}],"version-history":[{"count":0,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/posts\/429\/revisions"}],"wp:attachment":[{"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/media?parent=429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/categories?post=429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/tags?post=429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}