<?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>Vrrm Development</title>
	<atom:link href="http://vrrm.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://vrrm.wordpress.com</link>
	<description>Building an architecture for pervaisive autonomics</description>
	<lastBuildDate>Thu, 04 Jun 2009 16:12:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='vrrm.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Vrrm Development</title>
		<link>http://vrrm.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://vrrm.wordpress.com/osd.xml" title="Vrrm Development" />
	<atom:link rel='hub' href='http://vrrm.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Program specified GC and memory management in high level languages</title>
		<link>http://vrrm.wordpress.com/2009/06/04/program-specified-gc-and-memory-management-in-high-level-languages/</link>
		<comments>http://vrrm.wordpress.com/2009/06/04/program-specified-gc-and-memory-management-in-high-level-languages/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 16:12:18 +0000</pubDate>
		<dc:creator>whpearson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vrrm.wordpress.com/?p=77</guid>
		<description><![CDATA[I want to have a language where I am able to specify low level aspects of the system (among other things), things like how much stack is allocated and how heap memory management works. I am a programming language dilettante, so I have much to learn. However I also think functional languages are a good [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=77&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I want to have a language where I am able to specify low level aspects of the system (among other things), things like how much stack is allocated and how heap memory management works. I am a programming language dilettante, so I have much to learn.</p>
<p>However I also think functional languages are a good thing, and I don&#8217;t want to give up the simplicity of programming it affords. So I had the idea of making constructors and normal function scope syntactic sugar for functions. We need low level memory functions to do these tasks. </p>
<p>So we&#8217;d have special functions like</p>
<p><code><br />
!unsafeAlloc :: Int -&gt; Scope -&gt; Block<br />
</code><br />
<code><br />
!unsafeAddRef ::  Block -&gt; Scope -&gt; ()<br />
</code><br />
<code><br />
!unsafeDeref :: Block -&gt; Scope -&gt; ()<br />
</code></p>
<p>Which all programs would be expected to specify, although there will be system calls they can just assign them to if they want.</p>
<p>The ! meaning that garbage collection is not used on this function. Defining constructors would also create a non memory managed variant with the block of memory used for the construction as the last .</p>
<p>So assuming a Data like the archetypal Natural with an S constructor</p>
<p><code><br />
h = S n<br />
</code><br />
would be syntactic sugar for</p>
<p><code><br />
h = !S n (!unsafeAlloc (size S) currentScope)<br />
</code></p>
<p>unsafeAlloc should add a reference to the currentScope as well.</p>
<p>Scopes would also be syntactic sugar. They would require setting up the scope object at the beginning of the function and mapping <code>unsafeDeref</code> over all the blocks when the scope was closed. Ordering would be done by means of the scope monad. So something along the lines of</p>
<p><code> do<br />
  currentScope &lt;- newScope;<br />
  ---- code here---<br />
  !fmap (unsafeDeref) currentScope;<br />
  destruct currentScope<br />
</code></p>
<p>In fact the memory manager should really be a monad to keep it pure, as all requests might not be granted. However making it all monadic code would restrict the ability to reorder functions for parallel code.</p>
<p>I&#8217;m sure that there are probably a few gotchas that I am not seeing and my thinking is still a bit muddled, but that is the core of the idea.</p>
<p>Are there any simple haskell/ML ish languages I could play around with to see how memory management works there? </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vrrm.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vrrm.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vrrm.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vrrm.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vrrm.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vrrm.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vrrm.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vrrm.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vrrm.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vrrm.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vrrm.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vrrm.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vrrm.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vrrm.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=77&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vrrm.wordpress.com/2009/06/04/program-specified-gc-and-memory-management-in-high-level-languages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a140544585e3b5dc9b7e43ce21eafd1b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">whpearson</media:title>
		</media:content>
	</item>
		<item>
		<title>Unbounded Graphs2</title>
		<link>http://vrrm.wordpress.com/2009/03/03/unbounded-graphs2/</link>
		<comments>http://vrrm.wordpress.com/2009/03/03/unbounded-graphs2/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 00:42:09 +0000</pubDate>
		<dc:creator>whpearson</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[haskell graphs]]></category>

		<guid isPermaLink="false">http://vrrm.wordpress.com/2009/03/03/unbounded-graphs2/</guid>
		<description><![CDATA[Just a quicky, I found a function that returns nice breadth first orderings of the graphs. gIterate2 :: (b -&#62; [b]) -&#62; [b] -&#62; [[b]] gIterate2 f xs = iterate (concat. map f) xs You can even avoid cycles by making the Data type a tuple with a set and then using a function like [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=66&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just a quicky, I found a function that returns nice breadth first orderings of the graphs.</p>
<p>gIterate2 :: (b -&gt; [b]) -&gt; [b] -&gt; [[b]]<br />
gIterate2 f xs = iterate (concat. map f) xs</p>
<p>You can even avoid cycles by making the Data type a tuple with a set and then using a function like the following</p>
<p> take 4 $ gIterate2 (\(x,y) -&gt; if member x y then [] else ((x+1), insert x y):[(x-1, insert x y )]) [(1, empty)]</p>
<p>This gets a list of all the nodes 4 iterations away from the original. It does have some limitations compared to the way I did it yesterday in that it can&#8217;t return a different type (due to the use of iterate). You can get around this somewhat by using a tuple again with a dummy return value placed in.</p>
<p>Edit from here for added value.</p>
<p>Now that isn&#8217;t very pretty lets define a function noRepeat that you can apply to any function a -&gt; [a] to filter out repeats</p>
<p>noRepeat :: (Ord t) =&gt; (t -&gt; [a]) -&gt; (t, Set t) -&gt; [(a, Set t)]<br />
noRepeat f (x,y) = if member x y then [] else zip (f x) (repeat (insert x y))</p>
<p>The basic type is  (a -&gt; [a]) -&gt; b -&gt; [b] </p>
<p>Let us call this a function transformer. Now the basic output from that is pretty ugly</p>
<p>take 5 $ gIterate2 (noRepeat (\x -&gt; (x+1):[(x-1)])) [(1, empty)]        </p>
<p>[[(1,fromList [])],[(2,fromList [1]),(0,fromList [1])],[(3,fromList [1,2]),(1,fromList [1,2]),(1,fromList [0,1]),(-1,fromList [0,1])],[(4,fromList [1,2,3]),(2,fromList [1,2,3]),(0,fromList [-1,0,1]),(-2,fromList [-1,0,1])],[(5,fromList [1,2,3,4]),(3,fromList [1,2,3,4]),(-1,fromList [-2,-1,0,1]),(-3,fromList [-2,-1,0,1])]]</p>
<p>So what can we do? Well if we map (map fst) on it we can get back just the list of nodes. We&#8217;ll call the fst the &#8220;detransformer&#8221; of noRepeat.</p>
<p>So lets create a data type </p>
<p>data TransTriple  m a b = Dere {getInit :: a -&gt; b,  getTransform :: (a-&gt; m a) -&gt; (b -&gt; m b), getDetrans:: b -&gt; a}   </p>
<p>This defines a way to initialise the change, a way to transform the step function given normally and a way to get back to the original value.</p>
<p>gtransformIter pair f xs = Prelude.map (Prelude.map (getDetrans pair)) $ gIterate2 (getTransform pair$ f)  (Prelude.map (getInit pair) xs)</p>
<p>We define a  new function to take all of these and apply them properly to gIterate2.</p>
<p>a `comp` b = Dere (\x -&gt; getInit a $ getInit b$ x  ) (\x -&gt; getTransform a $ getTransform b$ x  )  (\x -&gt;  getDetrans b $ getDetrans a $ x)   </p>
<p>Why do we do this? So we can compose them together. `comp` acts as (.) but for all the functions in the right order. It is not very pretty at the moment.</p>
<p>So let us define a couple of transformer triples.</p>
<p>noRepeat f (x,y) = if member x y then [] else zip (f x) (repeat (insert x y))</p>
<p>stopWhen cond f x = if cond x then [] else f x</p>
<p>noRepeatTriple = Dere (\x -&gt; (x, empty)) (noRepeat) fst</p>
<p>notFiveTriple = Dere id (stopWhen(==5)) id</p>
<p>So you can now call something like </p>
<p>gtransformIter (noRepeatTriple `comp` notFiveTriple) (\x -&gt; (x+1):[(x-1)]) [1]</p>
<p>And it spit out a pure list of numbers, ignoring any branches that get to 5 or any that start to cycle.</p>
<p>I&#8217;ll try and do a simple game search next time using this framework.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vrrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vrrm.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vrrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vrrm.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vrrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vrrm.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vrrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vrrm.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vrrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vrrm.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vrrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vrrm.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vrrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vrrm.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=66&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vrrm.wordpress.com/2009/03/03/unbounded-graphs2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a140544585e3b5dc9b7e43ce21eafd1b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">whpearson</media:title>
		</media:content>
	</item>
		<item>
		<title>Unbounded Graphs 1</title>
		<link>http://vrrm.wordpress.com/2009/03/01/unbounded-graphs1/</link>
		<comments>http://vrrm.wordpress.com/2009/03/01/unbounded-graphs1/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 20:42:46 +0000</pubDate>
		<dc:creator>whpearson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vrrm.wordpress.com/?p=60</guid>
		<description><![CDATA[I&#8217;m probably reinventing the wheel here, but I haven&#8217;t come across this elsewhere. I came across an idea whilst working on Traces, unbounded graphs (I could say infinite, but I am something of a constructionist). An unbounded graph is a graph defined by a function adjacentNodes :: a -&#62; [a] The function adjacentNodes could for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=60&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m probably reinventing the wheel here, but I haven&#8217;t come across this elsewhere.</p>
<p>I came across an idea whilst working on Traces, unbounded graphs (I could say infinite, but I am something of a constructionist).</p>
<p>An unbounded graph is a graph defined by a function<br />
<code></p>
<pre>
adjacentNodes :: a -&gt; [a]
</pre>
<p></code></p>
<p>The function adjacentNodes could for example create every possible legal game move from the current position, run every possible lsystem rule on the string or find all legal one step permutations of Trace (some of these generate Trees but the method I am applying here is fairly universal). There is also scope for creating strings out of grammars in general.   </p>
<p>So lets say you want to find out a property of your graph. Whether in a Trace a certain substring can occur, for example. Or whether there is a strategy to guarantee a win in a small game.</p>
<p>To generate every node in the unbounded graph you just generate a list of those nodes and append a list of those nodes with iterate applied recursively. Warning unbounded lists created! Also code not thoroughly tested.</p>
<p><code></p>
<pre>

&gt; import Data.List as List
&gt; import Data.Set as Set
&gt; import Data.Monoid
&gt; gIterate :: (a -&gt; [a]) -&gt; a -&gt; [a]
&gt; gIterate nextNodes start = nextList ++  (List.concat $ List.map (gIterate (nextNodes)) nextList)
&gt;                               where nextList = nextNodes start

</code>
</pre>
<p>You can get back to iterate simply by doing<br />
<code></p>
<pre>
 take 10 (mIterate (\a -&gt; [a]) '!')
</pre>
<p></code></p>
<p>iterate is just creating a unbounded graph where there is only one possible adjacent node! Now iterating through a graph with mulitple options is a bot more interesting then the flat graphs done by iterate. So you might choose to ignore some edges, for example those you have visited before.</p>
<p><code></p>
<pre>

&gt; gIterateNoCycles :: (Ord a, Eq a) =&gt; (a -&gt; [a]) -&gt; Set a -&gt; a -&gt; [a]
&gt; gIterateNoCycles nextNodes visited start = nextList ++  (List.concat $ List.map (gIterateNoCycles (nextNodes) visited') nextList)
&gt;                                         where nextList = List.filter (\a -&gt; member a visited) $ nextNodes start
&gt;                                               visited' = Set.insert start visited  
</pre>
<p></code></p>
<p>Or those that fail some predicate, a heuristic or the end of the game.<br />
<code></p>
<pre>

&gt; gFilteredIterate :: (Ord a, Eq a) =&gt; (a -&gt; [a]) -&gt; (a -&gt; Bool) -&gt; a -&gt; [a]
&gt; gFilteredIterate nextNodes filt start = nextList ++  (List.concat $ List.map (gFilteredIterate (nextNodes) filt) nextList)
&gt;                                         where nextList = List.filter (filt) $ nextNodes start
&gt; 
</pre>
<p></code></p>
<p>However all this (++) is not always ideal, lets generalise it somewhat.  </p>
<p>&gt; gfoldMap :: Monoid b =&gt;  (a -&gt; [a]) -&gt;  (a -&gt; b) -&gt; a -&gt; b<br />
&gt; gfoldMap nextNodes transform start = mconcat (List.map (transform) (nextList))  `mappend`  (mconcat $ List.map (gfoldMap (nextNodes) (transform)) nextList)<br />
&gt;                               where nextList = nextNodes start</p>
<p>This allows you to use the Any monoid if you just want to find if one of the Nodes satisfies a predicate, or the First monoid to look for one value. However it does mean that you can no longer specify how far to search with the (take n) trick, unless you specify transform to be something that returns a list. So you would probably want to use one of the variants above, or specify a number to go with it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vrrm.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vrrm.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vrrm.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vrrm.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vrrm.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vrrm.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vrrm.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vrrm.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vrrm.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vrrm.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vrrm.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vrrm.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vrrm.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vrrm.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=60&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vrrm.wordpress.com/2009/03/01/unbounded-graphs1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a140544585e3b5dc9b7e43ce21eafd1b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">whpearson</media:title>
		</media:content>
	</item>
		<item>
		<title>Why I am building what I am building</title>
		<link>http://vrrm.wordpress.com/2009/02/25/why-build/</link>
		<comments>http://vrrm.wordpress.com/2009/02/25/why-build/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 23:09:22 +0000</pubDate>
		<dc:creator>whpearson</dc:creator>
				<category><![CDATA[Overview]]></category>
		<category><![CDATA[Agoric]]></category>
		<category><![CDATA[Autonomic]]></category>

		<guid isPermaLink="false">http://vrrm.wordpress.com/?p=52</guid>
		<description><![CDATA[There are a number of things that aren&#8217;t quite right with computer systems today that can&#8217;t be fixed by throwing more processing power into the machine or creating a new language built upon the current foundations. These are problems to do with the maintenance of the system, updating it and keeping it virus free. These [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=52&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are a number of things that aren&#8217;t quite right with computer systems today that can&#8217;t be fixed by throwing more processing power into the machine or creating a new language built upon the current foundations.</p>
<p>These are problems to do with the maintenance of the system, updating it and keeping it virus free. These problems can be seen starkly when looking at autonomous systems, that don&#8217;t have programmers/engineers dedicated to improving the system. I consider fixing these problems as a precursor project to getting flexible, adaptable AIs. </p>
<p>The problems stem from the fact that computers were invented by mathematicians, and them considering computers as abstract computational machines guided by the benevolent programmer. Which is not a good abstraction for todays world with fairly widespread malware, with the computers looked after by people fairly ignorant of its inner workings (or just time constrained). </p>
<p>So something needs to change, and I think at a fairly fundamental level. But revolution is hard, so it should be done right to minimize the number of times revolution has to occur. </p>
<p>These problems boil down to one major point: A programs ability to acquire resources should be aligned with its usefulness. A virus is negatively useful and should get no resources (no memory/processing time), a scheduler is useful so should be get some resources, if a better scheduler comes into a computer system it should also be able to acquire resources. </p>
<p>By resources I mean things like the following:</p>
<p>Memory Usage &#8211; Both Heap and Stack. A good program should be able to ask for and get what it needs. Also memory bandwidth shouldn&#8217;t be able to be monopolized for free.<br />
Harddisk Usage/Memory bandwidth.<br />
System Resources &#8211; E.g Things like threads IDs if they are a limited resource.<br />
Interrupts &#8211; Which programs should get activated when a timer or input interrupt goes off.<br />
Controlling Network/video/sound.</p>
<p>This all sounds like a welter of variety. So to try and make things uniform in the way in posix that everything is a file, every resource in my system is a sort of <a href="http://en.wikipedia.org/wiki/Capability-based_addressing">capability</a>. A capability in my system can be thought of as an unforgeable/unalterable/revocable pointer.</p>
<p>So for example if a process got control of an interrupt it would be given a special executable capability, that when called would take a capability in a register as a the capability to call when the interrupt fired. Programs are given capabilities for memory chunks as well, which they can assign to be used as stack or used as heap.</p>
<p>Now I haven&#8217;t explained how the system get the capabilities. Just assume for a moment it is a form of <a href="http://www.agorics.com/Library/agoricpapers.html">agoric</a> bidding.</p>
<p>The answer to the question why I am building anything at all, is that I want to understand what a human brain is (so computational systems that are self-maintaining are important to build and understand), and I want to make the cost of living cheaper.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vrrm.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vrrm.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vrrm.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vrrm.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vrrm.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vrrm.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vrrm.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vrrm.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vrrm.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vrrm.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vrrm.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vrrm.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vrrm.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vrrm.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=52&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vrrm.wordpress.com/2009/02/25/why-build/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a140544585e3b5dc9b7e43ce21eafd1b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">whpearson</media:title>
		</media:content>
	</item>
		<item>
		<title>Traces &#8211; less ordered strings (part 1)</title>
		<link>http://vrrm.wordpress.com/2009/02/25/tracespart-1/</link>
		<comments>http://vrrm.wordpress.com/2009/02/25/tracespart-1/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 12:40:07 +0000</pubDate>
		<dc:creator>whpearson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[monoid]]></category>
		<category><![CDATA[traces]]></category>

		<guid isPermaLink="false">http://vrrm.wordpress.com/?p=42</guid>
		<description><![CDATA[I decided to read about Traces. I&#8217;m going to tell you I learnt to try and cement the ideas in my mind. First off, strings have two more monoid natures! It is on the removal of the first occurrence of string a from string b from the left or right. Both the monoid natures have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=42&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I decided to read about <a href="http://en.wikipedia.org/wiki/Trace_monoid">Traces</a>. I&#8217;m going to tell you I learnt to try and cement the ideas in my mind.</p>
<p>First off, strings have two more monoid natures! It is on the removal of the first occurrence of string a from string b from the left or right. Both the monoid natures have the empty string as the mempty.</p>
<p>So <code> remR "cabcabac" "ab" </code> would be &#8220;cabcac&#8221; whereas <code> remL "cabcabac" "ab" </code> would be &#8220;ccabac&#8221;. Removal of a string that isn&#8217;t contained leads to no change. This is called the quotient monoid I think, I still don&#8217;t have the terminology down.</p>
<p>Traces are strings when you don&#8217;t care about some ordering in them. Something like the following untested bit of code<br />
<code>
<pre>
class (ListLike a, Enum a, Bounded a, Eq a) =&gt;Trace a where
   swappablePairs :: Set (a,a)
   swappablePairs = difference (cross [minBound..maxBound] [minBound..maxBound])  unswappablePairs
   unswappablePairs :: Set (a,a)
   unswappablePairs = difference (cross [minBound..maxBound] [minBound..maxBound])  swappablePairs
   traceEq :: Trace a  -&gt; Trace a -&gt; Bool
</pre>
<p> </code></p>
<p>Note when I say (a,c) is swappable I also mean (c,a) is swappable.</p>
<p>So an example of a trace applied somewhat to seeing what  a processor is doing. Lets say we have two cores that share a bit of memory they are working on. The symbols <i>a</i> and <i>b</i> represent each process acting on the  shared memory, also (a,b) and (b,a) is swappable. So let us define another pair of operations that represent the cores handing off to each other c is core 1 handing to core 2 and d is core 2 to core 1. So (a,c) is unswappable as you can&#8217;t move operations before or after blocking and so is (b,d). (c,d)  is also unswappable. e is nothing interesting going on and is swapabble with anything.</p>
<p>So a trace &#8220;aeeeeb&#8221; should be traceEq to &#8220;eeeeab&#8221; that is both cores writing to shared memory with no hand off, which is bad. &#8220;aaeeceeebbbeeda&#8221; is traceEq to &#8220;eeeeeacbda&#8221;, which is fine as there are the proper hand offs between &#8216;a&#8217;s and &#8216;b&#8217;s. This doesn&#8217;t seem so useful at the moment, although I think things get more interesting when you have two different bits of shared memory that can interleave.</p>
<p>The way I&#8217;m guessing it is used in process calculi is that you generate grammars for the processes and then see if the space of all possible strings on the language contains sequences traceEq to things you don&#8217;t want e.g. a and b next door to each others or an infinite sequence of hand offs with no processing. Quite how to do that I am unsure&#8230;.</p>
<p>Are they useful for what I want to do? Possibly, I think I will give people the option of specifying a writer or something similar to go a long and build up traces or something, by processing the current Vrrm state and assigning it a symbol. Ideally there should be some way of discovering the grammar as well&#8230; though I am not sure how to do this, although it might be easy(ish) if the symbol assignment process doesn&#8217;t hide state. </p>
<p>Next time I&#8217;ll try to implement instances of  traceEq, and make sure my implementation of Trace is actually sane.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vrrm.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vrrm.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vrrm.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vrrm.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vrrm.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vrrm.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vrrm.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vrrm.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vrrm.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vrrm.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vrrm.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vrrm.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vrrm.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vrrm.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=42&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vrrm.wordpress.com/2009/02/25/tracespart-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a140544585e3b5dc9b7e43ce21eafd1b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">whpearson</media:title>
		</media:content>
	</item>
		<item>
		<title>Struggling with the type system</title>
		<link>http://vrrm.wordpress.com/2009/02/24/struggling-with-types/</link>
		<comments>http://vrrm.wordpress.com/2009/02/24/struggling-with-types/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 23:53:25 +0000</pubDate>
		<dc:creator>whpearson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[haskell]]></category>

		<guid isPermaLink="false">http://vrrm.wordpress.com/?p=37</guid>
		<description><![CDATA[As you can read from my previous blog I want to make VrrmDiffLists monoids. However it would also make sense to make them lists. Lists already have a monoid instance (++) and (mempty), and you can&#8217;t currently give them a new one. So what to do? You can newtype them, but then you are always [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=37&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As you can read from my <a href="../24/edsl-for-debugging-in-haskell-and-diffs/">previous blog</a> I want to make VrrmDiffLists monoids.</p>
<p>However it would also make sense to make them lists. Lists already have a monoid instance (++) and (mempty), and you can&#8217;t currently give them a new one. So what to do? </p>
<p>You can newtype them, but then you are always wrapping and unwrapping the values to do things with them. Which is less than ideal. Strictly speaking the lists are still lists, and you should be able to do listy things with them.</p>
<p>With the Num wrappers like Sum and Product things aren&#8217;t too bad as Num is a typeclass and you can just instantiate it easily or automatically derive it. Lists aren&#8217;t currently typeclasses, and while they <a href="http://software.complete.org/software/projects/show/listlike">have been made</a> you still can&#8217;t use the common list operators on them, or use them in places where people have defined their libraries to use lists.</p>
<p>So the other option is to rework monoids so I can keep lists as lists.</p>
<p>This is my current way forward. The monoid nature data class is supposed to indicate monoidness of a class (although it could quite easily be a type (a, a-&gt;a-&gt;a) and use snd and fst to get at the members of the tuple). A DMonoid is a way of typeclassing a new class so you can still use all the monoids stuff. Ideally we would go back and change such things as Writers/Foldables to use monoid natures instead of relying on dmonoids. </p>
<p><code>
<pre>
data MonoidOver a = MO { getMempty :: a, getMappend :: a-&gt;a-&gt;a }
class  DMonoid a  where
    defaultMonoidOver :: MonoidOver a 

instance (DMonoid a) =&gt; Monoid a where
   mempty = getMempty defaultMonoidOver
   mappend = getMappend defaultMonoidOver

dmconcat dm = foldr (getMappend dm) (getMempty dm)
</pre>
<p></code></p>
<p>This kinda works, but I tried to implement a monad instance of a derived Writer, and got stuck trying to get mempty.</p>
<p>So this isn&#8217;t an elegant solution worth investing time in. Do we need a change to the type system? I&#8217;m sure such things have been proposed before. I&#8217;ll sketch my idea and I&#8217;ll call it Aspects. Defined when you instantiate something using // or other symbol. So</p>
<pre><code>
instance (Num//Sum a) =&gt; Monoid a where
     mappend  = (+)
     mempty = 0
</pre>
<p></code></p>
<p>or</p>
<pre><code>
instance Monoid [a]//Diff where
  mappend = MergeDiffs
  mempty  = []
</pre>
<p></code></p>
<p>[a]//Diff would type check differently to [a], but functions are automatically polymorphic over both if they accept [a]. Also you need a default instance of the typeclass you want to aspect over. Converting between aspects seems like something  ugly unless you perhaps require classes to have aspects to implement something similar to the toInteger. fromIntegral trick. Or more precisely deconstruct itself then reconstruct it. </p>
<p>I'll have a look how feasible this is to implement something like this somehow, but it seems likely I will just wrap/unwrap my strings for now. *</p>
<p>Thanks go out to #haskell quicksilver, dmwit and others that answer my questions. </p>
<p>Todo for next time</p>
<p>Read <a href="http://en.wikipedia.org/wiki/Trace_monoid#Trace_monoid">trace monoids</a>, something useful if I want to represent execution of a system that can go multiple ways I think, which might be nice to get down...</p>
<p>* It turns out that you can do something like this by instantiating things in a module and then importing that seperately, qualified by how you import.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vrrm.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vrrm.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vrrm.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vrrm.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vrrm.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vrrm.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vrrm.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vrrm.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vrrm.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vrrm.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vrrm.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vrrm.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vrrm.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vrrm.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=37&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vrrm.wordpress.com/2009/02/24/struggling-with-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a140544585e3b5dc9b7e43ce21eafd1b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">whpearson</media:title>
		</media:content>
	</item>
		<item>
		<title>EDSL for Debugging in haskell and diffs</title>
		<link>http://vrrm.wordpress.com/2009/02/24/edsl-for-debugging-in-haskell-and-diffs/</link>
		<comments>http://vrrm.wordpress.com/2009/02/24/edsl-for-debugging-in-haskell-and-diffs/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 13:52:08 +0000</pubDate>
		<dc:creator>whpearson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[haskell]]></category>

		<guid isPermaLink="false">http://vrrm.wordpress.com/?p=36</guid>
		<description><![CDATA[So I&#8217;m going to do an embedded domain specific language in haskell. Mainly so I don&#8217;t have to go through all the bother of building all the interpreter plumbing. So what will it look like roughly? As I am interested in figuring out what is going on in the virtual machine, I&#8217;ll need lots of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=36&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;m going to do an embedded domain specific language in haskell. Mainly so I don&#8217;t have to go through all the bother of building all the interpreter plumbing.</p>
<p>So what will it look like roughly? As I am interested in figuring out what is going on in the virtual machine, I&#8217;ll need lots of information about how it changes. This lead me to think that a very useful idea would be the patch. So you could run the VM for number of steps and get back a list of the changes. Merge them into one and save it to disk so you can quickly get back to this state, or save every step.  You could have it return a tuple of the operations and arguments ran and the diffs, and because of laziness you could select the one you want. So you could do stats on the ops ran as well.</p>
<p>So the main useful function would be something like&#8230;</p>
<p>runVrrm :: Vrrm -&gt; n -&gt; (Vrrm, [Instuction], [VrrmDiffList])</p>
<p>This would apply a diff to the vrrm state and get the new state. Hopefully you should also be able to do it backwards to turn back time.</p>
<p>applyDiffFor:: VrrmDiff -&gt; Maybe Vrrm -&gt; Maybe Vrrm<br />
applyDiffBack:: VrrmDiff -&gt; Maybe Vrrm -&gt; Maybe Vrrm</p>
<p>It would have to be Maybe, because if you apply diff to a machine state of a different memory size or variant of the architecture would barf and return Nothing.</p>
<p>You could apply them with folds</p>
<p>foldr (applyForwardDiff) (Just startstate) diffList</p>
<p>Although most likely you&#8217;d want to strictly merge them into one before doing this as the temp vrrmstates would be very big.</p>
<h3>Getting categorical</h3>
<p>Making a VrrmDiffList a monoid seems like a good idea, basically it allows you to merge them together.  As well as function that takes two diffs and composes them together you need a value that makes no difference what it is composed with. This shouldn&#8217;t be too hard.</p>
<p>Also I&#8217;ll note at this point that a partially applied applyDiffFor  or back on a diff is an arrow, and can be used as such. Something theoretically interesting, but I am not quite sure how to use it at the moment.</p>
<p>I&#8217;m also interested in the symmetries implicit in the diffs implying some form of group-ness. That you can negate diff should imply some more stuff, but it is not quite a group because negate a `mappend` a = mempty. Although it could do, you would lose the information about values had changed. </p>
<p>A brief example how it might work to give you a flavour.</p>
<p>Let us say that the whole of the state is one array. A diff would be something like</p>
<p>newtype VrrmDiff  = Diff  { getStart :: Int , getLength::Int ,  getChangeList :: [(Int, Int)]}   </p>
<p>The change list would assume the first Int was the original value and the second the changed value. Now you could compose the diffs in such a way that if the original value and changed value where the same it would be removed. This would make it a group. </p>
<p>Both VrrmDiff 0 0 [] and VrrmDiff 0 1 [(1,1)] would have the same affect on an array *, that being nothing. </p>
<p>* Note arrays are different from lists in haskell, I&#8217;ll use  to indicate an array.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vrrm.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vrrm.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vrrm.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vrrm.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vrrm.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vrrm.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vrrm.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vrrm.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vrrm.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vrrm.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vrrm.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vrrm.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vrrm.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vrrm.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=36&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vrrm.wordpress.com/2009/02/24/edsl-for-debugging-in-haskell-and-diffs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a140544585e3b5dc9b7e43ce21eafd1b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">whpearson</media:title>
		</media:content>
	</item>
		<item>
		<title>DSL for reverse engineering</title>
		<link>http://vrrm.wordpress.com/2009/02/19/dsl-for-reverse-engineering/</link>
		<comments>http://vrrm.wordpress.com/2009/02/19/dsl-for-reverse-engineering/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 14:25:03 +0000</pubDate>
		<dc:creator>whpearson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vrrm.wordpress.com/?p=31</guid>
		<description><![CDATA[The first thing I am going to do is develop an interpreter/debugger for the arch in haskell. I am currently looking at making a domain specific language to control the debugger. The reason why the debugger has to be some complex is that you will want to figure out what is going on inside the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=31&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The first thing I am going to do is develop an interpreter/debugger for the arch in haskell.</p>
<p>I am currently looking at making a domain specific language to control the debugger. The reason why the debugger has to be some complex is that you will want to figure out what is going on inside the system as it grows and changes.</p>
<p>I will be looking at <a href="http://www.eresi-project.org/">Eresi</a> for inspiration. Although I will need to add new primitives to it as well. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vrrm.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vrrm.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vrrm.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vrrm.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vrrm.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vrrm.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vrrm.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vrrm.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vrrm.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vrrm.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vrrm.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vrrm.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vrrm.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vrrm.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=31&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vrrm.wordpress.com/2009/02/19/dsl-for-reverse-engineering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a140544585e3b5dc9b7e43ce21eafd1b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">whpearson</media:title>
		</media:content>
	</item>
		<item>
		<title>Why I&#8217;m not working on Opencog</title>
		<link>http://vrrm.wordpress.com/2009/02/19/why-im-not-working-on-opencog/</link>
		<comments>http://vrrm.wordpress.com/2009/02/19/why-im-not-working-on-opencog/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 13:07:16 +0000</pubDate>
		<dc:creator>whpearson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Design Philosophy]]></category>
		<category><![CDATA[Opencog]]></category>

		<guid isPermaLink="false">http://vrrm.wordpress.com/?p=25</guid>
		<description><![CDATA[There is some overlap between what I am doing and what opencog, at least in that it wants to be an OS for AI and that the architecture I am making should be useful for implementing AI (among other things). Also it has a form of agorics for attention allocation, and wants to be able [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=25&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There is some overlap between what I am doing and what <a href="http://www.opencog.org/wiki/The_Open_Cognition_Project">opencog</a>, at least  in that it wants to be an OS for AI and that the architecture I am making should be useful for implementing AI (among other things).</p>
<p>Also it has a form of agorics for attention allocation, and wants to be able to do build new mind agents ( roughly programs) from atoms (data), that is be self-programmable.</p>
<p>So from a high level view it seems to tick lots of the boxes, so why am I not on board? Because it doesn&#8217;t focus on these things and take them seriously in the design. Reading the README for the cogserver dir there still isn&#8217;t a scheduler, and things still have to poll for IO rather than have interrupts. </p>
<p>Now this will be fixed at some point no doubt it will get a scheduler, but it probably won&#8217;t be fixed to the way I want to go. This comes down to me wanting the scheduler to be alterable. The choice of scheduler is important, it is something we allow to vary in our current computer systems. I have a vision where the scheduler specializes to the tasks assigned to it.</p>
<p>Now it is not strictly necessary (that is you can compute the same things with a half decent general scheduler) but I think it makes a neater conceptual abstraction, adding a simple layer to a von Neumann machine. It also allows the system to modify itself to protect itself from (unintentional as well as intentional) Denial of Resources attacks from the programs it runs. This factor can be crucial in how useful a system is in the real world.</p>
<p>This brings me to another philosophical difference I have with opencog, I assume all programs are potentially malicious or just full of errors that can cause DoR attacks. This I think is necessary when working with systems that are experimentally self-programmable. And experimental self-programmability is necessary for interesting self-programmability as far as I can see.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vrrm.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vrrm.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vrrm.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vrrm.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vrrm.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vrrm.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vrrm.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vrrm.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vrrm.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vrrm.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vrrm.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vrrm.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vrrm.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vrrm.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=25&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vrrm.wordpress.com/2009/02/19/why-im-not-working-on-opencog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a140544585e3b5dc9b7e43ce21eafd1b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">whpearson</media:title>
		</media:content>
	</item>
		<item>
		<title>Haskell VMonoids</title>
		<link>http://vrrm.wordpress.com/2009/02/18/haskell-vmonoids/</link>
		<comments>http://vrrm.wordpress.com/2009/02/18/haskell-vmonoids/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 16:25:19 +0000</pubDate>
		<dc:creator>whpearson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[vmonoid]]></category>

		<guid isPermaLink="false">http://vrrm.wordpress.com/?p=15</guid>
		<description><![CDATA[I&#8217;ll occasionally post stuff about haskell on this blog as it is my language of choice, and I am still learning it. I&#8217;ve come across something lacking in monoid, it occured to me when I was trying to think of a nice way to solve the problem of taking a list of bounds and getting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=15&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll occasionally post stuff about haskell on this blog as it is my language of choice, and I am still learning it.</p>
<p>I&#8217;ve come across something lacking in monoid, it occured to me when I was trying to think of a nice way to solve the problem of taking a list of bounds and getting a bound that encompassed them all.</p>
<p>E.g.<br />
[(1,3), (51 , 60) , (12, 55)] &#8211;&gt; (1,60)</p>
<p>Now it would be nice just to mconcat them. However there isn&#8217;t a value for mempty, at least not one I can see. You can define a function for mappend. </p>
<pre>
mappend a b = (x,y)
             where x = min (fst a) (fst b)
                   y = max (snd a) (snd b)
</pre>
<p>There are many values for mempty that would work for this example, anything between (1,1) and (60,60). </p>
<p>So you can imagine a variant of monoid with different type class.</p>
<pre>
class VMonoid a where
  mvempty :: a - &gt; a
  mvappend :: a -&gt; a -&gt; a

mvconcat :: [a] -&gt; a
mvconcat xall@(x:xs) = foldr mappend (mvempty x) xall
</pre>
<p>The rules that mvempty must follow would be something like the following</p>
<p>(mvempty x) ‘mvappend‘ x = x<br />
x ‘mvappend‘ (mvempty x)  = x</p>
<p>Is this an interesting pattern or not worthwhile? Note code is untested and may be buggy&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vrrm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vrrm.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vrrm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vrrm.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vrrm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vrrm.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vrrm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vrrm.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vrrm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vrrm.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vrrm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vrrm.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vrrm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vrrm.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vrrm.wordpress.com&amp;blog=6470618&amp;post=15&amp;subd=vrrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vrrm.wordpress.com/2009/02/18/haskell-vmonoids/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a140544585e3b5dc9b7e43ce21eafd1b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">whpearson</media:title>
		</media:content>
	</item>
	</channel>
</rss>
