<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're ripped straight out of Typed Racket.</div>
</blockquote><div><br></div><div>I had seen a little bit about Ceylon, but it'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's dotted type parameters, which it calls "<a href="http://in.relation.to/Bloggers/IntroductionToCeylonPart8#H-RepresentingTheTypeOfAFunction" target="_blank">sequenced type parameters</a>". For example, the supertype of all tuples is written <a href="http://in.relation.to/Bloggers/TuplesOrNot" target="_blank">Tuple<T,P...></a>.</div>
</blockquote><div><br></div><div>In the interests of full disclosure, they're probably copying C++ templates here, which have a similar but less expressive design to Typed Racket'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="'courier new', monospace">Int|Bool</font>) which can be deconstructed with <font face="'courier new', monospace">switch-case</font> statements, sort of like a watered down version of occurence typing:</div>
<div><br></div><div><font face="'courier new', monospace">switch (foo)</font></div><div><font face="'courier new', monospace">case (is Bool) {</font></div>
<div><font face="'courier new', monospace"> // this type checks</font></div><div><font face="'courier new', monospace"> local isTrue = foo || true;</font></div>
<div><font face="'courier new', monospace"> ...</font></div><div><font face="'courier new', monospace">} </font></div><div><font face="'courier new', monospace">case (is Int) {</font></div>
<div><font face="'courier new', monospace"> // so does this!</font></div><div><font face="'courier new', monospace"> local x = foo + 1;</font></div><div>
<font face="'courier new', monospace"> ...</font></div><div><font face="'courier new', monospace">}</font></div></blockquote><div><br></div><div>One interesting note here is that this almost certainly compiles to the usual `instanceof' 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>