[racket] Ceylon language borrows Typed Racket features?

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Tue Nov 15 14:24:31 EST 2011

On Monday, November 14, 2011, Luke Vilnis wrote:

> Has anyone taken a look at the upcoming language Ceylon<http://in.relation.to/Tutorials/IntroductionToCeylon>?
> 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.

I had seen a little bit about Ceylon, but it's good to know that other
people are finding similar ideas useful.

> It looks like the language includes a basically verbatim copy of TR's
> dotted type parameters, which it calls "sequenced type parameters<http://in.relation.to/Bloggers/IntroductionToCeylonPart8#H-RepresentingTheTypeOfAFunction>".
> For example, the supertype of all tuples is written Tuple<T,P...><http://in.relation.to/Bloggers/TuplesOrNot>
> .

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.

> It also has untagged union types<http://in.relation.to/Bloggers/IntroductionToCeylonPart5>(written like
> Int|Bool) which can be deconstructed with switch-case statements, sort of
> like a watered down version of occurence typing:
> switch (foo)
> case (is Bool) {
>     // this type checks
>     local isTrue = foo || true;
>     ...
> }
> case (is Int) {
>     // so does this!
>     local x = foo + 1;
>     ...
> }

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.

sam th

sam th
samth at ccs.neu.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111115/a4503f29/attachment.html>

Posted on the users mailing list.