<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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>Comments for Whiley</title>
	<atom:link href="http://whiley.org/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://whiley.org</link>
	<description>A Programming Language with Extended Static Checking</description>
	<lastBuildDate>Fri, 20 Apr 2012 23:38:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>Comment on Termination of Flow Typing in Whiley by Dave</title>
		<link>http://whiley.org/2012/04/17/termination-of-flow-typing-in-whiley/comment-page-1/#comment-2528</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 20 Apr 2012 23:38:11 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3881#comment-2528</guid>
		<description>Yeah, I am definitely going to include units in some way.  However, I need to think through exactly how it will work.  So it&#039;ll take a little time before it filters in ...</description>
		<content:encoded><![CDATA[<p>Yeah, I am definitely going to include units in some way.  However, I need to think through exactly how it will work.  So it&#8217;ll take a little time before it filters in &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Are Checked Exceptions Always Caused by I/O? by Dave</title>
		<link>http://whiley.org/2012/04/10/are-checked-exceptions-always-caused-by-io/comment-page-1/#comment-2527</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 20 Apr 2012 23:36:45 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3689#comment-2527</guid>
		<description>Hey James,

Well, that&#039;s the interesting question ... one which I&#039;m hoping to find out the answer to soon enough!!</description>
		<content:encoded><![CDATA[<p>Hey James,</p>
<p>Well, that&#8217;s the interesting question &#8230; one which I&#8217;m hoping to find out the answer to soon enough!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Are Checked Exceptions Always Caused by I/O? by JamesG</title>
		<link>http://whiley.org/2012/04/10/are-checked-exceptions-always-caused-by-io/comment-page-1/#comment-2525</link>
		<dc:creator>JamesG</dc:creator>
		<pubDate>Fri, 20 Apr 2012 17:45:56 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3689#comment-2525</guid>
		<description>I suppose the next thought, w.r.t. Whiley is: how many unchecked exceptions are avoidable through usage of constraints?</description>
		<content:encoded><![CDATA[<p>I suppose the next thought, w.r.t. Whiley is: how many unchecked exceptions are avoidable through usage of constraints?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Termination of Flow Typing in Whiley by JamesG</title>
		<link>http://whiley.org/2012/04/17/termination-of-flow-typing-in-whiley/comment-page-1/#comment-2524</link>
		<dc:creator>JamesG</dc:creator>
		<pubDate>Fri, 20 Apr 2012 17:25:19 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3881#comment-2524</guid>
		<description>As I mentioned on twitter, I think that including an example of a Units and Measures would be very constructive.

(I have been an unabashed fan of units and measures in programming for some years.   Once when creating a simulation creation platform, I decided to add JScience to provide some clarity and flexibility to end users, allow for automatic conversions between equivalent units, and provide some basic operations on those measurements.   Once I had integrated them into my code, they pinpointed an error in the simulation that otherwise would have gone unnoticed for quite some time... and they worked beautifully for all the reasons I had intended to use them as well.)</description>
		<content:encoded><![CDATA[<p>As I mentioned on twitter, I think that including an example of a Units and Measures would be very constructive.</p>
<p>(I have been an unabashed fan of units and measures in programming for some years.   Once when creating a simulation creation platform, I decided to add JScience to provide some clarity and flexibility to end users, allow for automatic conversions between equivalent units, and provide some basic operations on those measurements.   Once I had integrated them into my code, they pinpointed an error in the simulation that otherwise would have gone unnoticed for quite some time&#8230; and they worked beautifully for all the reasons I had intended to use them as well.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Type Aliasing in Java? by Stefano73</title>
		<link>http://whiley.org/2012/03/02/type-aliasing-in-java/comment-page-1/#comment-2490</link>
		<dc:creator>Stefano73</dc:creator>
		<pubDate>Tue, 17 Apr 2012 08:44:13 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3691#comment-2490</guid>
		<description>Probably it&#039;s not what you need but it&#039;s seems to me a nice utility...

/**
 *
 * 
 *
**/
public class Alias {

	private T val;

        // create an alias for a &quot;type&quot;
	public static  Alias create(T elem) {
		Alias val = new Alias();
		val.val = elem;
		return val;
	}

        // create an alias alias or a copy ;-P
	public  Alias me(boolean forceCopy) {
		if (!forceCopy) {
			return (Alias) this;
		}
		Alias val = new Alias();
		val.val = (T) this.val;
		return val;
	}

        // holding value!
	public T value() {
		return val;
	}

	@SuppressWarnings(&quot;unchecked&quot;)
	public &lt;S extends Alias&gt; S as() {
		return (S) this;
	}

} // END


/**
 * The Class That Use Alias
 *
**/
class UsingAlias {

	public void aMethod(Alias aliasIntArray, Object someOtherValue) {
		System.out.println(someOtherValue + &quot; --&gt; &quot;
				+ Arrays.toString(aliasIntArray.&lt;Alias&gt; as().value()));
	}

	public static void main(String[] args) {

		int[] arr = { 1, 2, 3, 4, 5 };
		Alias sorted = Alias. create(arr);
		Alias sort2 = sorted. me(false);
		Alias sort3 = sorted. me(true);

		System.out.println(sorted + &quot; --&gt; &quot; + sorted.value());
		System.out.println(sort2);
		System.out.println(sort3);

		UsingAlias user = new UsingAlias();
		user.aMethod(sorted, &quot;Hello World!&quot;);

	}
}</description>
		<content:encoded><![CDATA[<p>Probably it&#8217;s not what you need but it&#8217;s seems to me a nice utility&#8230;</p>
<p>/**<br />
 *<br />
 *<br />
 *<br />
**/<br />
public class Alias {</p>
<p>	private T val;</p>
<p>        // create an alias for a &#8220;type&#8221;<br />
	public static  Alias create(T elem) {<br />
		Alias val = new Alias();<br />
		val.val = elem;<br />
		return val;<br />
	}</p>
<p>        // create an alias alias or a copy ;-P<br />
	public  Alias me(boolean forceCopy) {<br />
		if (!forceCopy) {<br />
			return (Alias) this;<br />
		}<br />
		Alias val = new Alias();<br />
		val.val = (T) this.val;<br />
		return val;<br />
	}</p>
<p>        // holding value!<br />
	public T value() {<br />
		return val;<br />
	}</p>
<p>	@SuppressWarnings(&#8220;unchecked&#8221;)<br />
	public &lt;S extends Alias&gt; S as() {<br />
		return (S) this;<br />
	}</p>
<p>} // END</p>
<p>/**<br />
 * The Class That Use Alias<br />
 *<br />
**/<br />
class UsingAlias {</p>
<p>	public void aMethod(Alias aliasIntArray, Object someOtherValue) {<br />
		System.out.println(someOtherValue + &#8221; &#8211;&gt; &#8221;<br />
				+ Arrays.toString(aliasIntArray.&lt;Alias&gt; as().value()));<br />
	}</p>
<p>	public static void main(String[] args) {</p>
<p>		int[] arr = { 1, 2, 3, 4, 5 };<br />
		Alias sorted = Alias. create(arr);<br />
		Alias sort2 = sorted. me(false);<br />
		Alias sort3 = sorted. me(true);</p>
<p>		System.out.println(sorted + &#8221; &#8211;&gt; &#8221; + sorted.value());<br />
		System.out.println(sort2);<br />
		System.out.println(sort3);</p>
<p>		UsingAlias user = new UsingAlias();<br />
		user.aMethod(sorted, &#8220;Hello World!&#8221;);</p>
<p>	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Termination of Flow Typing in Whiley by Dave</title>
		<link>http://whiley.org/2012/04/17/termination-of-flow-typing-in-whiley/comment-page-1/#comment-2488</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Tue, 17 Apr 2012 02:38:07 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3881#comment-2488</guid>
		<description>Hey Peter,

Yeah, this is strongly related to SSA form.  However, it&#039;s a bit easier for me since Whiley doesn&#039;t have unstructured control-flow.</description>
		<content:encoded><![CDATA[<p>Hey Peter,</p>
<p>Yeah, this is strongly related to SSA form.  However, it&#8217;s a bit easier for me since Whiley doesn&#8217;t have unstructured control-flow.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Termination of Flow Typing in Whiley by Peter Goodman</title>
		<link>http://whiley.org/2012/04/17/termination-of-flow-typing-in-whiley/comment-page-1/#comment-2487</link>
		<dc:creator>Peter Goodman</dc:creator>
		<pubDate>Tue, 17 Apr 2012 02:23:10 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3881#comment-2487</guid>
		<description>I immediately thought of SSA and ϕ nodes for this, and it seems like you have done something along those lines. I look forward to going deeper into this TR; great work! Reading your blog is always a pleasure.</description>
		<content:encoded><![CDATA[<p>I immediately thought of SSA and ϕ nodes for this, and it seems like you have done something along those lines. I look forward to going deeper into this TR; great work! Reading your blog is always a pleasure.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Termination of Flow Typing in Whiley by Dave</title>
		<link>http://whiley.org/2012/04/17/termination-of-flow-typing-in-whiley/comment-page-1/#comment-2486</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Tue, 17 Apr 2012 01:12:35 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3881#comment-2486</guid>
		<description>Hi Edmund,

Yeah, that&#039;s a common complaint against structural typing.  I may well include some constructs to help with this kind of situation.  For example, something like &lt;a href=&quot;http://blogs.msdn.com/b/andrewkennedy/archive/2008/08/29/units-of-measure-in-f-part-one-introducing-units.aspx&quot; rel=&quot;nofollow&quot;&gt;Units in F#&lt;/a&gt; would be interesting ...</description>
		<content:encoded><![CDATA[<p>Hi Edmund,</p>
<p>Yeah, that&#8217;s a common complaint against structural typing.  I may well include some constructs to help with this kind of situation.  For example, something like <a href="http://blogs.msdn.com/b/andrewkennedy/archive/2008/08/29/units-of-measure-in-f-part-one-introducing-units.aspx" rel="nofollow">Units in F#</a> would be interesting &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Termination of Flow Typing in Whiley by Edmund Horner</title>
		<link>http://whiley.org/2012/04/17/termination-of-flow-typing-in-whiley/comment-page-1/#comment-2485</link>
		<dc:creator>Edmund Horner</dc:creator>
		<pubDate>Tue, 17 Apr 2012 01:00:40 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3881#comment-2485</guid>
		<description>That does sound pretty neat, providing a good compromise between flexibility and strictness of types.  But I wonder if humans find it easier to give a name to something, and expect the name to officially tag it?  It feels like there&#039;s room to accidentally create a value of the &quot;correct&quot; type by inadvertently composing items similar types, without explicitly stating what is being created.  For instance:

define Temp as { int degrees; }
define Bearing as { int degrees; }

Temp heatInDirection(Bearing b):
    // TODO Somehow calculate the temperature seen in direction b
    return b  // Oops, type system didn&#039;t stop us doing something dumb!
</description>
		<content:encoded><![CDATA[<p>That does sound pretty neat, providing a good compromise between flexibility and strictness of types.  But I wonder if humans find it easier to give a name to something, and expect the name to officially tag it?  It feels like there&#8217;s room to accidentally create a value of the &#8220;correct&#8221; type by inadvertently composing items similar types, without explicitly stating what is being created.  For instance:</p>
<p>define Temp as { int degrees; }<br />
define Bearing as { int degrees; }</p>
<p>Temp heatInDirection(Bearing b):<br />
    // TODO Somehow calculate the temperature seen in direction b<br />
    return b  // Oops, type system didn&#8217;t stop us doing something dumb!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Termination of Flow Typing in Whiley by Dave</title>
		<link>http://whiley.org/2012/04/17/termination-of-flow-typing-in-whiley/comment-page-1/#comment-2484</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Mon, 16 Apr 2012 23:59:29 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3881#comment-2484</guid>
		<description>Hi Edmund,

That&#039;s the beauty of structural typing.  The name is only superficial.  Think of it as like a C macro which is always expanded.  So, LongMove is really just the type {Piece piece,LongPos from,LongPos to} --- nothing more.  Whenever you see LongMove, the compiler automatically expands it.  So, before the assignment, m has type {Piece piece,ShortPos from,LongPos to} and then afterwards its type is the same LongMove&#039;s.</description>
		<content:encoded><![CDATA[<p>Hi Edmund,</p>
<p>That&#8217;s the beauty of structural typing.  The name is only superficial.  Think of it as like a C macro which is always expanded.  So, LongMove is really just the type {Piece piece,LongPos from,LongPos to} &#8212; nothing more.  Whenever you see LongMove, the compiler automatically expands it.  So, before the assignment, m has type {Piece piece,ShortPos from,LongPos to} and then afterwards its type is the same LongMove&#8217;s.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Termination of Flow Typing in Whiley by Edmund Horner</title>
		<link>http://whiley.org/2012/04/17/termination-of-flow-typing-in-whiley/comment-page-1/#comment-2483</link>
		<dc:creator>Edmund Horner</dc:creator>
		<pubDate>Mon, 16 Apr 2012 22:48:32 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3881#comment-2483</guid>
		<description>Hey Dave, just a question,

&lt;blockquote&gt;The critical issue resolves around the statement m.from = matches[0]. This retypes variable m from ShortMove to LongMove...&lt;/blockquote&gt;

How does it know to retype &lt;code&gt;m&lt;/code&gt; to &lt;code&gt;LongMove&lt;/code&gt;?  Since it seems to be a forward analysis, and there are no loops in the function, I&#039;m assuming it can&#039;t use the subsequent return statement to infer the new type.

Let&#039;s say there is another type &lt;code&gt;X&lt;/code&gt; in scope with a field &lt;code&gt;LongPos from&lt;/code&gt;.  Will it retype &lt;code&gt;m&lt;/code&gt; as &lt;code&gt;LongMove &#124; X&lt;/code&gt; ?</description>
		<content:encoded><![CDATA[<p>Hey Dave, just a question,</p>
<blockquote><p>The critical issue resolves around the statement m.from = matches[0]. This retypes variable m from ShortMove to LongMove&#8230;</p></blockquote>
<p>How does it know to retype <code>m</code> to <code>LongMove</code>?  Since it seems to be a forward analysis, and there are no loops in the function, I&#8217;m assuming it can&#8217;t use the subsequent return statement to infer the new type.</p>
<p>Let&#8217;s say there is another type <code>X</code> in scope with a field <code>LongPos from</code>.  Will it retype <code>m</code> as <code>LongMove | X</code> ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Flow Typing by Whiley &#124; Termination of Flow Typing in Whiley</title>
		<link>http://whiley.org/guide/typing/flow-typing/comment-page-1/#comment-2482</link>
		<dc:creator>Whiley &#124; Termination of Flow Typing in Whiley</dc:creator>
		<pubDate>Mon, 16 Apr 2012 21:02:22 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?page_id=1564#comment-2482</guid>
		<description>[...] Flow Typing [...]</description>
		<content:encoded><![CDATA[<p>[...] Flow Typing [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Are Checked Exceptions Always Caused by I/O? by Dave</title>
		<link>http://whiley.org/2012/04/10/are-checked-exceptions-always-caused-by-io/comment-page-1/#comment-2481</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Sun, 15 Apr 2012 20:55:49 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3689#comment-2481</guid>
		<description>Hey,

Yeah, that&#039;s basically what I do.  I call it &quot;tunneling&quot;, since I have to do both directions: wrapping I/O exceptions with CoreExceptions and vice versa.

Dave</description>
		<content:encoded><![CDATA[<p>Hey,</p>
<p>Yeah, that&#8217;s basically what I do.  I call it &#8220;tunneling&#8221;, since I have to do both directions: wrapping I/O exceptions with CoreExceptions and vice versa.</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Are Checked Exceptions Always Caused by I/O? by None</title>
		<link>http://whiley.org/2012/04/10/are-checked-exceptions-always-caused-by-io/comment-page-1/#comment-2480</link>
		<dc:creator>None</dc:creator>
		<pubDate>Sun, 15 Apr 2012 12:47:03 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3689#comment-2480</guid>
		<description>You don&#039;t need to make your build framework depend on eclipse, but the plugin you are making does need to depend on eclipse. So you have a plugin module/project separate to your actual build framework module/project. The plugin module acts as a wrapper passing on invocations and catching your ioexceptions to throw the coreexceptions.</description>
		<content:encoded><![CDATA[<p>You don&#8217;t need to make your build framework depend on eclipse, but the plugin you are making does need to depend on eclipse. So you have a plugin module/project separate to your actual build framework module/project. The plugin module acts as a wrapper passing on invocations and catching your ioexceptions to throw the coreexceptions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Test to Code Ratio by Mark Rickerby</title>
		<link>http://whiley.org/2012/03/08/test-to-code-ratio/comment-page-1/#comment-2474</link>
		<dc:creator>Mark Rickerby</dc:creator>
		<pubDate>Fri, 06 Apr 2012 06:17:15 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3735#comment-2474</guid>
		<description>In my opinion, in very large systems, the differences between Ruby/Python/Java/C# etc tend to bleed together, and the question of test ratios in static vs dynamic languages is probably more relevant in the context of testing smaller domain specific libraries.

Once you reach a certain scale, you‘re no longer thinking in terms of a single codebase—the boundaries of any significantly large system are very blurred. It’s difficult to determine where the system system starts and ends, when it’s interacting with large volumes of data, external services, and real-time feeds from the outside world.

In these situations (especially where very large codebases are unavoidable), a strict compiler might be useful in constraining local boundary conditions of a function, but in any case, regardless of static or dynamic, the architectural emphasis needs to be on immutability. If a codebase cannot be constrained to control mutable objects and data structures, then the amount of unit+integration tests needed will increase enormously, and this is just as true for static languages as dynamic ones.

“100 functions operating on 1 data structure is better than 10 functions operating on 10 data structures.”</description>
		<content:encoded><![CDATA[<p>In my opinion, in very large systems, the differences between Ruby/Python/Java/C# etc tend to bleed together, and the question of test ratios in static vs dynamic languages is probably more relevant in the context of testing smaller domain specific libraries.</p>
<p>Once you reach a certain scale, you‘re no longer thinking in terms of a single codebase—the boundaries of any significantly large system are very blurred. It’s difficult to determine where the system system starts and ends, when it’s interacting with large volumes of data, external services, and real-time feeds from the outside world.</p>
<p>In these situations (especially where very large codebases are unavoidable), a strict compiler might be useful in constraining local boundary conditions of a function, but in any case, regardless of static or dynamic, the architectural emphasis needs to be on immutability. If a codebase cannot be constrained to control mutable objects and data structures, then the amount of unit+integration tests needed will increase enormously, and this is just as true for static languages as dynamic ones.</p>
<p>“100 functions operating on 1 data structure is better than 10 functions operating on 10 data structures.”</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Whiley v0.3.10 Released! by corndogs</title>
		<link>http://whiley.org/2011/09/21/whiley-v0-3-10-released/comment-page-1/#comment-2368</link>
		<dc:creator>corndogs</dc:creator>
		<pubDate>Tue, 20 Mar 2012 20:27:15 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3033#comment-2368</guid>
		<description>Thanks a lot for sharing this with all folks you really realize what you&#039;re speaking approximately! Bookmarked. Kindly additionally visit my site =). We can have a link trade arrangement among us!</description>
		<content:encoded><![CDATA[<p>Thanks a lot for sharing this with all folks you really realize what you&#8217;re speaking approximately! Bookmarked. Kindly additionally visit my site =). We can have a link trade arrangement among us!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Whiley v0.3.14 Released! by Dave</title>
		<link>http://whiley.org/2012/03/07/whiley-v0-3-14-released/comment-page-1/#comment-2367</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Tue, 20 Mar 2012 20:09:32 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3781#comment-2367</guid>
		<description>Hi Sarino,

Actually, in fact, there&#039;s nothing wrong!!  At the moment, compile-time checking of constraints is disabled.  Basically, because I&#039;ve been working on getting the core language to work properly.

These constraints are checked at runtime, and in the very near future I will be turning compile-time checking back on.  In the meantime, if you&#039;re interested in the compile-time checking, then use version 0.3.1 --- that&#039;s the last good version compile-time checking turned on.  In that version, you need to used &quot;wyjc -V&quot; to enable compile-time checking of constraints.

Thanks,

Dave</description>
		<content:encoded><![CDATA[<p>Hi Sarino,</p>
<p>Actually, in fact, there&#8217;s nothing wrong!!  At the moment, compile-time checking of constraints is disabled.  Basically, because I&#8217;ve been working on getting the core language to work properly.</p>
<p>These constraints are checked at runtime, and in the very near future I will be turning compile-time checking back on.  In the meantime, if you&#8217;re interested in the compile-time checking, then use version 0.3.1 &#8212; that&#8217;s the last good version compile-time checking turned on.  In that version, you need to used &#8220;wyjc -V&#8221; to enable compile-time checking of constraints.</p>
<p>Thanks,</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Whiley v0.3.14 Released! by Sarino Suon</title>
		<link>http://whiley.org/2012/03/07/whiley-v0-3-14-released/comment-page-1/#comment-2364</link>
		<dc:creator>Sarino Suon</dc:creator>
		<pubDate>Tue, 20 Mar 2012 11:01:52 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3781#comment-2364</guid>
		<description>Hi, Dave:

I thought I would give Whiley a spin, after playing around with ATS for a while. Having some of the same type precision as ATS yet coexisting with the Java ecosystem is very appealing.

However, I ran into a problem right away, attempting to run an example from the video demo.

The following code compiles without error, which it should not:
===========================================
int f(int x) ensures $ &gt; 1000:
    return x
===========================================

In fact, the following simpler version also compiles, incorrectly:
===========================================
int f(int x) ensures $ &gt; 0:
    return x
===========================================


I am using version 0.3.14 on java 1.6.0_22.

The command I used was:
    bin/wyjc test.whiley


Am I doing anything wrong?

Thanks.</description>
		<content:encoded><![CDATA[<p>Hi, Dave:</p>
<p>I thought I would give Whiley a spin, after playing around with ATS for a while. Having some of the same type precision as ATS yet coexisting with the Java ecosystem is very appealing.</p>
<p>However, I ran into a problem right away, attempting to run an example from the video demo.</p>
<p>The following code compiles without error, which it should not:<br />
===========================================<br />
int f(int x) ensures $ &gt; 1000:<br />
    return x<br />
===========================================</p>
<p>In fact, the following simpler version also compiles, incorrectly:<br />
===========================================<br />
int f(int x) ensures $ &gt; 0:<br />
    return x<br />
===========================================</p>
<p>I am using version 0.3.14 on java 1.6.0_22.</p>
<p>The command I used was:<br />
    bin/wyjc test.whiley</p>
<p>Am I doing anything wrong?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Test to Code Ratio by Nigel Charman</title>
		<link>http://whiley.org/2012/03/08/test-to-code-ratio/comment-page-1/#comment-2266</link>
		<dc:creator>Nigel Charman</dc:creator>
		<pubDate>Sat, 10 Mar 2012 06:02:24 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3735#comment-2266</guid>
		<description>&lt;blockquote&gt;
&quot;the presenter claimed that for Java (and possibly .Net), the ratio should be roughly 1:1&quot;
&lt;/blockquote&gt;

I don&#039;t agree. You&#039;ll typically need a much ratio of LTC to LPC. Think how many lines of JUnit it takes to cover a single condition. 

The only empirical evidence I&#039;ve seen was a survey that Agitar commissioned of open-source projects, and it&#039;s own code base.  This concluded that a ratio of about 1:4 (LPC:LTC) was sufficient for about 80% test coverage.  [This was published at openquality.org, but the site has been taken down.]

And using a TDD approach, I&#039;d say I write the same number of tests for static and dynamic languages.  

When using dynamic languages, I do find that the test code is shorter. However this is negated by the reduction in IDE support for generating production code from failing tests (eg. create missing classes, create missing methods, add parameter etc).  This is certainly the case for Groovy in Eclipse, maybe less so for other languages/IDEs?</description>
		<content:encoded><![CDATA[<blockquote><p>
&#8220;the presenter claimed that for Java (and possibly .Net), the ratio should be roughly 1:1&#8243;
</p></blockquote>
<p>I don&#8217;t agree. You&#8217;ll typically need a much ratio of LTC to LPC. Think how many lines of JUnit it takes to cover a single condition. </p>
<p>The only empirical evidence I&#8217;ve seen was a survey that Agitar commissioned of open-source projects, and it&#8217;s own code base.  This concluded that a ratio of about 1:4 (LPC:LTC) was sufficient for about 80% test coverage.  [This was published at openquality.org, but the site has been taken down.]</p>
<p>And using a TDD approach, I&#8217;d say I write the same number of tests for static and dynamic languages.  </p>
<p>When using dynamic languages, I do find that the test code is shorter. However this is negated by the reduction in IDE support for generating production code from failing tests (eg. create missing classes, create missing methods, add parameter etc).  This is certainly the case for Groovy in Eclipse, maybe less so for other languages/IDEs?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Type Aliasing in Java? by Dave</title>
		<link>http://whiley.org/2012/03/02/type-aliasing-in-java/comment-page-1/#comment-2201</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 02 Mar 2012 21:47:48 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3691#comment-2201</guid>
		<description>Hey Johnie,

Yeah, I agree, annotations are a good solution here --- why did I think of that!!

D</description>
		<content:encoded><![CDATA[<p>Hey Johnie,</p>
<p>Yeah, I agree, annotations are a good solution here &#8212; why did I think of that!!</p>
<p>D</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Type Aliasing in Java? by kj</title>
		<link>http://whiley.org/2012/03/02/type-aliasing-in-java/comment-page-1/#comment-2200</link>
		<dc:creator>kj</dc:creator>
		<pubDate>Fri, 02 Mar 2012 14:09:31 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3691#comment-2200</guid>
		<description>ie of alias sorted of int[] I propose

alias int[] sorted;

private alias int[] sorted; // as in type to name
This is more inline with
private static String thing; // as in type name

The idea just introduces some syntactic sugar without for any guarantees, the sorted does not actual guarantee that is sorted. So I think that an actual object SortedIntArray seems more reliable. And reliability &gt; syntactic sugar.</description>
		<content:encoded><![CDATA[<p>ie of alias sorted of int[] I propose</p>
<p>alias int[] sorted;</p>
<p>private alias int[] sorted; // as in type to name<br />
This is more inline with<br />
private static String thing; // as in type name</p>
<p>The idea just introduces some syntactic sugar without for any guarantees, the sorted does not actual guarantee that is sorted. So I think that an actual object SortedIntArray seems more reliable. And reliability &gt; syntactic sugar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Type Aliasing in Java? by Johnie</title>
		<link>http://whiley.org/2012/03/02/type-aliasing-in-java/comment-page-1/#comment-2198</link>
		<dc:creator>Johnie</dc:creator>
		<pubDate>Fri, 02 Mar 2012 08:43:48 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3691#comment-2198</guid>
		<description>Use a custom annotation

@Retention(RetentionPolicy.SOURCE)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.Parameter})
@interface Sorted {
}


then use it with:

int findLowest(@Sorted int[] arr, int value) {
   ...
}

OR 

@Sorted char[] myArray;
@Sorted String[] myStringArray;

OR on return values:

public @Sorted int[] getFunctionName()


If all you&#039;re looking for is documentation, this is the better strategy than trying to type alias.  This is also more accepted and easier to read than type alias.</description>
		<content:encoded><![CDATA[<p>Use a custom annotation</p>
<p>@Retention(RetentionPolicy.SOURCE)<br />
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.Parameter})<br />
@interface Sorted {<br />
}</p>
<p>then use it with:</p>
<p>int findLowest(@Sorted int[] arr, int value) {<br />
   &#8230;<br />
}</p>
<p>OR </p>
<p>@Sorted char[] myArray;<br />
@Sorted String[] myStringArray;</p>
<p>OR on return values:</p>
<p>public @Sorted int[] getFunctionName()</p>
<p>If all you&#8217;re looking for is documentation, this is the better strategy than trying to type alias.  This is also more accepted and easier to read than type alias.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Type Aliasing in Java? by Norswap</title>
		<link>http://whiley.org/2012/03/02/type-aliasing-in-java/comment-page-1/#comment-2197</link>
		<dc:creator>Norswap</dc:creator>
		<pubDate>Fri, 02 Mar 2012 07:50:09 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3691#comment-2197</guid>
		<description>You can just do:

class MyType extends WhateverYouWant {}

Granted, it&#039;s a bit hackish and may incur a tiny weeny performance overhead, but it seems to work well otherwise. You&#039;ll need a cast once a while tough.</description>
		<content:encoded><![CDATA[<p>You can just do:</p>
<p>class MyType extends WhateverYouWant {}</p>
<p>Granted, it&#8217;s a bit hackish and may incur a tiny weeny performance overhead, but it seems to work well otherwise. You&#8217;ll need a cast once a while tough.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Problem of Decoupling? by egon</title>
		<link>http://whiley.org/2012/02/29/a-problem-of-decoupling/comment-page-1/#comment-2187</link>
		<dc:creator>egon</dc:creator>
		<pubDate>Wed, 29 Feb 2012 08:55:35 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3651#comment-2187</guid>
		<description>What I would do in this case is, add some class overriding methods to Path.ID. (without making a separate factory, as it&#039;s unnecessary)

&lt;code&gt;
private static Class actualClass = ID;

public static ID create();
public static void setClass( Class clz );
&lt;/code&gt;

And then set adaptor with setClass, and in create use actualClass to create the instance.</description>
		<content:encoded><![CDATA[<p>What I would do in this case is, add some class overriding methods to Path.ID. (without making a separate factory, as it&#8217;s unnecessary)</p>
<p><code><br />
private static Class actualClass = ID;</p>
<p>public static ID create();<br />
public static void setClass( Class clz );<br />
</code></p>
<p>And then set adaptor with setClass, and in create use actualClass to create the instance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Problem of Decoupling? by kebernet</title>
		<link>http://whiley.org/2012/02/29/a-problem-of-decoupling/comment-page-1/#comment-2186</link>
		<dc:creator>kebernet</dc:creator>
		<pubDate>Wed, 29 Feb 2012 02:18:04 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3651#comment-2186</guid>
		<description>http://dozer.sourceforge.net/documentation/annotations.html</description>
		<content:encoded><![CDATA[<p><a href="http://dozer.sourceforge.net/documentation/annotations.html" rel="nofollow">http://dozer.sourceforge.net/documentation/annotations.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Problem of Decoupling? by Kevin</title>
		<link>http://whiley.org/2012/02/29/a-problem-of-decoupling/comment-page-1/#comment-2185</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Wed, 29 Feb 2012 00:13:50 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3651#comment-2185</guid>
		<description>you want clojure protocols/multimethods or haskell type classes

in clojure Path.ID would be a protocol that the plugin could extend to IPath

java style interfaces have the problem of not being injectable/extendable to types you don&#039;t own

http://clojure.org/protocols
http://book.realworldhaskell.org/read/using-typeclasses.html</description>
		<content:encoded><![CDATA[<p>you want clojure protocols/multimethods or haskell type classes</p>
<p>in clojure Path.ID would be a protocol that the plugin could extend to IPath</p>
<p>java style interfaces have the problem of not being injectable/extendable to types you don&#8217;t own</p>
<p><a href="http://clojure.org/protocols" rel="nofollow">http://clojure.org/protocols</a><br />
<a href="http://book.realworldhaskell.org/read/using-typeclasses.html" rel="nofollow">http://book.realworldhaskell.org/read/using-typeclasses.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Problem of Decoupling? by Andrew</title>
		<link>http://whiley.org/2012/02/29/a-problem-of-decoupling/comment-page-1/#comment-2184</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Tue, 28 Feb 2012 22:39:10 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3651#comment-2184</guid>
		<description>I was thinking about swapping the class out at run-time, I&#039;m not sure how tolerate Java is about that. 
But compile time would work too.


Obviously when building new things that use Path.ID you&#039;ll have to test against both versions.</description>
		<content:encoded><![CDATA[<p>I was thinking about swapping the class out at run-time, I&#8217;m not sure how tolerate Java is about that.<br />
But compile time would work too.</p>
<p>Obviously when building new things that use Path.ID you&#8217;ll have to test against both versions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Problem of Decoupling? by Dave</title>
		<link>http://whiley.org/2012/02/29/a-problem-of-decoupling/comment-page-1/#comment-2183</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Tue, 28 Feb 2012 22:27:49 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3651#comment-2183</guid>
		<description>Hi Andrew,

Yeah, so basically have different versions of Path.ID, depending on whether I&#039;m compiling for Eclipse or stand-alone.  Yeah, that&#039;s workable ... but still not exactly elegant :)

D</description>
		<content:encoded><![CDATA[<p>Hi Andrew,</p>
<p>Yeah, so basically have different versions of Path.ID, depending on whether I&#8217;m compiling for Eclipse or stand-alone.  Yeah, that&#8217;s workable &#8230; but still not exactly elegant <img src='http://whiley.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>D</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Problem of Decoupling? by Andrew</title>
		<link>http://whiley.org/2012/02/29/a-problem-of-decoupling/comment-page-1/#comment-2182</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Tue, 28 Feb 2012 22:24:51 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3651#comment-2182</guid>
		<description>Why not just make Path.ID&#039;s interface compatible with IPath, so you can swap out the naked Path.ID interface with the IPath as a base interface (ahh inheritance of interfaces :))

My guess is that IPath will probably provide more methods then Path.ID, so you might want Path.ID to actually be an abstract class that can fill/stub the functionality.

Technically you would only use Path.ID extends IPath when you want eclipse support (via an optional jar or similar) so you wouldn&#039;t _require_ eclipse.</description>
		<content:encoded><![CDATA[<p>Why not just make Path.ID&#8217;s interface compatible with IPath, so you can swap out the naked Path.ID interface with the IPath as a base interface (ahh inheritance of interfaces <img src='http://whiley.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
<p>My guess is that IPath will probably provide more methods then Path.ID, so you might want Path.ID to actually be an abstract class that can fill/stub the functionality.</p>
<p>Technically you would only use Path.ID extends IPath when you want eclipse support (via an optional jar or similar) so you wouldn&#8217;t _require_ eclipse.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Writing a PNG Decoder in Whiley! by Dave</title>
		<link>http://whiley.org/2012/02/18/writing-a-png-decoder-in-whiley/comment-page-1/#comment-2143</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Sat, 18 Feb 2012 07:16:31 +0000</pubDate>
		<guid isPermaLink="false">http://whiley.org/?p=3606#comment-2143</guid>
		<description>Hey Edmund!

So, pretty much what you describe is what I would expect to happen.  The key thing is that the decoder *should* produce an error message if it&#039;s asked to decode an invalid file.  The constraints are a form of backup.  If the programmer forgets to check something, then we still want it to fail.  With compile-time checking of constraints, this works even better because the programmer cannot construct an instance of the data structure without first checking the necessary constraints (i.e. the compiler spits out an error if he/she doesn&#039;t check them and report an appropriate error).  Think of it as an additional safety net...

Yeah, there is no bootstrapping compiler.  This is a specific choice.  Essentially, I think there&#039;s more value in writing these kind of real-world benchmarks first, rather than rebuilding what I already have.  However, I am going to start converting the compiler into Whiley.  In fact, I&#039;ve already begun ... another one of my benchmarks is a library for manipulating Java bytecode.  When this is finished, I&#039;ll slot it in to replace the Java library I currently use in the compiler.  Towards the end of the year I plan to get serious about rewriting the whole compiler in Whiley.</description>
		<content:encoded><![CDATA[<p>Hey Edmund!</p>
<p>So, pretty much what you describe is what I would expect to happen.  The key thing is that the decoder *should* produce an error message if it&#8217;s asked to decode an invalid file.  The constraints are a form of backup.  If the programmer forgets to check something, then we still want it to fail.  With compile-time checking of constraints, this works even better because the programmer cannot construct an instance of the data structure without first checking the necessary constraints (i.e. the compiler spits out an error if he/she doesn&#8217;t check them and report an appropriate error).  Think of it as an additional safety net&#8230;</p>
<p>Yeah, there is no bootstrapping compiler.  This is a specific choice.  Essentially, I think there&#8217;s more value in writing these kind of real-world benchmarks first, rather than rebuilding what I already have.  However, I am going to start converting the compiler into Whiley.  In fact, I&#8217;ve already begun &#8230; another one of my benchmarks is a library for manipulating Java bytecode.  When this is finished, I&#8217;ll slot it in to replace the Java library I currently use in the compiler.  Towards the end of the year I plan to get serious about rewriting the whole compiler in Whiley.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.468 seconds -->

