{"id":2568,"date":"2017-04-05T19:18:58","date_gmt":"2017-04-06T02:18:58","guid":{"rendered":"http:\/\/blackcap.name\/blog\/new\/?p=2568"},"modified":"2017-04-05T19:18:58","modified_gmt":"2017-04-06T02:18:58","slug":"go-the-computer-language-and-fads","status":"publish","type":"post","link":"https:\/\/blackcap.name\/blog\/new\/?p=2568","title":{"rendered":"Go (the Computer Language) and Fads"},"content":{"rendered":"<p>I&#8217;ve been looking at the Go programming language recently, because (a) it&#8217;s started showing up a lot more in job descriptions, and (b) it combines the interesting attributes of both being compiled to machine language and being garbage-collected.<\/p>\n<p>Unfortunately, it also falls victim to what I regard as an unfortunate fad amongst programming language designers in recent years: the decision that full, preemptive threading is something that programs don&#8217;t need and that some sort of ersatz (cooperative) concurrency is good enough.<\/p>\n<p>Well, sorry, in my experience it&#8217;s just not. Maybe I&#8217;m atypically biased, because of my recent experience writing web crawlers, which have to parse pages as part of the job of finding new links to crawl. That&#8217;s a computationally complex task that in certain pathological cases can take indefinitely long. The solution is to run the parsing in a thread, and to kill that thread and proclaim the page unusable if it fails to parse in a reasonable amount of time.<\/p>\n<p>This only works with true preemptive threading. The parsing is taking place in some third-party library that&#8217;s stuck in a loop someplace. I don&#8217;t want to recode the parsing library and clutter it up with dozens of yield statements. I shouldn&#8217;t <em>have to<\/em> recode it. But absent genuine threads, there is no alternative.<\/p>\n<p>Maybe I&#8217;m being unfair here; maybe my experience with concurrency is highly unrepresentative. I don&#8217;t know, exactly. I can&#8217;t imagine I&#8217;m the <em>only<\/em> person who&#8217;s tried to make calls into a computationally complex library routine from a multithreaded program. So color me skeptical about the whole &#8220;ersatz threads are good enough&#8221; mindset.<\/p>\n<p>I&#8217;ll note that C# has <em>both<\/em> full preemptive threading <em>and<\/em> the ability to be compiled down to machine code (by default, it&#8217;s just byte code, but there is what the C# world calls &#8220;ahead of time&#8221; compilation, which is just what I described). And C# is not a Microsoft-only thing; there&#8217;s <a href=\"http:\/\/www.mono-project.com\/\">Mono<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been looking at the Go programming language recently, because (a) it&#8217;s started showing up a lot more in job descriptions, and (b) it combines the interesting attributes of both being compiled to machine language and being garbage-collected. Unfortunately, it also falls victim to what I regard as an unfortunate fad amongst programming language designers [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-2568","post","type-post","status-publish","format-standard","hentry","category-computers"],"_links":{"self":[{"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=\/wp\/v2\/posts\/2568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2568"}],"version-history":[{"count":0,"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=\/wp\/v2\/posts\/2568\/revisions"}],"wp:attachment":[{"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blackcap.name\/blog\/new\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}