<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6632326455425937582</id><updated>2012-02-16T20:13:04.731-08:00</updated><category term='syntax across languages'/><category term='type checking'/><category term='dynamic dispatch'/><category term='language enthusiast'/><category term='introduction'/><category term='late binding'/><category term='gadges'/><category term='anonymous functions'/><category term='autmented reality'/><category term='language design'/><title type='text'>Structura</title><subtitle type='html'>A blog about programming languages and patterns</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://structura.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>32</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-1570718787558034386</id><published>2011-03-21T03:06:00.000-07:00</published><updated>2011-03-21T03:06:43.736-07:00</updated><title type='text'>gcc -Winline and --param name=value</title><content type='html'>While tuning my language, Impulse, I found the gcc inline-optimization parameters.  Look for &lt;b&gt;--param name=value&lt;/b&gt; at the bottom of the page.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://tigcc.ticalc.org/doc/comopts.html#SEC10"&gt;http://tigcc.ticalc.org/doc/comopts.html#SEC10&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;-Winline --param inline-unit-growth=10000 --param large-function-growth=10000&lt;br /&gt; --param max-inline-insns-single=10000&lt;br /&gt;&lt;/pre&gt;0m2.450s 40000000 'self' message sends with --param options&lt;br /&gt;0m2.650s 40000000 'self' message sends without options&lt;br /&gt;&lt;br /&gt;That's a 7.5% boost.  While the binary is now twice as large, in my case the binary is still small - 100K stripped.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-1570718787558034386?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/1570718787558034386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/03/gcc-winline-and-param-namevalue.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/1570718787558034386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/1570718787558034386'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/03/gcc-winline-and-param-namevalue.html' title='gcc -Winline and --param name=value'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-8903286057559434073</id><published>2011-03-11T00:15:00.000-08:00</published><updated>2011-03-11T00:15:05.082-08:00</updated><title type='text'>Kaffeine.js - A cleaned up JavaScript</title><content type='html'>Well, I found one language pretty close to what I was looking for in a better JavaScript:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://weepy.github.com/kaffeine/"&gt;http://weepy.github.com/kaffeine/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;  &lt;li&gt;Backwards compatible with JavaScript&lt;/li&gt;  &lt;li&gt;Uses @foo to to get the "real" this.foo&lt;/li&gt;  &lt;li&gt;Uses CPS folding to flatten callbacks&lt;/li&gt;  &lt;li&gt;Multiline strings, which come in handy&lt;/li&gt;  &lt;li&gt;for(n of [1, 2, 3]) array iteration&lt;/li&gt;  &lt;li&gt;String interpolation: "#{foo} was here"&lt;/li&gt;  &lt;li&gt;Implicit functions: (foo) { alert(foo); }&lt;/li&gt;  &lt;li&gt;Pipe operator for chaining the first arg&lt;/li&gt;  &lt;li&gt;Default arguments, optional call parens&lt;/li&gt;  &lt;li&gt;Implicit return (nice with implicit funcs)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Out of those, I think callback unfolding and the pipe operator are the most interesting beyond adding some niceties:&lt;br /&gt;&lt;pre&gt;  ok = stomach.save!()&lt;br /&gt;  meal.complete = ok&lt;br /&gt;&lt;/pre&gt;translates to:&lt;br /&gt;&lt;pre&gt;  stomach.save(function(ok) {&lt;br /&gt;    meal.complete = ok&lt;br /&gt;  })&lt;br /&gt;&lt;/pre&gt;and...&lt;br /&gt;&lt;pre&gt;  result = input | fn args&lt;br /&gt;&lt;/pre&gt;translates to:&lt;br /&gt;&lt;pre&gt;  result = __.fn.call(this, input, args) &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-8903286057559434073?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/8903286057559434073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/03/kaffeinejs-cleaned-up-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/8903286057559434073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/8903286057559434073'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/03/kaffeinejs-cleaned-up-javascript.html' title='Kaffeine.js - A cleaned up JavaScript'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-2546709530790865050</id><published>2011-03-11T00:10:00.000-08:00</published><updated>2011-03-11T00:10:15.652-08:00</updated><title type='text'>C++ nested class that inherits parent</title><content type='html'>Ever wanted to nest a class that inherits from its parent class?  It can be done simply by using a forward declaration:&lt;br /&gt;&lt;pre&gt;class Value {&lt;br /&gt;&lt;br /&gt; public:&lt;br /&gt;&lt;br /&gt;    Value( Frame&amp; frame );&lt;br /&gt;&lt;br /&gt;    template &amp;lt;typename T&amp;gt; class Type;&lt;br /&gt;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;template &amp;lt;typename T&amp;gt;&lt;br /&gt;class Value::Type : public Value {&lt;br /&gt; &lt;br /&gt; public:&lt;br /&gt;  &lt;br /&gt;    Type( T&amp; frame ) : Value( frame ) { }&lt;br /&gt;&lt;br /&gt;    T&amp; getFrame() { return get&amp;lt;T&amp;gt;(); }&lt;br /&gt;&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;I use it to make Impulse values more specific and type safe:&lt;br /&gt;&lt;pre&gt;Value value;  // Could be 10, "foo", WhoKnowsWhat&lt;br /&gt;Value::Type&amp;lt;Symbol&amp;gt; symbol;  // Must be a Symbol&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-2546709530790865050?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/2546709530790865050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/03/c-nested-class-that-inherits-parent.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/2546709530790865050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/2546709530790865050'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/03/c-nested-class-that-inherits-parent.html' title='C++ nested class that inherits parent'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-5025451789584721907</id><published>2011-03-07T00:14:00.000-08:00</published><updated>2011-03-07T00:14:15.729-08:00</updated><title type='text'>Limited numeric types in C++</title><content type='html'>I don't want random indicies to be passed to a custom array, so this is the closest thing I could think of.  It basically creates a few static member variables, and doesn't allow you to create any more of those types by making the constructor private.  The "explicit" is optional, but demonstrates how to disable implicit conversion.&lt;br /&gt;&lt;pre&gt;Value foo( const Array&amp; args )&lt;br /&gt;{&lt;br /&gt;    return args[Index::_0];  // Don't give me any int!&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class Index {&lt;br /&gt;&lt;br /&gt; public:&lt;br /&gt;&lt;br /&gt;    const size_t index() const { return _index; }&lt;br /&gt;&lt;br /&gt;    static const Index _0;&lt;br /&gt;    static const Index _1;&lt;br /&gt;    static const Index _2;&lt;br /&gt;&lt;br /&gt; private:&lt;br /&gt;&lt;br /&gt;    explicit Index( const size_t index ) : _index( index ) { }&lt;br /&gt;&lt;br /&gt;    const size_t _index;&lt;br /&gt;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;const Index Index::_0( 0 );&lt;br /&gt;const Index Index::_1( 1 );&lt;br /&gt;const Index Index::_2( 2 );&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-5025451789584721907?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/5025451789584721907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/03/limited-numeric-types-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/5025451789584721907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/5025451789584721907'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/03/limited-numeric-types-in-c.html' title='Limited numeric types in C++'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-8917129461299315826</id><published>2011-02-22T01:11:00.001-08:00</published><updated>2011-02-22T01:11:46.430-08:00</updated><title type='text'>JavaScript Array Iteration</title><content type='html'>&lt;a href="http://benhollis.net/blog/2009/12/13/investigating-javascript-array-iteration-performance/"&gt;JavaScript Array Iteration&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-8917129461299315826?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/8917129461299315826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/02/javascript-array-iteration.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/8917129461299315826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/8917129461299315826'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/02/javascript-array-iteration.html' title='JavaScript Array Iteration'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-277194409060292570</id><published>2011-02-21T19:04:00.000-08:00</published><updated>2011-02-21T19:04:08.255-08:00</updated><title type='text'>LESS: CSS done right</title><content type='html'>I wanted to start a new browser-based project out right - with tools to make me uber-productive.  I found LESS, and will never turn back to plain CSS.  Mighty as CSS3 is, LESS extends it with:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Variables&lt;/li&gt;&lt;li&gt;Mixins&lt;/li&gt;&lt;li&gt;Nesting&lt;/li&gt;&lt;li&gt;Math&lt;/li&gt;&lt;li&gt;Comments&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;pre&gt;.box {&lt;br /&gt;  // Assign a variable&lt;br /&gt;  @base: #f938ab;&lt;br /&gt;&lt;br /&gt;  // Color functions&lt;br /&gt;  color: saturate(@base, 5%);&lt;br /&gt;  border-color: lighten(@base, 30%);&lt;br /&gt;&lt;br /&gt;  // Same as .box div&lt;br /&gt;  div {&lt;br /&gt;    .box-shadow(0, 0, 5px, 0.4)&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;a href="http://lesscss.org/"&gt;http://lesscss.org/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-277194409060292570?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/277194409060292570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/02/less-css-done-right.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/277194409060292570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/277194409060292570'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/02/less-css-done-right.html' title='LESS: CSS done right'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-7762155273019193454</id><published>2011-02-21T17:50:00.000-08:00</published><updated>2011-02-21T17:50:45.453-08:00</updated><title type='text'>The Joy of HTM5</title><content type='html'>...when most browsers support it :)&lt;br /&gt;&lt;pre&gt;.button:before {&lt;br /&gt;  display: block;&lt;br /&gt;  content: attr(label);&lt;br /&gt;  border-top: 1px solid #ffffff;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;div class="button" label="Save"&amp;gt;&amp;lt/div&amp;gt;&lt;/pre&gt;&lt;a href="http://www.w3schools.com/html5/tag_input.asp"&gt;http://www.w3schools.com/html5/tag_input.asp&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-7762155273019193454?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/7762155273019193454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/02/joy-of-htm5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/7762155273019193454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/7762155273019193454'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/02/joy-of-htm5.html' title='The Joy of HTM5'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-3883547219876743583</id><published>2011-01-28T22:28:00.000-08:00</published><updated>2011-01-28T22:28:42.834-08:00</updated><title type='text'>Visual perception</title><content type='html'>I'm always fascinated (ok, maybe too strong of a word) by perceptual vs real things, such as how contrast and color of nearby objects can change your perception of other objects.  Another example is when syntax is too orthoganal, it can be harder to visually parse:&lt;br /&gt;&lt;pre&gt;def square-of (x :: &amp;lt;integer&amp;gt;) :: &amp;lt;integer&amp;gt;&lt;br /&gt;  x * x&lt;br /&gt;end&lt;/pre&gt;In this hypothetical language (resembling Dylan), x is an integer, and square-of returns an integer.  Because both use "::", I find it harder to very quickly distinguish the arguments and the return type.  If we use "=&gt;" instead:&lt;br /&gt;&lt;pre&gt;method square-of (x :: &amp;lt;integer&amp;gt;) =&gt; &amp;lt;integer&amp;gt;&lt;br /&gt;  x * x&lt;br /&gt;end&lt;/pre&gt;it's much clearer, at least to me.  So sometimes being pure is not the best choice.  I remember reading an article or web page about this in the past, but I don't remember the details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-3883547219876743583?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/3883547219876743583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/visual-perception.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/3883547219876743583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/3883547219876743583'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/visual-perception.html' title='Visual perception'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-2792992362946325848</id><published>2011-01-21T23:31:00.000-08:00</published><updated>2011-01-21T23:32:21.153-08:00</updated><title type='text'>Abusing Ruby Operators</title><content type='html'>I've been looking at different ways to "pipe" objects, where the previous pipe object becomes the scope of the next.&amp;nbsp; The allows you perform multiple operations on an object, then pass it on to the next pipe operation.&amp;nbsp; For example (not a real language):&lt;br /&gt;&lt;pre&gt;"Foo,Bar".split "," | first.upcase + last.downcase | reverse&lt;/pre&gt;The closest I could get in Ruby is this:&lt;br /&gt;&lt;pre&gt;"Foo,Bar".split(",") --&amp;gt; { first.upcase + last.downcase } --&amp;gt; { reverse }&lt;/pre&gt;and the code to make this happen:&lt;br /&gt;&lt;pre&gt;module Pipe&lt;br /&gt;  def -( expr )&lt;br /&gt;    alias :minus :-&lt;br /&gt;  &lt;br /&gt;    if expr.instance_of? Proc&lt;br /&gt;      self.instance_eval( &amp;amp;expr )&lt;br /&gt;    else&lt;br /&gt;      minus( expr )&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;class String&lt;br /&gt;  include Pipe&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;class Array&lt;br /&gt;  include Pipe&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;I would never abuse the minus operator so badly though.  Or would I :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-2792992362946325848?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/2792992362946325848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/abusing-ruby-operators.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/2792992362946325848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/2792992362946325848'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/abusing-ruby-operators.html' title='Abusing Ruby Operators'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-6930150269126101383</id><published>2011-01-19T15:27:00.000-08:00</published><updated>2011-01-19T15:27:54.840-08:00</updated><title type='text'>Mirroring git repositories</title><content type='html'>I found it's easy to have both a codaset and github repository that point to the same local repository.&amp;nbsp; In my local repo, I typed:&lt;br /&gt;&lt;br /&gt;git remote add github git@githum.com:mikeaustin/impulse-language.git&lt;br /&gt;&lt;br /&gt;Now I can do "git remote update" and pull from both, and "git push origin" and "git push github" to update both repositories.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/849308/pull-push-from-multiple-remote-locations"&gt;pull/push from multiple remote locations&lt;br /&gt;&lt;/a&gt; [stackoverflow.com]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-6930150269126101383?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/6930150269126101383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/mirroring-git-repositories.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/6930150269126101383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/6930150269126101383'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/mirroring-git-repositories.html' title='Mirroring git repositories'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-5089492149627341788</id><published>2011-01-19T13:51:00.000-08:00</published><updated>2011-01-19T13:51:47.513-08:00</updated><title type='text'>Juice: JS Web Framework</title><content type='html'>"Juice is a server-side web framework built around CommonJS modules and specifically the JSGI 0.3 proposal. Its an open-source stack released under the MIT license that comes bundled with its own development server and a javascript interpreter."&lt;br /&gt;&lt;br /&gt;Lower barriers.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;With your client-side and server-side code in the same language, your development won't hit as many communication blocks or gear changes.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Share code between client and server.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Common helpers and validation routines written only need writing once and can be used in your controllers, templates and client-side code.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Sounds like the right way to do it.&amp;nbsp; &lt;a href="http://juicejs.org/"&gt;http://juicejs.org/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-5089492149627341788?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/5089492149627341788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/juice-js-web-framework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/5089492149627341788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/5089492149627341788'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/juice-js-web-framework.html' title='Juice: JS Web Framework'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-259516042809680291</id><published>2011-01-17T23:39:00.000-08:00</published><updated>2011-01-17T23:39:38.935-08:00</updated><title type='text'>Law and Order: The programming language</title><content type='html'>&lt;a href="https://github.com/bkerley/lao/blob/master/numecho.lao"&gt;Law and Order: The programming language&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-259516042809680291?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/259516042809680291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/law-and-order-programming-language.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/259516042809680291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/259516042809680291'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/law-and-order-programming-language.html' title='Law and Order: The programming language'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-3245238618628211990</id><published>2011-01-17T22:01:00.000-08:00</published><updated>2011-01-17T22:01:18.051-08:00</updated><title type='text'>Language feature trends</title><content type='html'>Some of the trends I've noticed while looking at new languages:&lt;br /&gt;&lt;br /&gt;Parser combinators and parsing libraries&lt;br /&gt;Actors/coroutines and concurrency&lt;br /&gt;Prototype inheritance&lt;br /&gt;Structural typing&lt;br /&gt;Pattern matching&lt;br /&gt;Domain Specific Languages&lt;br /&gt;Breaking away from C syntax&lt;br /&gt;Static type-checking in dynamic languages&lt;br /&gt;Dynamic elements in statically typed languages&lt;br /&gt;Minimalism&lt;br /&gt;&lt;br /&gt;It's great news for me since I like all these.  Well, I'm trying to like structural typing :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-3245238618628211990?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/3245238618628211990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/language-feature-trends.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/3245238618628211990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/3245238618628211990'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/language-feature-trends.html' title='Language feature trends'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-2475735548054946086</id><published>2011-01-17T21:06:00.000-08:00</published><updated>2011-01-17T21:06:53.733-08:00</updated><title type='text'>Treetop: Expression parser</title><content type='html'>"Treetop is a language for describing languages. Combining the elegance of Ruby with cutting-edge parsing expression grammars, it helps you analyze syntax with revolutionary ease."&lt;br /&gt;&lt;pre&gt;grammar Arithmetic&lt;br /&gt;  rule additive&lt;br /&gt;    multitive ( '+' multitive )*&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  rule multitive&lt;br /&gt;    primary ( [*/%] primary )*&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  rule primary&lt;br /&gt;    '(' additive ')' / number&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  rule number&lt;br /&gt;    '-'? [1-9] [0-9]*&lt;br /&gt;  end&lt;br /&gt;end&lt;/pre&gt;&lt;a href="http://treetop.rubyforge.org/"&gt;Treetop on Rubyforge.com&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-2475735548054946086?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/2475735548054946086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/treetop-expression-parser.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/2475735548054946086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/2475735548054946086'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/treetop-expression-parser.html' title='Treetop: Expression parser'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-6733184313060645227</id><published>2011-01-17T00:45:00.000-08:00</published><updated>2011-01-17T00:45:36.504-08:00</updated><title type='text'>Conditionals via callable booleans</title><content type='html'>I bumped into a language called "tofu" which has an interesting conditional concept:&lt;br /&gt;&lt;pre&gt;(number &amp;lt; 0)(-1, 1)&lt;/pre&gt;or, in simplified terms:&lt;br /&gt;&lt;pre&gt;true(-1, 1)&lt;/pre&gt;which translates to:&lt;br /&gt;&lt;pre&gt;true ? -1 : 1&lt;/pre&gt;I'm not sure it's my favorite way to do it, but still an interesting concept.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://github.com/dahlia/tofu"&gt;Tofu Programming Language&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-6733184313060645227?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/6733184313060645227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/conditionals-via-callable-booleans.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/6733184313060645227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/6733184313060645227'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/conditionals-via-callable-booleans.html' title='Conditionals via callable booleans'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-9183820687776672383</id><published>2011-01-15T20:37:00.000-08:00</published><updated>2011-01-15T20:37:21.297-08:00</updated><title type='text'>Active Objects with Ruby &amp; Revactor</title><content type='html'>I wanted to try going back to basics by writing a MUD in Ruby.  MUDs are simple, but are also good candidates for testing concurrency in a language.  Handling multiple connections, persisting state, and handling events that happen asynchronously seems like a good job for Active Objects.  Here's a simple implementation using Revactor:&lt;br /&gt;&lt;pre&gt;#&lt;br /&gt;# Revactor requires Ruby &amp;gt;= 1.9.0&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;require 'revactor'&lt;br /&gt;&lt;br /&gt;class ActiveObject&lt;br /&gt;&lt;br /&gt;  def initialize( klass )&lt;br /&gt;    @actor = Actor.spawn( klass.new(), &amp;method( :actor_run ) )&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  def actor_run( object )&lt;br /&gt;    loop do&lt;br /&gt;      Actor.receive do |filter|&lt;br /&gt;        filter.when( Case[Symbol, Array] ) do |method_name, arguments|&lt;br /&gt;          object.send( method_name, arguments )&lt;br /&gt;        end&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  def method_missing( method_name, *arguments, &amp;amp;block )&lt;br /&gt;    @actor &amp;lt;&amp;lt; [method_name, arguments]&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;class MudPlayer&lt;br /&gt;&lt;br /&gt;  def foo( bar )&lt;br /&gt;    puts bar&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;actor = ActiveObject.new( MudPlayer )&lt;br /&gt;actor.foo( 10 )&lt;br /&gt;actor.foo( 20 )&lt;br /&gt;&lt;br /&gt;Actor.reschedule()&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-9183820687776672383?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/9183820687776672383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/active-objects-with-ruby-revactor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/9183820687776672383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/9183820687776672383'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/active-objects-with-ruby-revactor.html' title='Active Objects with Ruby &amp; Revactor'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-1411193147089074763</id><published>2011-01-09T17:49:00.000-08:00</published><updated>2011-01-09T17:49:49.846-08:00</updated><title type='text'>The Visual 6502 in JavaScript</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.visual6502.org/JSSim/index.html" imageanchor="1" style=""&gt;&lt;img border="0" height="392" width="400" src="http://2.bp.blogspot.com/_1e--2EpgSFw/TSplnQm8t3I/AAAAAAAAAEE/BVlj7Pz7Xe4/s400/visual_6502.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-1411193147089074763?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/1411193147089074763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/visual-6502-in-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/1411193147089074763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/1411193147089074763'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/visual-6502-in-javascript.html' title='The Visual 6502 in JavaScript'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1e--2EpgSFw/TSplnQm8t3I/AAAAAAAAAEE/BVlj7Pz7Xe4/s72-c/visual_6502.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-4501622270689877005</id><published>2011-01-08T14:34:00.000-08:00</published><updated>2011-01-08T14:34:49.431-08:00</updated><title type='text'>JavaScript VM without the JavaScript?</title><content type='html'>&lt;a href="http://stackoverflow.com/questions/86426/why-require-javascript-rather-than-supporting-a-standard-browser-virtual-machine"&gt;Why require JavaScript rather than supporting a standard browser virtual machine?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Question on stackoverflow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-4501622270689877005?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/4501622270689877005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/javascript-vm-without-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/4501622270689877005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/4501622270689877005'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/javascript-vm-without-javascript.html' title='JavaScript VM without the JavaScript?'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-2553464046910034522</id><published>2011-01-08T13:37:00.000-08:00</published><updated>2011-01-08T13:37:18.806-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gadges'/><category scheme='http://www.blogger.com/atom/ns#' term='autmented reality'/><title type='text'>Sony's 3D new HMD Prototype</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.engadget.com/2011/01/06/sonys-3d-head-mounted-display-prototype-face-on/" imageanchor="1" style=""&gt;&lt;img border="0" height="266" width="400" src="http://3.bp.blogspot.com/_1e--2EpgSFw/TSjYfvwyaiI/AAAAAAAAAD8/KKDYF6U3Gcc/s400/2011-01-05sony3dhmd-1.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Hoping the next wave of VR glasses will be cheaper and have a higher resolution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-2553464046910034522?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/2553464046910034522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/sonys-3d-new-hmd-prototype.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/2553464046910034522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/2553464046910034522'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/sonys-3d-new-hmd-prototype.html' title='Sony&apos;s 3D new HMD Prototype'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_1e--2EpgSFw/TSjYfvwyaiI/AAAAAAAAAD8/KKDYF6U3Gcc/s72-c/2011-01-05sony3dhmd-1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-3456610791316317774</id><published>2011-01-08T13:33:00.000-08:00</published><updated>2011-01-08T13:33:53.437-08:00</updated><title type='text'>Microsoft's next generation Surface</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.engadget.com/2011/01/05/microsoft-shows-off-next-generation-of-surface-has-per-pixel-to/" imageanchor="1" style=""&gt;&lt;img border="0" height="266" width="400" src="http://3.bp.blogspot.com/_1e--2EpgSFw/TSjX360hX1I/AAAAAAAAAD0/nUQ30YtMc_k/s400/surface-pre-09-gal.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I don't know about you, but that image is a little disturbing :)  The technology looks cool though.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-3456610791316317774?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/3456610791316317774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/microsofts-next-generation-surface.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/3456610791316317774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/3456610791316317774'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/microsofts-next-generation-surface.html' title='Microsoft&apos;s next generation Surface'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_1e--2EpgSFw/TSjX360hX1I/AAAAAAAAAD0/nUQ30YtMc_k/s72-c/surface-pre-09-gal.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-476714261832365496</id><published>2011-01-05T23:14:00.000-08:00</published><updated>2011-01-05T23:14:03.852-08:00</updated><title type='text'>CoffeeScript: JavaScript + Python?</title><content type='html'>CoffeeScript:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;yearsOld = max: 10, ida: 9, tim: 11&lt;br /&gt;&lt;br /&gt;ages = for child, age of yearsOld&lt;br /&gt;  child + " is " + age&lt;/pre&gt;&lt;br /&gt;JavaScript:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;var age, ages, child, yearsOld;&lt;br /&gt;yearsOld = {&lt;br /&gt;  max: 10,&lt;br /&gt;  ida: 9,&lt;br /&gt;  tim: 11&lt;br /&gt;};&lt;br /&gt;ages = (function() {&lt;br /&gt;  var _results;&lt;br /&gt;  _results = [];&lt;br /&gt;  for (child in yearsOld) {&lt;br /&gt;    age = yearsOld[child];&lt;br /&gt;    _results.push(child + " is " + age);&lt;br /&gt;  }&lt;br /&gt;  return _results;&lt;br /&gt;})();&lt;/pre&gt;&lt;br /&gt;'nuf said.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-476714261832365496?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/476714261832365496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/coffeescript-javascript-python.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/476714261832365496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/476714261832365496'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/coffeescript-javascript-python.html' title='CoffeeScript: JavaScript + Python?'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-2280855282489552931</id><published>2011-01-05T14:40:00.000-08:00</published><updated>2011-01-05T14:40:46.309-08:00</updated><title type='text'>Flot: JavaScript charting library</title><content type='html'>JavaScript has its fair share of warts, but you can do some awesome things with it now that it's blazingly fast.  I recently discovered the &lt;a href="http://code.google.com/p/flot/"&gt;Flot&lt;/a&gt; charting library, which uses the canvas element to make beautiful charts.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://code.google.com/p/flot/" imageanchor="1" style=""&gt;&lt;img border="0" height="202" width="400" src="http://3.bp.blogspot.com/_1e--2EpgSFw/TSTzMEm8KxI/AAAAAAAAADs/JhdQ8j5ldLI/s400/flot-screenshot.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-2280855282489552931?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/2280855282489552931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/flot-javascript-charting-library.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/2280855282489552931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/2280855282489552931'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/flot-javascript-charting-library.html' title='Flot: JavaScript charting library'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_1e--2EpgSFw/TSTzMEm8KxI/AAAAAAAAADs/JhdQ8j5ldLI/s72-c/flot-screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-6173373084674011393</id><published>2011-01-04T23:43:00.000-08:00</published><updated>2011-01-04T23:43:19.838-08:00</updated><title type='text'>It's fun to run remote X apps</title><content type='html'>I forgot how simple and fun (your millage may vary) it is to connect to Linux box from a Mac:&lt;br /&gt;&lt;br /&gt;$ ssh username@somehost -X&lt;br /&gt;somehost$ xlogo&lt;br /&gt;&lt;br /&gt;Beautiful. And actually productive since you can run all your apps remotely.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-6173373084674011393?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/6173373084674011393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/its-fun-to-run-remote-x-apps.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/6173373084674011393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/6173373084674011393'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/its-fun-to-run-remote-x-apps.html' title='It&apos;s fun to run remote X apps'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-4000668655220078715</id><published>2011-01-02T14:01:00.000-08:00</published><updated>2011-01-02T14:01:53.754-08:00</updated><title type='text'>Job trends by language</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a target="_blank" href="http://www.indeed.com/jobtrends?q=erlang%2C+haskel%2C+lisp%2C+ocaml%2C+scala%2C+clojure&amp;l=" imageanchor="1" style=""&gt;&lt;img border="0" height="222" width="400" src="http://3.bp.blogspot.com/_1e--2EpgSFw/TSD0-_hRiSI/AAAAAAAAADI/5Ih6nulLEgQ/s400/jobgraph.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-4000668655220078715?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/4000668655220078715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/job-trends-by-language.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/4000668655220078715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/4000668655220078715'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/job-trends-by-language.html' title='Job trends by language'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_1e--2EpgSFw/TSD0-_hRiSI/AAAAAAAAADI/5Ih6nulLEgQ/s72-c/jobgraph.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-1171627710072715490</id><published>2011-01-02T13:54:00.000-08:00</published><updated>2011-01-02T13:55:26.603-08:00</updated><title type='text'>Nemerle: Functional + OO</title><content type='html'>In my quest for language discovery, I have run into Nemerle:&lt;br /&gt;&lt;br /&gt;"Nemerle is a high-level statically-typed programming language for the .NET platform. It offers functional, object-oriented and imperative features. It has a simple C#-like syntax and a powerful meta-programming system."&lt;br /&gt;&lt;br /&gt;It has some really cool features: functional values, variants and pattern matching, type inference, and a powerful macro system.  In some regards, it's very similar to Scala.  Example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;variant RgbColor {&lt;br /&gt;  | Red&lt;br /&gt;  | Yellow&lt;br /&gt;  | Green&lt;br /&gt;  | Different {&lt;br /&gt;      red   : float;&lt;br /&gt;      green : float;&lt;br /&gt;      blue  : float;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;string_of_color (color : RgbColor) : string&lt;br /&gt;{&lt;br /&gt;  match (color) {&lt;br /&gt;    | RgbColor.Red    =&gt; "red"&lt;br /&gt;    | RgbColor.Yellow =&gt; "yellow"&lt;br /&gt;    | RgbColor.Green  =&gt; "green"&lt;br /&gt;    | RgbColor.Different (r, g, b) =&gt; $"rgb($r, $g, $b)"&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-1171627710072715490?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/1171627710072715490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/nemerle-functional-oo.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/1171627710072715490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/1171627710072715490'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/nemerle-functional-oo.html' title='Nemerle: Functional + OO'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-6929126954455478077</id><published>2011-01-01T14:52:00.000-08:00</published><updated>2011-01-01T14:52:35.461-08:00</updated><title type='text'>Shorthand anonymous functions in Ruby</title><content type='html'>In Scala, the anonymous function &lt;code&gt;(n) =&gt; n * 2&lt;/code&gt; can be shortened to &lt;code&gt;_ * 2&lt;/code&gt;, which can be handy when dealing with only one or two arguments.  Why don't we try this in Ruby :)&lt;br /&gt;&lt;pre&gt;class Symbol&lt;br /&gt;  def method_missing(name, *args)&lt;br /&gt;    lambda { |n| n.send(name, *args) }&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;puts (1..10).map &amp;amp;:n * 2&lt;br /&gt;puts (1..10).map { |n| n * 2 }&lt;br /&gt;puts (1..10).map &amp;amp;lambda { |n| n * 2 }&lt;/pre&gt;If you're not familiar with Ruby, the "&amp;amp;" turns the argument into a block - which is usually passed in with block syntax such as &lt;code&gt;{ |n| n * 2 }&lt;/code&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-6929126954455478077?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/6929126954455478077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/shorthand-anonymous-functions-in-ruby.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/6929126954455478077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/6929126954455478077'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/shorthand-anonymous-functions-in-ruby.html' title='Shorthand anonymous functions in Ruby'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-7524460225785753453</id><published>2011-01-01T14:28:00.000-08:00</published><updated>2011-01-01T14:29:44.833-08:00</updated><title type='text'>Coroutines, futures and actors</title><content type='html'>I've been reading up on Scala and Erlang lately - I'd like to try implementing coroutines with support for multiple threads in Impulse to take advantage of multiple cores.&amp;nbsp; This is how I understand the current languages/frameworks that are related to concurrency:&lt;br /&gt;&lt;pre&gt;Erlang            =&gt;    Extremely light preemtive(*)&lt;br /&gt;                        coroutines + async IO +&lt;br /&gt;                        multithreaded + distributed&lt;br /&gt;&lt;br /&gt;Io                =&gt;    Coroutines + async IO&lt;br /&gt;&lt;br /&gt;Stackless Python  =&gt;    Coroutines + blocking IO&lt;br /&gt;+ Tasklets&lt;br /&gt;&lt;br /&gt;Scala             =&gt;    Event callbacks or OS threads&lt;br /&gt;                        (to have continuations soon?)&lt;br /&gt;&lt;br /&gt;Twisted, Node.js  =&gt;    Event callbacks&lt;/pre&gt;(*) VM instruction preemtion, as in yielding after N number of reductions (function calls).  Native C bindings can still block.&lt;br /&gt;&lt;br /&gt;Event callbacks are stateless, which means nested loops need to handle state explicitly.  Non-preemtive coroutines means that a "while (true);" can block all other coroutines.  Blocking IO means that a IO call will block all other coroutines.&lt;br /&gt;&lt;br /&gt;So apart from making every value immutable, I assume I could give each actor its own global environment, ensuring that it doesn't have access to objects that could be running in a different thread.  I believe in Scala you just have to follow convention and not access mutable state?&lt;br /&gt;&lt;br /&gt;Using futures is a great way to write your programs in a data-flow style.  But without immutable state, even with cooperative coroutines, values&lt;br /&gt;from change from underneath you.  Io allows any object to become a temporary actor by sending asynchronous methods that return a future - but in a multi-threaded environment, there doesn't seem to be enough control without moving the object to it's own global environment (which seem pretty tricky).&lt;br /&gt;&lt;br /&gt;So, would a combination of non-shared state between actors, coroutines, non-blocking IO, futures and one thread per processor with a scheduler do the trick?  Example in Io:&lt;br /&gt;&lt;pre&gt;calc = Actor clone do (&lt;br /&gt;  product = method (value,&lt;br /&gt;    range(1, value) reduce(*)&lt;br /&gt;  )&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;value = calc product(5)&lt;br /&gt;// do other stuff&lt;br /&gt;writeln(value + 10)&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-7524460225785753453?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/7524460225785753453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2011/01/coroutines-futures-and-actors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/7524460225785753453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/7524460225785753453'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2011/01/coroutines-futures-and-actors.html' title='Coroutines, futures and actors'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-9165600619719612599</id><published>2010-12-26T16:52:00.000-08:00</published><updated>2010-12-26T16:54:19.977-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dynamic dispatch'/><title type='text'>Pointer to Member Functions in C++</title><content type='html'>Pointers to member functions in C++ are quite useful when you need to store behavior.  A pointer to a member function doesn't store the address of one function implementation - it allows you to call overriden member funtions in subclasses.  For example:&lt;br /&gt;&lt;pre style="font-size: 12px;"&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;struct View&lt;br /&gt;{&lt;br /&gt;    virtual void mouseMove() { cout &amp;lt;&amp;lt; "View.mouseMove()" &amp;lt;&amp;lt; endl; }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;struct Button : public View&lt;br /&gt;{&lt;br /&gt;    virtual void mouseMove() { cout &amp;lt;&amp;lt; "Button.mouseMove()" &amp;lt;&amp;lt; endl; }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;typedef void (View::*EventType)();&lt;br /&gt;&lt;br /&gt;struct MouseEvent&lt;br /&gt;{&lt;br /&gt;    EventType _eventType;&lt;br /&gt;&lt;br /&gt;    MouseEvent( EventType eventType ) : _eventType( eventType ) { }&lt;br /&gt;&lt;br /&gt;    void dispatch( View* view ) { (view-&amp;gt;*_eventType)(); }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;int main( int argc, char* argv[] )&lt;br /&gt;{&lt;br /&gt;    MouseEvent* event = new MouseEvent( &amp;View::mouseMove );&lt;br /&gt;&lt;br /&gt;    event-&amp;gt;dispatch( new Button() );&lt;br /&gt;}&lt;/pre&gt;This is somewhat similar to using generic functions in Dylan - there's a level of indirection between the reference and the function implementation.&amp;nbsp; In very dynamic languages like Ruby, you can use symbols to achieve the same behavior:&lt;br /&gt;&lt;pre style="font-size: 12px;"&gt;class View&lt;br /&gt;  MOUSE_MOVE = :mouse_move&lt;br /&gt;&lt;br /&gt;  def mouse_move()&lt;br /&gt;    puts "View.mouse_move()"&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;class Button &amp;lt; View&lt;br /&gt;  def mouse_move()&lt;br /&gt;    puts "View.mouse_move()"&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;class MouseEvent&lt;br /&gt;  def initialize( event_type )&lt;br /&gt;      @event_type = event_type&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  def dispatch( view )&lt;br /&gt;    view.send( @event_type )&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;event = MouseEvent.new( View::MOUSE_MOVE )&lt;br /&gt;event.dispatch( View.new() )&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-9165600619719612599?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/9165600619719612599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2010/12/pointer-to-member-functions-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/9165600619719612599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/9165600619719612599'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2010/12/pointer-to-member-functions-in-c.html' title='Pointer to Member Functions in C++'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-1762457672093493936</id><published>2010-12-26T15:34:00.000-08:00</published><updated>2010-12-26T15:34:45.744-08:00</updated><title type='text'>Liberate Me Ex Null</title><content type='html'>Not sure if I got the Latin perfect, but please, future language designers, save us from null!&lt;br /&gt;Even bright new languages like Scala can't help us from the land of null:&lt;br /&gt;&lt;pre wrap=""&gt;def foo( string: Some[String] ) = {&lt;br /&gt;  string.get&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;foo( null )&lt;/pre&gt;&lt;pre wrap=""&gt;&lt;/pre&gt;&lt;pre wrap=""&gt;java.lang.NullPointerException at Main$$anon$1.foo(test.scala:2)&lt;/pre&gt;&lt;pre wrap=""&gt;&lt;/pre&gt;&lt;pre style="font-family: inherit;" wrap=""&gt;"Some" (and "None") are from the "Option" type, which is a way of letting you say you have something or nothing, while still preserving type safety.  But because of null compatibility with the JVM, Some[] is nullable!  A more dynamic language, Dylan, can type check this pattern:&lt;/pre&gt;&lt;pre wrap=""&gt;&lt;/pre&gt;&lt;pre wrap=""&gt;define method foo (string :: &amp;lt;string&amp;gt;) end;&lt;/pre&gt;&lt;pre wrap=""&gt;&lt;/pre&gt;&lt;pre style="font-family: inherit;" wrap=""&gt;This method takes a string - and does not accept a null value.  If you want to allow nulls (or false, in Dylan's case), you write:&lt;/pre&gt;&lt;pre wrap=""&gt;&lt;/pre&gt;&lt;pre wrap=""&gt;define method foo (string :: false-or(&amp;lt;string&amp;gt;)) end;&lt;/pre&gt;&lt;pre style="font-family: inherit;" wrap=""&gt;which is ultimately shorthand for a type union:&lt;br /&gt;&lt;/pre&gt;&lt;pre wrap=""&gt;define method foo (string :: type-union(&amp;lt;string&amp;gt;, &lt;code&gt;singleton(#f)&lt;/code&gt;)) end;&lt;/pre&gt;&lt;pre wrap=""&gt;&amp;nbsp;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-1762457672093493936?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/1762457672093493936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2010/12/liberate-me-ex-null.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/1762457672093493936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/1762457672093493936'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2010/12/liberate-me-ex-null.html' title='Liberate Me Ex Null'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-5355054033241409325</id><published>2010-12-26T15:07:00.000-08:00</published><updated>2010-12-26T15:41:48.798-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='anonymous functions'/><category scheme='http://www.blogger.com/atom/ns#' term='syntax across languages'/><title type='text'>Anonymous function syntax across languages</title><content type='html'>One of my favorite references is the "Syntax Across Languages" site:&lt;br /&gt;&lt;a href="http://rigaux.org/language-study/syntax-across-languages/Fnctn.html#FnctnnnmsFnct"&gt;Anonymous function syntax across languages&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It's amazing how many different (although some very similar) ways you can write an anonymous function.&amp;nbsp; I have to confess, even in the development of my own language, Impulse, I have added yet another variation: &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;|a, b| a + b&lt;/span&gt;, which is essentially Ruby without the braces { }.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-5355054033241409325?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/5355054033241409325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2010/12/anonymous-function-syntax-across.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/5355054033241409325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/5355054033241409325'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2010/12/anonymous-function-syntax-across.html' title='Anonymous function syntax across languages'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-2589595629459841691</id><published>2010-12-26T14:21:00.000-08:00</published><updated>2010-12-26T15:41:02.968-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='late binding'/><category scheme='http://www.blogger.com/atom/ns#' term='type checking'/><title type='text'>Static + Dynamic Typing</title><content type='html'>Sometimes you want the strictness of static type checking, but also want the flexibility of dynamic binding.  C# expression trees, for example:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb397951.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb397951.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is basically a LISP embedded in C#, or rather, the .NET runtime.  The flip side to this is to add static type checking (with type inference) to a dynamic language.  Examples of this would be Dylan and Dr Scheme.  In the end, does it matter which direction you start from?&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lambda-the-ultimate.org/node/1311"&gt;http://lambda-the-ultimate.org/node/1311&lt;/a&gt;&lt;br /&gt;&lt;a href="http://axisofeval.blogspot.com/2010/07/c-40-industrial-response-to-lisp.html"&gt;http://axisofeval.blogspot.com/2010/07/c-40-industrial-response-to-lisp.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://c2.com/cgi/wiki?SoftTyping"&gt;http://c2.com/cgi/wiki?SoftTyping&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-2589595629459841691?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/2589595629459841691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2010/12/static-dynamic-typing.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/2589595629459841691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/2589595629459841691'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2010/12/static-dynamic-typing.html' title='Static + Dynamic Typing'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6632326455425937582.post-6294406805429236319</id><published>2010-12-26T13:54:00.000-08:00</published><updated>2010-12-26T20:24:54.941-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='introduction'/><category scheme='http://www.blogger.com/atom/ns#' term='language enthusiast'/><category scheme='http://www.blogger.com/atom/ns#' term='language design'/><title type='text'>Welcome to Structura</title><content type='html'>Welcome to Structura, a blog about programming languages and patterns.  I'm a language enthusiast, so topics will range from old and new languages, to new patterns and ideas, to rants about why a language took a particular direction.  I will be biased, of course, but I will be fair.  Enjoy!&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Mike&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6632326455425937582-6294406805429236319?l=structura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://structura.blogspot.com/feeds/6294406805429236319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://structura.blogspot.com/2010/12/welcome-to-structura.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/6294406805429236319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6632326455425937582/posts/default/6294406805429236319'/><link rel='alternate' type='text/html' href='http://structura.blogspot.com/2010/12/welcome-to-structura.html' title='Welcome to Structura'/><author><name>Mike Austin</name><uri>http://www.blogger.com/profile/10858095751808264396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_1e--2EpgSFw/TRgZt3JzN_I/AAAAAAAAACo/w-zXKYKz4i0/S220/Mike.jpg'/></author><thr:total>0</thr:total></entry></feed>
