{"id":2697,"date":"2013-09-15T12:41:17","date_gmt":"2013-09-15T10:41:17","guid":{"rendered":"http:\/\/www.kameli.net\/marq\/?p=2697"},"modified":"2013-09-15T14:09:34","modified_gmt":"2013-09-15T12:09:34","slug":"msx-programming-languages-fight","status":"publish","type":"post","link":"http:\/\/www.kameli.net\/marq\/?p=2697","title":{"rendered":"MSX Programming Languages \u2013 Fight!"},"content":{"rendered":"<p>Here are some preliminary results from a compiler\/interpreter test, where we pitted different MSX compilers and cross-compilers against each other. The test was a simple integer addition loop. Here&#8217;s the Pascal version for a reference:<\/p>\n<pre>Program Bensmark;\r\n\r\nVar\r\n   i,j,s:Integer;\r\n\r\nBegin\r\n     s:=0;\r\n\r\n     For i:=1 To 10000 Do\r\n        For j:=1 To 100 Do\r\n           s:=s+1;\r\n\r\n     Writeln(s);\r\nEnd.<\/pre>\n<p>The snippet tests mostly loops, so the results can&#8217;t be generalized for all sorts of purposes. Anyway, here comes the list with execution times in seconds, arranged from fastest to slowest:<\/p>\n<ol>\n<li>Mildly unrolled assembly: <strong>4<\/strong><\/li>\n<li>Trivial assembly implementation: <strong>8<\/strong><\/li>\n<li>SDCC C cross-compiler 2.9.0: <strong>13<\/strong><\/li>\n<li>MSX-C 1.20: <strong>44<\/strong> \u2013 <em>painfully slow compilation<\/em><\/li>\n<li>X-BASIC: <strong>47<\/strong><\/li>\n<li>Turbo Pascal: <strong>62<\/strong> \u2013 <em>quick compilation<\/em><\/li>\n<li>z88dk C cross-compiler: <strong>86<\/strong><\/li>\n<li>Hisoft C 1.35: <strong>154<\/strong><\/li>\n<li>Hisoft Pascal: <strong>880<\/strong> \u2013 <em>extrapolated from a shorter loop<\/em><\/li>\n<li>MSX-BASIC: <strong>2500<\/strong> \u2013 <em>extrapolated from a shorter loop<\/em><\/li>\n<\/ol>\n<p>Some big surpises there, actually. I expected a lot better performance from <em>z88dk<\/em> and <em>Hisoft C<\/em>, but they lost even to the ancient <em>Turbo Pascal<\/em>. <em>TP<\/em> got a big plus for its swift compilation time, too. <em>X-BASIC<\/em> went on to show that BASIC doesn&#8217;t need to be slow at all. In spite of its problems and somewhat modest code generation, <em>SDCC<\/em> easily took the crown of compiled high-level languages here.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here are some preliminary results from a compiler\/interpreter test, where we pitted different MSX compilers and cross-compilers against each other. The test was a simple integer addition loop. Here&#8217;s the Pascal version for a reference: Program Bensmark; Var i,j,s:Integer; Begin s:=0; For i:=1 To 10000 Do For j:=1 To 100 Do s:=s+1; Writeln(s); End. The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,15,24],"tags":[],"class_list":["post-2697","post","type-post","status-publish","format-standard","hentry","category-koodi","category-retro","category-softat"],"_links":{"self":[{"href":"http:\/\/www.kameli.net\/marq\/index.php?rest_route=\/wp\/v2\/posts\/2697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.kameli.net\/marq\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.kameli.net\/marq\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.kameli.net\/marq\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.kameli.net\/marq\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2697"}],"version-history":[{"count":3,"href":"http:\/\/www.kameli.net\/marq\/index.php?rest_route=\/wp\/v2\/posts\/2697\/revisions"}],"predecessor-version":[{"id":2700,"href":"http:\/\/www.kameli.net\/marq\/index.php?rest_route=\/wp\/v2\/posts\/2697\/revisions\/2700"}],"wp:attachment":[{"href":"http:\/\/www.kameli.net\/marq\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.kameli.net\/marq\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2697"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.kameli.net\/marq\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}