{"id":10,"date":"2006-06-07T17:47:42","date_gmt":"2006-06-07T17:47:42","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2006\/06\/07\/why-so-many-languages-programming-languages-computation-and-math\/"},"modified":"2006-06-07T17:47:42","modified_gmt":"2006-06-07T17:47:42","slug":"why-so-many-languages-programming-languages-computation-and-math","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2006\/06\/07\/why-so-many-languages-programming-languages-computation-and-math\/","title":{"rendered":"Why so many languages? Programming languages, Computation, and Math."},"content":{"rendered":"<p>Back at my old digs last week, I put up <a href=\"http:\/\/goodmath.blogspot.com\/2006\/05\/practical-applications-of-good-math.html\">a post about programming languages and types<\/a>. It produced an interesting discussion, which ended up shifting topics a bit, and leading to a very interesting question from one of the posters, and since the answer actually really does involve math, I&#8217;m going to pop it up to the front page here.<\/p>\n<p> In the discussion, I argued that programmers should know and use many different programming languages; and that that&#8217;s not just a statement about todays programming languages, but something that I think will always be true: that there will always be good reasons for having and using more than one programming language.<\/p>\n<p> One of the posters was quite surprised by this, and wanted to know why I didn&#8217;t think that it was possible, at least in principle, to design a single ideal programming language that would be good for any program that I needed to write.<\/p>\n<p> It&#8217;s a good question, which I think connects very naturally into the underlying mathematics of computation. As I discussed back on the old blog, one of the very fundamental facts concerning computation is the Church-Turing thesis: that computation has a fundamental limit, and that there are many different ways of performing mechanical computation, but ultimately, they all end up with the same fundamental capabilities. Any computing system that reaches that limit is called an <em>effective computing system (ECS)<\/em>.  Anything that one ECS can do, any other ECS can do too. That doesn&#8217;t mean that they&#8217;re all identical. A given computation can be really easy to understand when described in terms of one ECS, and horribly difficult in another. For example, sorting a list of numbers is pretty easy to understand if it&#8217;s written in lambda calculus; but it&#8217;s a nightmare written for a Minsky machine; and it&#8217;s somewhere darned close to impossible for a human to understand written out as a cell-grid for Conway&#8217;s life.<\/p>\n<p> How does this connect back to programming languages? Well, what is a programming language really? From a theoretical point of view, it&#8217;s a language for specifying a computing machine. Each program is a description of a specific computing machine. The language is a particular way of expressing the computing machine that you want to build. Underlying each programming language is an effective computing system: a fundamental model of how to perform computations. That&#8217;s the real fundamental difference between programming languages: what fundamental way of representing computation underlies the language.<\/p>\n<p> Assuming that you&#8217;re looking at a good programming language, it&#8217;s good for a particular task when that task is easy to describe in terms of the fundamental ECS underlying the language; it&#8217;s bad for a task when that task is not easy to describe in terms of the languages underlying ECS.<\/p>\n<p> If a language has a single ECS underlying it, then there are tasks that it&#8217;s good for, and tasks that it&#8217;s not so good for. If you try to smoosh multiple ECSs together under the covers of one language, then you don&#8217;t really <em>have<\/em> one language: when you&#8217;re writing for a vonNeumann machine, you&#8217;re really using one language, and when you&#8217;re writing for Actors, you&#8217;re using another. You&#8217;ve just forced two languages together into the same framework &#8211; but they&#8217;re still two languages, and you&#8217;ve probably compromised the quality of expression of those two languages by forcing them together.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Back at my old digs last week, I put up a post about programming languages and types. It produced an interesting discussion, which ended up shifting topics a bit, and leading to a very interesting question from one of the posters, and since the answer actually really does involve math, I&#8217;m going to pop it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[24,54],"tags":[],"class_list":["post-10","post","type-post","status-publish","format-standard","hentry","category-goodmath","category-programming"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-a","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/10","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/comments?post=10"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/10\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=10"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=10"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}