<br><br>On Monday, November 14, 2011, Luke Vilnis  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Has anyone taken a look at the upcoming language <a href="http://in.relation.to/Tutorials/IntroductionToCeylon" target="_blank">Ceylon</a>? It feels to me like a pretty aggressively blub-y Java clone, but it has two features that seem like they&#39;re ripped straight out of Typed Racket.</div>
</blockquote><div><br></div><div>I had seen a little bit about Ceylon, but it&#39;s good to know that other people are finding similar ideas useful.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>It looks like the language includes a basically verbatim copy of TR&#39;s dotted type parameters, which it calls &quot;<a href="http://in.relation.to/Bloggers/IntroductionToCeylonPart8#H-RepresentingTheTypeOfAFunction" target="_blank">sequenced type parameters</a>&quot;. For example, the supertype of all tuples is written <a href="http://in.relation.to/Bloggers/TuplesOrNot" target="_blank">Tuple&lt;T,P...&gt;</a>.</div>
</blockquote><div><br></div><div>In the interests of full disclosure, they&#39;re probably copying C++ templates here, which have a similar but less expressive design to Typed Racket&#39;s variable-arity polymorphism.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>It also has <a href="http://in.relation.to/Bloggers/IntroductionToCeylonPart5" target="_blank">untagged union types</a> (written like <font face="&#39;courier new&#39;, monospace">Int|Bool</font>) which can be deconstructed with <font face="&#39;courier new&#39;, monospace">switch-case</font> statements, sort of like a watered down version of occurence typing:</div>

<div><br></div><div><font face="&#39;courier new&#39;, monospace">switch (foo)</font></div><div><font face="&#39;courier new&#39;, monospace">case (is Bool) {</font></div>
<div><font face="&#39;courier new&#39;, monospace">    // this type checks</font></div><div><font face="&#39;courier new&#39;, monospace">    local isTrue = foo || true;</font></div>
<div><font face="&#39;courier new&#39;, monospace">    ...</font></div><div><font face="&#39;courier new&#39;, monospace">} </font></div><div><font face="&#39;courier new&#39;, monospace">case (is Int) {</font></div>
<div><font face="&#39;courier new&#39;, monospace">    // so does this!</font></div><div><font face="&#39;courier new&#39;, monospace">    local x = foo + 1;</font></div><div>
<font face="&#39;courier new&#39;, monospace">    ...</font></div><div><font face="&#39;courier new&#39;, monospace">}</font></div></blockquote><div><br></div><div>One interesting note here is that this almost certainly compiles to the usual `instanceof&#39; and cast in the JVM bytecode, which is then analyzed to eliminate the cast by the JIT compiler.  </div>
<div><br></div><div>sam th </div><br><br>-- <br>sam th<br><a href="mailto:samth@ccs.neu.edu">samth@ccs.neu.edu</a><br>