<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Transistorski&#039;s Blog</title>
	<atom:link href="http://transistorski.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://transistorski.wordpress.com</link>
	<description>Brain in a jar</description>
	<lastBuildDate>Wed, 05 Oct 2011 18:09:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='transistorski.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Transistorski&#039;s Blog</title>
		<link>http://transistorski.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://transistorski.wordpress.com/osd.xml" title="Transistorski&#039;s Blog" />
	<atom:link rel='hub' href='http://transistorski.wordpress.com/?pushpress=hub'/>
		<item>
		<title>A disassembler and Fare&#8217;s vision</title>
		<link>http://transistorski.wordpress.com/2010/07/08/a-disassembler-and-fares-vision/</link>
		<comments>http://transistorski.wordpress.com/2010/07/08/a-disassembler-and-fares-vision/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 00:25:57 +0000</pubDate>
		<dc:creator>transistorski</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://transistorski.wordpress.com/?p=58</guid>
		<description><![CDATA[I closed the last blog article with the remark that testing dasm3.py was hairy. This is owed to the fact that I tested dasm3.py against DEBUG.EXE, in itself a messy and inconsistent program that injects its own irritations into the &#8230; <a href="http://transistorski.wordpress.com/2010/07/08/a-disassembler-and-fares-vision/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transistorski.wordpress.com&amp;blog=14348196&amp;post=58&amp;subd=transistorski&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I closed the last <a href="http://transistorski.wordpress.com/2010/06/29/yet-another-8086-disassembler-pet-project/">blog article</a> with the remark that testing dasm3.py was hairy. This is owed to the fact that I tested dasm3.py against <code>DEBUG.EXE</code>, in itself a messy and inconsistent program that injects its own irritations into the infamously contrived 8086 architecture. dasm3.py is now a google-code project and can be found at <a href="http://code.google.com/p/dasm3/">http://code.google.com/p/dasm3/</a>. </p>
<p>The scope and ambition of dasm3.py is modest, but I believe that I lived up to an important vision of <a href="http://transistorski.wordpress.com/2010/06/26/better-computing-pipe-dreams-with-tunes/">Tunes</a> celebrity <a href="http://fare.tunes.org/">François-René (&#8220;Fare&#8221;) Rideau</a> that he expressed <a href="http://tunes.org/papers/WhyNewOS/WhyNewOS.html">here</a>. An important quote:</p>
<blockquote><p>
<a href="http://en.wikipedia.org/wiki/Literate_Programming">Literate Programming</a>, and <a href="http://www-cs-faculty.stanford.edu/~uno/">D.E. Knuth</a>&#8216;s attempts with WEB and C/WEB (see this interview of D.E. Knuth <a href="http://www.clbooks.com/nbb/knuth.html">http://www.clbooks.com/nbb/knuth.html</a>) are actually ways to pass more information about programs. To pass information that programming languages themselves don&#8217;t/can&#8217;t/can&#8217;t-efficiently pass, through well-organized human-readable documentation. This is A GOOD THING, because there will ALWAYS be things that humans can (already) express that machines cannot express (yet). But this is NOT THE PANACEA, because there ARE things that the machines ACTUALLY COULD express with high-level languages, that pure literate programming over low-level languages require the human to not only to write, but to check, when a computer is much better suited to check them. Knuth completely ignores the meta-capabilities of computers.
</p></blockquote>
<p>[<i>Emphasis in the original</i>]</p>
<p>The operative verbs here are &#8220;express&#8221; and &#8220;check&#8221;. Fare&#8217;s vision is that better programming languages </p>
<ul>
<li>can express and pass more meaning than current programming languages, thereby making their inner workings more transparent</li>
<li>facilitate proof of their correct functioning by formal methods</li>
</ul>
<p>dasm3.py is written in the conventional programming python, so I had to provide</p>
<ul>
<li>several wiki-pages for explaining how the program works, in order to instruct interested parties in text (as Fare suggests with &#8220;literate programming&#8221;)</li>
<li>an extra computer program to verify dasm3.py&#8217;s output</li>
</ul>
<p>In other words, since Fare&#8217;s vision of a sufficiently futuristic programming language is not here (&#8220;yet&#8221;), I had to go that extra mile and make a wiki- and test-prosthesis for dasm3.py. dasm3.py is not a literate program, but this is a superficial formality. Michael Heyeck, dasm3.py&#8217;s original author, did a good job in providing the literature for his program. I supplemented what I was missing when building on his work, in the hope that future programmers interested in dasm3.py don&#8217;t have to duplicate my head-scratching, experiments and research. For demonstrating dasm3.py&#8217;s correctness, I had to resort to old-fashioned test programs and explain how the tests work and why I believe they are convincing. (As for the lack of &#8220;literacy&#8221; of Michael Heyeck&#8217;s and my programming: I believe that literate programming is <i>extremely</i> hard for most cases; a wiki is much more fun and easy and almost as good. I will defend this thesis in a future blog article.)</p>
<p>The desired (but subtle) connection between literate programming and correctness did not escape Chris Lee, author of <a href="http://vasc.ri.cmu.edu/old_help/Programming/Literate/literate.html">Literate Programming &#8212; Propaganda and Tools</a>:</p>
<blockquote><p>
From a purist standpoint, a program could be considered a publishable-quality document that argues mathematically for its own correctness. A different approach is that a program could be a document that teaches programming to the reader through its own example. A more casual approach to literate programming would be that a program should be documented at least well enough that someone could maintain the code properly and make informed changes in a reasonable amount of time without direct help from the author.
</p></blockquote>
<p><strong>What could Fare&#8217;s future look like?</strong></p>
<p>In contrast to some other 8086 disassemblers on the internet, dasm3.py is largely data-driven. Most of dasm3.py&#8217;s reflection of the 8086&#8242;s instruction set is in the <a href="http://code.google.com/p/dasm3/source/browse/trunk/debug_exe_8086_table.txt">opcode sheet</a>. It could be even more data-driven, thereby making much of the dispatching, <code>if-elif</code> ladders and many of the <code>set</code>s of mnemonics and opcodes obsolete. This introduction of extra columns and values into the opcode table would expand the scope of a conventional opcode sheet, but it would work out nicely and make the actual code more compact. Note that, like all &#8220;data formats&#8221;, an opcode table is an elementary form of a <i><a href="http://en.wikipedia.org/wiki/Domain-specific_language">domain-specific language</a></i>.</p>
<p>The smart authors of the <a href="http://www.cs.tufts.edu/~nr/toolkit/">New Jersey machine code toolkit</a> have built a spiritual empire on this idea and developed a generic framework for implementing all sorts of assemblers and disassemblers for arbitrary CPUs. What would delight Fare is the newer experimental version programmed in ML &#8212; a language for expressing mathematical proofs. I have only a vague understanding how this magic works; I only skimmed the papers &#8212; that material is way out of my league. The overview of the project is exciting though, and I take it as evidence that the task of reflecting instruction sets one way or the other is an interesting field and a productive <a href="http://en.wikipedia.org/wiki/Drosophila_melanogaster#Model_organism_in_genetics">fruit fly</a> for testing and developing ideas on <i>domain-specific languages</i>, and can, by extension, even show the way to sufficiently &#8220;high-level&#8221; languages that Fare had in mind.</p>
<p>Have you ever invented a domain-specific language? Do you like the 8086 instruction set architecture? Have you ever written a literate program?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/transistorski.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/transistorski.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/transistorski.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/transistorski.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/transistorski.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/transistorski.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/transistorski.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/transistorski.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/transistorski.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/transistorski.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/transistorski.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/transistorski.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/transistorski.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/transistorski.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transistorski.wordpress.com&amp;blog=14348196&amp;post=58&amp;subd=transistorski&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transistorski.wordpress.com/2010/07/08/a-disassembler-and-fares-vision/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ea8509dec580560fdd39abfa5fe7ca9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">transistorski</media:title>
		</media:content>
	</item>
		<item>
		<title>Yet another 8086 disassembler pet project</title>
		<link>http://transistorski.wordpress.com/2010/06/29/yet-another-8086-disassembler-pet-project/</link>
		<comments>http://transistorski.wordpress.com/2010/06/29/yet-another-8086-disassembler-pet-project/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 17:49:33 +0000</pubDate>
		<dc:creator>transistorski</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://transistorski.wordpress.com/?p=25</guid>
		<description><![CDATA[Disclosure: I&#8217;m a so-so programmer. This can&#8217;t stop me, of course. In search of a pet project that has the Tunes nature but is modest in scope and amateur-friendly &#8230; I found this stimulating passage: Another important feature of Tunes &#8230; <a href="http://transistorski.wordpress.com/2010/06/29/yet-another-8086-disassembler-pet-project/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transistorski.wordpress.com&amp;blog=14348196&amp;post=25&amp;subd=transistorski&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Disclosure: I&#8217;m a so-so programmer. This can&#8217;t stop me, of course. In search of a pet project that</p>
<ul>
<li>has the <a href="http://transistorski.wordpress.com/2010/06/26/better-computing-pipe-dreams-with-tunes/">Tunes nature</a></li>
<li>but is modest in scope and amateur-friendly</li>
</ul>
<p>&#8230; I found this stimulating passage:</p>
<blockquote><p>Another important feature of Tunes is reflexivity. Consider the DOS emulator on Linux (or any such system) to start with: it &#8220;reflects&#8221; DOS under Linux, through the use of the Intel 386 Virtual mode. Now is Linux capable of running a Linux emulator, in other words of reflecting itself? It isn&#8217;t, because the Intel 386 Virtual mode is only capable of virtualizing (reflecting) real mode. It would be possible, however, to use a roundabout way, by writing an Intel 386 emulator, that is, reflecting the Intel chip under Linux, and then running Linux on that virtual Intel chip [...]</p></blockquote>
<p>[David Madore's <a href="http://www.madore.org/~david/computers/tunes.html">http://www.madore.org/~david/computers/tunes.html</a>.]</p>
<p>The prospect of writing an i386 emulator excited me pretty good. How hard can that be? In Common Lisp?</p>
<p>I blew a night over failed attempts to organize opcodes and had to reduce my ambition:</p>
<ul>
<li>start with the 8086 (no protected mode, 20bits)</li>
<li>write an opcode decoder first, make sure that it works before turning to simulation</li>
<li>look how the smart people have done this (i.e. find source code)</li>
</ul>
<p>The last point, looking at other people&#8217;s source code, was the hardest. As <a href="http://www.joelonsoftware.com/articles/fog0000000069.html">Joel Spolsky</a> observes, reading [understanding] source code is harder than writing it. </p>
<p>I could not find an 8086 opcode decoder written in Common Lisp, but it became clear that writing a disassembler was the way to go. After going that extra mile for attaching a &#8220;disassembly backend&#8221;, you can make sure that your decoder works by comparing the disassembly output to that of a trust-worthy other disassembler.</p>
<p>Smart people have written all sorts of disassemblers.</p>
<p>The first was the vintage program <code>DEBUG.EXE</code> (ca. 1980, still included in 32-bit Windows Vista distros). This 16-bit living fossil sports an <i>interactive disassembler</i>, to <a href="http://www.mlsite.net/blog/?p=52">aid debugging</a>. You type in an address or a small address range, and DEBUG.EXE shows you &#8220;source code&#8221;, i.e. disassembly of the raw bytes at, let&#8217;s say 18EF:0201 &#8211; 18EF:0240. This was Microsoft&#8217;s idea of an IDE in 1980, when <a href="http://www.youtube.com/watch?v=5CImrIKNmBo"><i>Funky Town</i></a> ruled the earth. A distinctive feature of DEBUG.EXE is its primitivity. It disassembles with the relentless stupor of a steam engine on tracks, even data. Invalid instructions cause a hick-up in form of &#8220;???&#8221;, but can&#8217;t seriously derail DEBUG.EXE.</p>
<p>All this is in contrast to <i>static disassembly</i>, for which the disassembler slurps, disassembles and dumps an entire program at once. This makes possible all sorts of analyses and conclusions about how the binary code is structured and behaves. In its most elaborate form, such a disassembler can identify procedures, identify and name symbolic labels, generate hyperlinked Web-pages of assembly source code, etc. An example for a good static open source disassembler is <code>ndisasm</code>, a utility in the Netwide Assembler project (<a href="http://www.nasm.us">http://www.nasm.us</a>). ndisasm can disassemble 32-bit and 64-bit opcodes, but also 16-bit.</p>
<p>It does not discover labels or do anything fancy, however. [For an example of what a fancy disassembler can do, look at this Z80-disassembly, a <a href="http://www.jupiter-ace.co.uk/romlisting.html">10,000 line bouncer</a> -- note the clickable labels].  </p>
<p>I considered both DEBUG.EXE and ndisasm as totally trustworthy.</p>
<ul>
<li>DEBUG.EXE due to its respectable length of service, plus I never heard complaints about it</li>
<li>ndisasm, because it is part of a successful open source project</li>
</ul>
<p>Both disassemblers can serve as good yard-sticks for how well other disassemblers work.</p>
<p>In terms of enlightenment for underground disassembler constructors, however, they are not very useful, because they are not easily accessible:</p>
<ul>
<li>DEBUG.EXE is a closed source program</li>
<li>ndisasm is big and scary</li>
</ul>
<p>Working with other people&#8217;s source code is hard enough, because other people&#8217;s source code is only marginally more comprehensible than raw opcodes. Many more industrial-strength disassemblers exist, but, like DEBUG.EXE and ndisasm, they are either too closed or too big for impatient hobbyists like me who<br />
want to steal and code code code.</p>
<p>I found a handful of pet 8086 disassemblers, in various programming languages:</p>
<ul>
<li><code><a href="http://gedmin.as/disasm/index-en.html">disasm.asm</a></code> is programmed in TASM 3.0 (no TASM, could not compile it)</li>
<li><code><a href="http://github.com/pcman86/disasm8086/blob/master/disasm.c">disasm.c</a></code> sort of works, but dies with a segfault half-way into a random bytes file</li>
<li><code><a href="http://http://gedmin.as/disasm/index-en.html">disasm.pas</a></code> is programmed in TurboPascal; it can process a 64k random bytes file without dying</li>
<li><code><a href="http://www.mlsite.net/blog/?s=disassembler">dasm3.py</a></code> is programmed in python, can process a 64k random bytes file without dying, and comes with links and an explanation how the program works and how data is organized (jackpot!)</li>
</ul>
<p>Of all those, Michael Heyeck&#8217;s dasm3&#8242;.py clearly is <i>the</i> choice for the inquisitive tinkerer:</p>
<ul>
<li>dasm3.py comes with explanations of how the program works</li>
<li>the author wrote it, because he needed it (retro-gaming)</li>
<li>python is fun and easy</li>
<li>did I mention that dasm3.py comes with explanations of how the program works?</li>
</ul>
<p>Marius Gedminas&#8217; disasm.asm is an impressive tour de force, but precisely for this reason not exactly a teaching aid if you want to find out what the domain is all about – the 8086 instruction set and opcodes. Reverse engineering an assembly language program in order to duplicate its function with a Common Lisp program is most certainly the scenic route here, but I preferred a less manly approach.</p>
<p>Marius Gedminas is also the author of disasm.pas, a <i>smart</i> disassembler that can mark unreachable code as data. disasm.pas follows jumps, calls and rets. With its 600 lines of TurboPascal code it is almost as compact as Michael Heyeck&#8217;s 300 lines of python in dasm3.py. </p>
<p>disasm.c consumes 1000 lines of code, but that&#8217;s about all I know about it. It seems to sort of work, but a segfault is a bad omen. There is no documentation whatsoever, but superficial browsing revealed that the author Kestutis Rutkauskas knew what he was doing in terms of C (despite an unusual coding convention).</p>
<p>So dasm3.py was an easy choice. For enlightenment I picked the most compact program, written in the softest, most dynamic language, the one that came with detailed instructions on how to understand that program. All this in the name of enlightenment, of course, to make stealing easy for the epic hobbyist. It is also the only disassembler on the pet project market that can process .EXE files.</p>
<p>Note that any disassembler, no matter how simple, has the <a href="http://transistorski.wordpress.com/2010/06/26/better-computing-pipe-dreams-with-tunes/">Tunes nature</a>. Disassembly is a very elementary form of reflection, you can&#8217;t go any deeper than that. A disassembler is the most basic (and hardest) form of recovering meaning from code. In Tunes, reflection makes the meaning of code accessible to compilers and programs and run-time, what facilitates insane optimizations and water-tight security. However, not only compilers and programs can benefit from access to code meaning. Programmers, too, can work insanely fast when they understand the code, i.e. if they have a mental map of their work. Michael Heyeck&#8217;s blog posts give you the fast track to his world of python disassembly:</p>
<ul>
<li><a href="http://www.mlsite.net/blog/?p=55">Part 1</a></li>
<li><a href="http://www.mlsite.net/blog/?p=57">Part 2</a></li>
<li><a href="http://www.mlsite.net/blog/?p=58">Part 3</a></li>
<li><a href="http://www.mlsite.net/blog/?p=60">Odds and ends</a></li>
</ul>
<p>[If you are interested in 8086 assembly, don't miss <i>8086 Opcode Redundancies <a href="http://www.mlsite.net/blog/?p=76">I</a> and <a href="http://www.mlsite.net/blog/?p=83">II</a></i>.]</p>
<p>The only fly in the ointment was lack of demonstration that dasm3.py works as advertised, so at first I didn&#8217;t know if it could serve as a reliable decoder foundation for my &#8220;own&#8221; homegrown 8086 emulator. Did dasm3.py work for all the edge cases which made my little head spin when I tinkered with my Common Lisp implementation?</p>
<p>As it turned out, dasm3.py worked almost perfectly out of the box. However, getting it <i>into</i> the box was quite an instructive pet project in its own right for a so-so programmer like me. It is a hairy problem, as I will illustrate in the next installments. [Tip of the hat to <a href="http://www.mlsite.net/blog/">Michael Heyeck</a>, for patient support.]</p>
<p>Does your pet project have the Tunes nature? Can you demonstrate that it works?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/transistorski.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/transistorski.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/transistorski.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/transistorski.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/transistorski.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/transistorski.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/transistorski.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/transistorski.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/transistorski.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/transistorski.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/transistorski.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/transistorski.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/transistorski.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/transistorski.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transistorski.wordpress.com&amp;blog=14348196&amp;post=25&amp;subd=transistorski&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transistorski.wordpress.com/2010/06/29/yet-another-8086-disassembler-pet-project/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ea8509dec580560fdd39abfa5fe7ca9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">transistorski</media:title>
		</media:content>
	</item>
		<item>
		<title>Better computing pipe-dreams with Tunes</title>
		<link>http://transistorski.wordpress.com/2010/06/26/better-computing-pipe-dreams-with-tunes/</link>
		<comments>http://transistorski.wordpress.com/2010/06/26/better-computing-pipe-dreams-with-tunes/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 15:00:05 +0000</pubDate>
		<dc:creator>transistorski</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://transistorski.wordpress.com/?p=5</guid>
		<description><![CDATA[the ambition Tunes is a revolutionary, better way of computing, what includes programming. Unfortunately, Tunes is pure vaporware. It exists only in rough sketches in the minds of the participants in the Tunes programme. It is not remarkable that this &#8230; <a href="http://transistorski.wordpress.com/2010/06/26/better-computing-pipe-dreams-with-tunes/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transistorski.wordpress.com&amp;blog=14348196&amp;post=5&amp;subd=transistorski&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>the ambition</strong><br />
<a href="http://tunes.org">Tunes</a> is a revolutionary, better way of computing, what includes programming. Unfortunately, Tunes is pure vaporware. It exists only in rough sketches in the minds of the participants in the Tunes programme. It is not remarkable that this discussion happened, it is remarkable that the participants tried to organized it, systematized it, and eloquently wrote about it &#8212; all in the  hope to turn their shared pipe-dream into reality. We all have pipe-dreams and discussion over the ultimate way of doing computing and, more importantly, programming. &#8220;Pipe-dream&#8221; suggests that such discourse is fueled by daydreaming and illegal intoxicants, but this is not necessarily so. Many people prefer such conversations of radically better ways of computing over lunch, over the one or other beer, or at a first date. </p>
<p>So there are many such collaborative pipe-dreams like the one at tunes.org going on, right now, as we speak,<br />
but in contrast to  those, Tunes.org is</p>
<ul>
<li>documented more diligently</li>
<li>with the aim of systematization</li>
<li>unboring, if you fit the fringe</li>
<li>in good taste</li>
</ul>
<p>The Tunes people are not cranks. They are computer scientists with a bold ambition. Many brought their academic life to the platform. </p>
<p>How does the ultimate way of computing and programming look like? The short answer is: we don&#8217;t know, because nobody had an opportunity to actually try it. There are many clues, however, and excellent results<br />
of countless experiments do exist. The Tunes lists many of them. The following portals are perhaps the most<br />
pornographic for computer futurists:</p>
<ul>
<li>operating systems:<a href="http://tunes.org/cliki/operating_20systems.html"> http://tunes.org/cliki/operating_20systems.html</a></li>
<li>programming languages: <a href="http://tunes.org/cliki/programming_20languages.html">http://tunes.org/cliki/programming_20languages.html</a></li>
<li>reflection <a href="http://tunes.org/cliki/methods_20of_20reflection.html">http://tunes.org/cliki/methods_20of_20reflection.html</a></li>
</ul>
<p>Commonplace is the observation that humanity is constantly frustrated with computers, because </p>
<ul>
<li>things are not automated enough</li>
<li>it is hard to get mental model of how things work</li>
<li>bugs</li>
<li>changing fashions</li>
<li>lack of integration</li>
<li>spam, reboots and bot-nets</li>
</ul>
<p>Perhaps you can name more. </p>
<p>The Tunes people&#8217;s critique of today&#8217;s computing includes</p>
<ul>
<li>
<a href="http://lists.tunes.org/archives/tunes/1999-January/001849.html">user interfaces</a>
</li>
<li>
<a href="http://lists.tunes.org/archives/tunes/2001-July/003171.html">programming languages</a>
</li>
<li>
<a href="http://lists.tunes.org/archives/tunes/1998-October/001507.html">unix and programming</a>
</li>
<li>
<a href="http://lists.tunes.org/archives/tunes/1995-January/000413.html">security</a>
</li>
</ul>
<p>As a programmer, you know that the status quo is the result of the survival of the fittest, and what &#8220;fittest&#8221; means here is this: </p>
<ul>
<li>the biggest crap (x86 ISA)</li>
<li>the most byzantine committee-standards (CORBA)</li>
<li>bloated programs (OpenOffice.org)</li>
<li>the wheel of reinvention (porting from COBOL to Turbo Pascal to dBase III to C++ to Java)</li>
<li>or worse, the curse of backward compatibility (again, x86 ISA, legacy apps without source code)</li>
</ul>
<p>As a programmer, you have opinions on how to fix this pile of coprolithic electronics and programming, of course, and you discuss them with other programmers. And why not? It is an excellent conversation topic, and becomes even more so when aided by alcohol. (For first dates not so much, by the way.)</p>
<p>The Tunes people have fleshed out many exciting and original theses, including:</p>
<ul>
<li>kernels are a bad idea altogether</li>
<li>computer programs must be proofs of their own correctness</li>
<li>orthogonal persistence makes you happy</li>
<li>put the garbage collector into the kernel (that does not actually even exist)</li>
</ul>
<p>The only unoriginal &#8220;concept&#8221; in Tunes is SPEED. Speed is <strong>unoriginal</strong>, because raw execution speed is the fetish requirement for all futuristic computing programmes. Nobody knows how truly good computing looks like, but everybody is sure it&#8217;d better ran darn fast. </p>
<p>In a word: Tunes is most interesting, and was an inspiration for many a blown night, often to the detriment of other, more productive activities like matching socks or sleeping.  </p>
<p>As an implementation, Tunes has not much to show for. Among the millions of futuristic computing programmes, however, Tunes is almost a generation ahead of the competition &#8212; 16 years and counting. Nowhere else on the web can you read such an energetic, informed and thoughtful discussion of how to provide for all of society&#8217;s revolutionary computing needs. Nowhere else have you such a treasure trove of links that sex you up pretty good if you are a(n) armchair computer progressive. This material can bring life into any discussion on the final OS revolution, the ultimate victory of sense and sensibility. Since the Tunes agenda is vast, here&#8217;s the reader&#8217;s digest version to bring you up to connoisseur level quickly.</p>
<p><strong>orthogonal persistence</strong><br />
There is no virtual memory in Tunes. The computer treats your entire magnetic memory as RAM. If you turn on your computer, it loads its precise persisted state from memory.</p>
<p><strong>virtual machines</strong><br />
The Tunes programme obsesses over virtual machines, because they are attractive pipe-dreams in their own right. Virtual machines relieve the programmer from the burden of cretinous architectures. It is where hardware, operating systems and programming languages are joined at the hip. The Forth programming language is featured prominently in Tunes, because it demonstrates this point beautifully, in very economical ways. After all, Forth abstracts away hardware and can be hardware, it serves as an operating system and a programming language. Java is known to cover exactly the same terrains and can be used in exactly the same way. However, Java is not even remotely as simple, comprehensible and economical as Forth. And not as powerful. </p>
<p><strong>Lisp</strong><br />
Lisp is not universally liked at Tunes, but all of the participants agree that it is better than most existing programming languages, and that it might be a good foundation for the revolution, before something better can be constructed. Other exotic programming language are frequently discussed, like <a href="http://en.wikipedia.org/wiki/Joy_%28programming_language%29">Joy</a>, <a href="http://en.wikipedia.org/wiki/Maude_system">Maude</a> and <a href="http://en.wikipedia.org/wiki/Slate_programming_language">Slate</a>.  </p>
<p><strong>reflection and the anti-kernel</strong><br />
The central topic in Tunes is _reflection_, ultimately a programming topic. Tunes programs know a lot about themselves and their components. From this virtue come good things, like insanely optimal optimizations and elimination of kernel technology. Those Tunes programs are supposed to run darn fast,  after all. The virtue of introspection has many shapes and faces in Tunes. It is closely related to meta-programming<br />
(program generation) and domain-specific languages. The desire for reflective programs explains the Tunes people&#8217;s crush on exotic programming languages like Lisp, Forth and Maude. </p>
<ul>
<li>Forth is a reflective language, despite the fact that it is extremely low-level.</li>
<li>Lisp is not known for reflexivity today, although it is easy to add reflective features. The Lisp machine, for example, was the most reflective platform ever, where all components &#8211; down to a single button or the caption on it &#8211; were accessible and reprogrammable at run-time, with a click of the mouse. Tunes people like the Lisp machine a lot. Tunes celebrity Francois-Rene Rideau even bought one for himself in 2000 and blogged about it: <a href="http://fare.tunes.org/LispM.html">Buying a Lisp machine in Y2K</a>.
</li>
<li>Maude is an obscure language, here is an overview in wikipedia: <a href="http://en.wikipedia.org/wiki/Maude_system">http://en.wikipedia.org/wiki/Maude_system</a>. Based on reflection and metaprogramming &#8212; it definitely has the Tunes nature. Part of the vision is to write a reflective kernel in something like a better Maude.
</li>
<p>Based on these desires &#8211; orthogonal persistence, no kernel and ultra-high-level programming &#8211; <a href="http://www.madore.org/~david/computers/tunes.html">David Madore</a> explains that working with Tunes will resemble working with a <a href="http://en.wikipedia.org/wiki/HP-28_series">HP28-48</a> programmable calculator, albeit on a much grander scale. </p>
<p>As you see, Tunes is not about a conventional revolutionary computing  future. It is decidedly not about new micro-kernel technology, but about new programming languages technology. An example of what Tunes is <strong>not</strong> can be found behind this link, describing an early attempt to ground Tunes in a a run-off-the-mill computing revolution: <a href="http://lists.tunes.org/archives/tunes/1994-October/000001.html">http://lists.tunes.org/archives/tunes/1994-October/000001.html</a>. </p>
<p>PIOS, as it was called, wanted to build a better unix, but the initiative was short-lived:</p>
<ul>
<li>high-performance</li>
<li>microkernel</li>
<li>application-centric</li>
</ul>
<p>Tunes is very different, that is, more interesting. </p>
<p>If this brief overview of Tunes has made you horny, the best starting point is David Madore&#8217;s accessible and lightly written primer: <a href="http://www.madore.org/~david/computers/tunes.html">http://www.madore.org/~david/computers/tunes.html</a>.</p>
<p>Less accessible, but eloquently and amusingly written, is &#8216;<a href="http://tunes.org/cliki/trotskyite_20tunes.html">Trotskyist Tunes</a>&#8216;.</p>
<p>The deepest and most serious explanation is François-René Rideau&#8217;s<a href="http://tunes.org/papers/WhyNewOS/WhyNewOS.html">original <i>Tunes</i> manifesto</a>.</p>
<p>And Tunes comes with a <a href="http://tunes.org/Tunes-FAQ.html">FAQ</a> and a <a href="http://lists.tunes.org/archives/tunes/">mailing list archive</a>, of course. </p>
<p>How do your pipe-dreams of the computing revolution look like? Do your fantasies have the Tunes nature?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/transistorski.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/transistorski.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/transistorski.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/transistorski.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/transistorski.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/transistorski.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/transistorski.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/transistorski.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/transistorski.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/transistorski.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/transistorski.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/transistorski.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/transistorski.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/transistorski.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transistorski.wordpress.com&amp;blog=14348196&amp;post=5&amp;subd=transistorski&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transistorski.wordpress.com/2010/06/26/better-computing-pipe-dreams-with-tunes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ea8509dec580560fdd39abfa5fe7ca9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">transistorski</media:title>
		</media:content>
	</item>
	</channel>
</rss>
