<?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/"
	>

<channel>
	<title>andyfrank.com</title>
	<atom:link href="http://www.andyfrank.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.andyfrank.com/blog</link>
	<description></description>
	<pubDate>Fri, 22 Jan 2010 22:19:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fantom AST Viewer</title>
		<link>http://www.andyfrank.com/blog/2010/01/fantom-ast-viewer/</link>
		<comments>http://www.andyfrank.com/blog/2010/01/fantom-ast-viewer/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 22:14:58 +0000</pubDate>
		<dc:creator>Andy Frank</dc:creator>
		
		<category><![CDATA[Fantom]]></category>

		<guid isPermaLink="false">http://www.andyfrank.com/blog/?p=129</guid>
		<description><![CDATA[Finally got around to throwing the code to my Fantom AST Viewer online.  You can check it out over on bitbucket:
http://bitbucket.org/afrankvt/fanast/
Its pretty crude, but works, and should be pretty easy to fix or modify to suite your needs.

]]></description>
			<content:encoded><![CDATA[<p>Finally got around to throwing the code to my <a href='http://fantom.org/'>Fantom</a> AST Viewer online.  You can check it out over on bitbucket:</p>
<p><a href='http://bitbucket.org/afrankvt/fanast/'>http://bitbucket.org/afrankvt/fanast/</a></p>
<p>Its pretty crude, but works, and should be pretty easy to fix or modify to suite your needs.</p>
<p><a href='http://bitbucket.org/afrankvt/fanast/'><img src='http://andyfrank.com/images/fanast-20100122-small.png' alt='Screenshot' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.andyfrank.com/blog/2010/01/fantom-ast-viewer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Letters.app</title>
		<link>http://www.andyfrank.com/blog/2010/01/lettersapp/</link>
		<comments>http://www.andyfrank.com/blog/2010/01/lettersapp/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 23:34:21 +0000</pubDate>
		<dc:creator>Andy Frank</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.andyfrank.com/blog/?p=121</guid>
		<description><![CDATA[After following the mailing list briefly, I figured this project was doomed from a &#8220;too many cooks in the kitchen&#8221; approach.  Good software is the result of a small group of really good people making really good decisions - often deciding what not to implement.  To be fair though, the S/N ratio was [...]]]></description>
			<content:encoded><![CDATA[<p>After following the mailing list briefly, I figured this project was doomed from a &#8220;too many cooks in the kitchen&#8221; approach.  Good software is the result of a small group of really good people making really good decisions - often deciding what <em>not</em> to implement.  To be fair though, the S/N ratio was very high, and it was good brainstorming, so I reserved judgment until I saw who was elected &#8220;president&#8221;.</p>
<p>So I was surprised when I saw that John Gruber was <a href='http://lists.ranchero.com/pipermail/email-init-ranchero.com/2010-January/000989.html'>elected</a> as &#8220;president&#8221;.  John gets Mac software and good software in general, so this little project still has alot potential.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andyfrank.com/blog/2010/01/lettersapp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Email Client?</title>
		<link>http://www.andyfrank.com/blog/2010/01/new-email-client/</link>
		<comments>http://www.andyfrank.com/blog/2010/01/new-email-client/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 15:19:08 +0000</pubDate>
		<dc:creator>Andy Frank</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.andyfrank.com/blog/?p=116</guid>
		<description><![CDATA[Very timely since I&#8217;ve been searching for a new email client (grown tired of using two different webapps to manage my personal and work email).  I&#8217;ve been using Postbox which is the best I&#8217;ve found - but still leaves a bit to be desired.  And while Postbox&#8217;s theme (its built on Thunderbird) is [...]]]></description>
			<content:encoded><![CDATA[<p>Very timely since I&#8217;ve been searching for a new email client (grown tired of using two different webapps to manage my personal and work email).  I&#8217;ve been using <a href='http://www.postbox-inc.com/'>Postbox</a> which is the best I&#8217;ve found - but still leaves a bit to be desired.  And while Postbox&#8217;s theme (its built on Thunderbird) is nice - still would love a pure-Cocoa client.</p>
<p>See info on Brent Simmon&#8217;s <a href='http://inessential.com/2010/01/16/email_init'>blog</a>.  Hope this goes somewhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andyfrank.com/blog/2010/01/new-email-client/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JavaScript try-catch bug?</title>
		<link>http://www.andyfrank.com/blog/2010/01/javascript-try-catch-bug/</link>
		<comments>http://www.andyfrank.com/blog/2010/01/javascript-try-catch-bug/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 18:21:40 +0000</pubDate>
		<dc:creator>Andy Frank</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.andyfrank.com/blog/?p=105</guid>
		<description><![CDATA[Ran across a seemingly bad bug either in Rhino or JavaScript language spec - haven&#8217;t had a chance to dig into.  But this pattern appears to let an exception raised in func() leak thru the surrounding try block:
  function foo()
  {
    try { return func(); }
    [...]]]></description>
			<content:encoded><![CDATA[<p>Ran across a seemingly bad bug either in Rhino or JavaScript language spec - haven&#8217;t had a chance to dig into.  But this pattern appears to let an exception raised in <code>func()</code> leak thru the surrounding try block:</p>
<pre>  function foo()
  {
    try { return func(); }
    catch (err) { ... }
  }</pre>
<p>I was able to work around by assigning to a local variable:</p>
<pre>  function foo()
  {
    try { var x = func(); return x; }
    catch (err) { ... }
  }</pre>
<p>Did a short Google on this, but nothing obvious turned up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andyfrank.com/blog/2010/01/javascript-try-catch-bug/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Reader</title>
		<link>http://www.andyfrank.com/blog/2009/08/google-reader/</link>
		<comments>http://www.andyfrank.com/blog/2009/08/google-reader/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 14:48:49 +0000</pubDate>
		<dc:creator>Andy Frank</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.andyfrank.com/blog/?p=84</guid>
		<description><![CDATA[I&#8217;ve used a number of RSS readers over the years, and even wrote a few of my own (Newsfox, Fizzle, Beatnik).  However, when I bought my MacBook Pro a few years ago, I settled on NetNewsWire as my app of choice.  After getting my iPhone, the NNW app was one of the first [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve used a number of RSS readers over the years, and even wrote a few of my own (<a href='http://www.andyfrank.com/work/newsfox.html'>Newsfox</a>, <a href='http://www.andyfrank.com/work/fizzle.html'>Fizzle</a>, <a href='http://www.andyfrank.com/work/beatnik.html'>Beatnik</a>).  However, when I bought my MacBook Pro a few years ago, I settled on <a href='http://www.newsgator.com/INDIVIDUALS/NETNEWSWIRE/'>NetNewsWire</a> as my app of choice.  After getting my iPhone, the NNW app was one of the first I downloaded.  I signed up for NewsGator to sync my feeds and read/unread between my phone and laptop.  I might have too many feeds for the iPhone app to work well, but it did its job, and I was pretty happy with the setup.</p>
<p>Not long after that, I realized I could access all my synced feeds in NewsGator from the browser.  So now I could read my synced feeds on my daytime Windows dev box.  The online NewsGator app is pretty much abysmal, but it works, and syncs, and since I couldn&#8217;t do any of that before, I was happy enough.</p>
<p>So when I got <a href='http://nnwbeta.com/2009/07/30/netnewswire_3_2_beta.html'>wind</a> that the next release of NNW was dropping NewsGator syncing in favor of <a href='http://www.google.com/reader'>Google Reader</a>, my ears perked up a bit.  On one hand thats interesting since NewsGator <em>bought</em> NNW, but I was more interested in the browser experience.  It had been several years since I&#8217;d tried out Google Reader, and while I thought it was <em>ok</em>, I don&#8217;t remember being overly impressed.</p>
<p>But I decided to give it another go.  I exported all my feeds from NNW and imported them effortlessly into Google Reader.  The UI seems to be the same as before.  But this time it &#8220;felt&#8221; alot better, not sure why (is it the enormous performance gains we&#8217;ve seen in the last year or two that makes it feel zippy now?).  I found it easy to scan and read all my feeds.  In fact, I like it so much I might just drop NNW altogether and use Google Reader exclusively.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andyfrank.com/blog/2009/08/google-reader/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Static Typing</title>
		<link>http://www.andyfrank.com/blog/2009/07/static-typing/</link>
		<comments>http://www.andyfrank.com/blog/2009/07/static-typing/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 20:02:34 +0000</pubDate>
		<dc:creator>Andy Frank</dc:creator>
		
		<category><![CDATA[Fantom]]></category>

		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.andyfrank.com/blog/?p=60</guid>
		<description><![CDATA[I&#8217;m not big on comparing the merits of different languages.  Every language I&#8217;ve used serves a good purpose for some task.  So I generally pick the best language for the task at hand.  
In general, though, I always tend to prefer static languages for anything but a small or quick and dirty [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not big on comparing the merits of different languages.  Every language I&#8217;ve used serves a good purpose for some task.  So I generally pick the best language for the task at hand.  </p>
<p>In general, though, I always tend to prefer static languages for anything but a small or quick and dirty project.  Especially when its a code base I intend to maintain for some time.</p>
<p>I just spent the weekend refactoring <a href='http://fandev.org/'>Fan&#8217;s</a> JavaScript <a href='http://fandev.org/doc/docLang/JavaScript.html'>compiler</a> to change how I model Fan fields in JavaScript.  The way I had previously done it looked like this:</p>
<pre>// Fan
class Foo { Int x := 5 }

// JavaScript
Foo.prototype.x$get = function() { return this.x; }
Foo.prototype.x$set = function(val) { this.x = val; }
Foo.prototype.x = 5;</pre>
<p>Which isn&#8217;t great, but didn&#8217;t really have alot of options.  But it seemed nice enough. It grouped the accessors and storage neatly together.  And in most cases, since I can access the storage directly, the code overall was fairly clean.</p>
<p>Unfortunately that model made it very difficult to make certain use cases of fields and methods work (like overriding a const field with a method).  So I changed the JavaScript to look like this:</p>
<pre>// Fan
class Foo { Int x := 5 }

// JavaScript
Foo.prototype.x = function() { return this.m_x; }
Foo.prototype.x$ = function(val) { this.m_x = val; }
Foo.prototype.m_x = 5;</pre>
<p>That change would have been a bit painful in any language, since there was just alot of code to update (the sys library and all the native implementations are written directly in JavaScript).</p>
<p>However, since JavaScript does not have static type checking, I pretty much had to tackle errors one-by-one using the test suite and Fresco (the web UI I&#8217;m developing at <a href='http://skyfoundry.com/'>SkyFoundry</a>).</p>
<p>This is probably the biggest reason I prefer static languages.  When you have to make sweeping changes on a large code base, you simply can&#8217;t verify your changes 100% in any language.  But a compiler with static type checking can help you tremendously.  Especially for code that is difficult to unit test, like UIs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andyfrank.com/blog/2009/07/static-typing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mounting a JavaFX applet from Javascript</title>
		<link>http://www.andyfrank.com/blog/2009/07/mounting-a-javafx-applet-from-javascript/</link>
		<comments>http://www.andyfrank.com/blog/2009/07/mounting-a-javafx-applet-from-javascript/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 14:42:52 +0000</pubDate>
		<dc:creator>Andy Frank</dc:creator>
		
		<category><![CDATA[JavaFX]]></category>

		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.andyfrank.com/blog/?p=52</guid>
		<description><![CDATA[There&#8217;s not a whole lot of documentation surrounding the Javascript deployment scripts the new Java Plug-in and JavaFX use (actually I couldn&#8217;t find any).  Luckily if you beautify the minimized code, its not too hard to figure out how things tick.
Out of the box, those scripts use document.write in place, which makes them very [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s not a whole lot of documentation surrounding the Javascript deployment scripts the new Java Plug-in and JavaFX use (actually I couldn&#8217;t find any).  Luckily if you beautify the minimized code, its not too hard to figure out how things tick.</p>
<p>Out of the box, those scripts use <code>document.write</code> in place, which makes them very problematic if the script is not inlined in the initial HTML page.  Trying to call them after the page is loaded will just nuke your document.</p>
<p>Luckily there&#8217;s a function (<code>javaFxString</code>) in the dtfx.js script that serializes the necessary code to a string which you can use:</p>
<pre>var s = javafxString({
          codebase: "/s/fwt/javafx/dist/",
          archive: "Canvas.jar",
          draggable: true,
          width:  200,
          height: 200,
          code: "fan.fwt.Canvas",
          name: "Canvas",
          id: "app"
      });
someElement.innerHTML = s;</pre>
<p>This will let you insert the JavaFx applet code anywhere in your DOM.  I only tried this in IE8 so far (since this is a workaround for IE-only).  But I assume this should work in all browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andyfrank.com/blog/2009/07/mounting-a-javafx-applet-from-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Javascript Bitshift Performance</title>
		<link>http://www.andyfrank.com/blog/2009/06/javascript-bitshift-performance/</link>
		<comments>http://www.andyfrank.com/blog/2009/06/javascript-bitshift-performance/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 16:59:00 +0000</pubDate>
		<dc:creator>Andy Frank</dc:creator>
		
		<category><![CDATA[Fantom]]></category>

		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.andyfrank.com/blog/?p=41</guid>
		<description><![CDATA[While working on 64-bit integer support in Javascript for Fan, I ran across a blurb about bit shift performance of Numbers.  The basic gist was, since Javascript has to convert the number to an integer, perform the op, then convert back, multiplying or dividing by a power of two should be as fast, or [...]]]></description>
			<content:encoded><![CDATA[<p>While working on 64-bit integer support in Javascript for <a href="http://fandev.org/">Fan</a>, I ran across a <a href="http://stackoverflow.com/questions/337355/javascript-bitwise-shift-of-long-long-number">blurb</a> about bit shift performance of Numbers.  The basic gist was, since Javascript has to convert the number to an integer, perform the op, then convert back, multiplying or dividing by a power of two should be as fast, or faster.  On the surface that might make sense, but I wanted to see for myself, so I hacked up a <em>very</em> naive test case:</p>
<pre>var x = 0xffff;

var s = new Date().getTime();
for (var i=0; i&lt;100000; i++) x = x &gt;&gt; 2;
var e = new Date().getTime();
var res1 = (e-s);

s = new Date().getTime();
for (var i=0; i&lt;100000; i++) x = x / 4;
e = new Date().getTime();
var res2 = (e-s); 

alert("&gt;&gt; " + res1 + "ms\n" + "/  " + res2 + "ms");</pre>
<p>Very unscientific results:</p>
<pre>Browser               &gt;&gt; 2    / 4
--------------------  ------  -------
Chrome 2.0.172.31     2-3ms   4-7ms
Firefox 3.0.11 (win)  11ms    15-16ms
Safari 3.1 (win)      15ms    15ms
IE8                   63ms    62-78ms
Opera 9.64 (win)      46ms    63ms</pre>
<p>Interesting to see the different performance b/w browsers, but also seems clear, overall, the bit-shift operators perform slightly better even with the box/unbox hit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andyfrank.com/blog/2009/06/javascript-bitshift-performance/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fan AST Viewer</title>
		<link>http://www.andyfrank.com/blog/2009/06/fan-ast-viewer/</link>
		<comments>http://www.andyfrank.com/blog/2009/06/fan-ast-viewer/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 19:19:04 +0000</pubDate>
		<dc:creator>Andy Frank</dc:creator>
		
		<category><![CDATA[Fantom]]></category>

		<guid isPermaLink="false">http://www.andyfrank.com/blog/?p=34</guid>
		<description><![CDATA[After spending way too much time trying to debug my Fan to Javascript compiler, I broke down and hacked up a little FWT-based AST viewer.  I&#8217;m pretty sure we&#8217;ll fold this into the core distro, just need to clean up the code first, and figure out where to put it.


]]></description>
			<content:encoded><![CDATA[<p>After spending way too much time trying to debug my Fan to Javascript <a href="http://fandev.org/doc/docLib/WebAppClient.html#compileToJavascript">compiler</a>, I broke down and hacked up a little <a href="http://fandev.org/doc/docLib/Fwt.html">FWT</a>-based AST viewer.  I&#8217;m pretty sure we&#8217;ll fold this into the core distro, just need to clean up the code first, and figure out where to put it.
</p>
<p><a href='http://andyfrank.com/images/fanast.png' style='background:none; border:none'><img src='http://andyfrank.com/images/fanastSmall.png' alt='Fan AST Viewer'/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.andyfrank.com/blog/2009/06/fan-ast-viewer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Extending built-in types</title>
		<link>http://www.andyfrank.com/blog/2009/06/extending-built-in-types/</link>
		<comments>http://www.andyfrank.com/blog/2009/06/extending-built-in-types/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 13:17:58 +0000</pubDate>
		<dc:creator>Andy Frank</dc:creator>
		
		<category><![CDATA[Fantom]]></category>

		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.andyfrank.com/blog/?p=5</guid>
		<description><![CDATA[I ran into an issue where I really needed to tag the built-in Javascript types with additional information to make Fan work better.  The big one is annotating a Number to be either a Int or Float, which you need to do to make all the equality checks work consistently (since 5 != 5f).
This is was [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into an issue where I really needed to tag the built-in Javascript types with additional information to make <a href="http://fandev.org/">Fan</a> work better.  The big one is annotating a Number to be either a <a href="http://fandev.org/doc/sys/Int.html">Int</a> or <a href="http://fandev.org/doc/sys/Float.html">Float</a>, which you need to do to make all the equality checks work consistently (since 5 != 5f).</p>
<p>This is was my first attempt, which I assumed would work:</p>
<pre>&gt;&gt;&gt; var x = 15;
&gt;&gt;&gt; x.$fanType = sys_Type.find("sys::Int");
&gt;&gt;&gt; x.$fanType
undefined</pre>
<p>But no dice.  After a bit of googling, I found this <a href="http://wsabstract.com/javatutors/proplit.shtml">page</a>, which says in order to add properties to the built-in types, you must create objects using the constructor syntax:</p>
<pre>&gt;&gt;&gt; var x = new Number(15);
&gt;&gt;&gt; x.$fanType = sys_Type.find("sys::Int");
&gt;&gt;&gt; x.$fanType
"sys::Int"</pre>
<p>I assume this a performance optimization, where you can use a primitive int value in the first case, and have to allocate an object in the latter.  Though since Javascript is a pure-OO language, I would be interested in seeing how VMs actually implement this behavoir.</p>
<p><b>Edit 8 Jun 09</b>: Just realized using the object syntax breaks equality checks for numbers:</p>
<pre>&gt;&gt;&gt; var x = new Number(4);
&gt;&gt;&gt; var y = new Number(4);
&gt;&gt;&gt; x == y
false</pre>
<p>Which sort of sucks, but you can work around it using <code>valueOf</code>, but still annoying.</p>
<pre>&gt;&gt;&gt; x.valueOf() == y.valueOf()
true</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.andyfrank.com/blog/2009/06/extending-built-in-types/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
