{"id":3578,"date":"2011-09-09T22:36:50","date_gmt":"2011-09-10T05:36:50","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=3578"},"modified":"2012-04-13T19:15:47","modified_gmt":"2012-04-14T02:15:47","slug":"difficulty-building-software","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/difficulty-building-software\/","title":{"rendered":"What&#8217;s So Hard About Building?"},"content":{"rendered":"<p>I finally had a revelation as to why so building software can be so difficult&#8211; because <strong>build systems are typically built on programming languages that you don&#8217;t normally use<\/strong> in your day to day programming activities. If the project is simple enough, the build system usually takes care of the complexities. If there are subtle complexities &#8212; <em>and there always are<\/em> &#8212; then you have to figure out how to customize the build system to meet your needs.<\/p>\n<p>First, there&#8217;s the Makefile. It&#8217;s easy to forget that the syntax which comprises a Makefile pretty well qualifies as a programming language. I wonder if it&#8217;s Turing-complete? But writing and maintaining Makefiles manually is arduous and many systems have been created to generate Makefiles for you. At the end of the day, running &#8216;make&#8217; still requires the presence of a Makefile and in the worst case scenario, you&#8217;re going to have to inspect and debug what was automatically generated for that Makefile.<\/p>\n<p>So there is the widespread <a href=\"http:\/\/en.wikipedia.org\/wiki\/GNU_build_system\">GNU build system<\/a>, a.k.a., &#8220;the autotools&#8221;, named due to its principle components such as autoconf and automake. In this situation, you have no fewer than 3 distinct languages at work. You write your general build instructions using a set of <a href=\"http:\/\/en.wikipedia.org\/wiki\/M4_(computer_language)\">m4<\/a> macros (language #1). These get processed by the autotools in order to generate a shell script (language #2) called configure. When this is executed by the user, it eventually generates a Makefile (language #3).<\/p>\n<p>Over the years, a few challengers have attempted to dethrone autotools. One is <a href=\"http:\/\/www.cmake.org\/\">CMake<\/a> which configures a project using its own custom programming language that you will need to learn. Configuration generates a standard Makefile. So there are 2 languages involved in this approach. <\/p>\n<p>Another option is <a href=\"http:\/\/www.scons.org\/\">SCons<\/a>, which is Python-based, top to bottom. Only one programming language is involved in the build system; there&#8217;s no Makefile generated and run. Until I started writing this, I was guessing that the Python component generated a Makefile, but no.<\/p>\n<p>That actually makes SCons look fairly desirable, at least if your only metric when choosing a build system is to minimize friction against rarely-used programming languages.<\/p>\n<p>I should also make mention of a few others: <a href=\"http:\/\/ant.apache.org\/\">Apache Ant<\/a> is a build system in which the build process is described by an XML file. XML doesn&#8217;t qualify as a programming language (though that apparently <a href=\"http:\/\/realtech.burningbird.net\/web\/fun-stuff\/parable-languages\">doesn&#8217;t stop some people from using it as such<\/a>). I see there&#8217;s also <a href=\"http:\/\/doc.qt.nokia.com\/latest\/qmake-manual.html\">qmake<\/a>, related to the Qt system. This system uses its own custom syntax.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I realized that build systems cause me so much trouble because they tend to impose unusual programming language requirements on me<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-3578","post","type-post","status-publish","format-standard","hentry","category-programming"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/3578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=3578"}],"version-history":[{"count":6,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/3578\/revisions"}],"predecessor-version":[{"id":3787,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/3578\/revisions\/3787"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=3578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=3578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=3578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}