4 ms·
Ceylon and Kotlin both came out in 2011 and neither was popular. I was hoping Ceylon would come out on top as giving the most without incurring the complexity o
by karmakaze 4y ago
Ceylon and Kotlin both came out in 2011 and neither was popular. I was hoping Ceylon would come out on top as giving the most without incurring the complexity of Scala (which can co-exist for other uses/users).
From Ceylon Wikipedia[0]
> Null safety
> Union and intersection types are used to provide null safety. The top type of the Ceylon type hierarchy is the class Anything, which has two subclasses: Object, the superclass of all normal classes and all interfaces, and Null, with the only instance null. Since Object and Null are disjoint types, most regular types like Integer or List<String> are not nullable; a nullable type is the union Integer|Null, abbreviated Integer?.
So not only do we get null safety, we get both intersection and union types. The emphasis on immutability is also a great selling feature, but perhaps that limited its interoperability with Java collections and adoption.
[0] https://en.wikipedia.org/wiki/Ceylon_(programming_language) https://en.wikipedia.org/wiki/Ceylon_(programming_language)
- karmakaze 4y agoIs there a language for the JVM with union types that's gaining any popularity? [Edit: Scala 3+ any others?] TypeScript is a bit of an outlier in this respect of being widely adopted with this particularly useful feature. Null-safety is basically a corner case of union types.