2 ms·
Could you explain why Ceylon fits the bill while Kotlin does not please ?
by on_and_off 10y ago
Could you explain why Ceylon fits the bill while Kotlin does not please ?
- lmm 10y ago* Null-handling in Ceylon falls out naturally from union types. Null handling in Kotlin is a hacky special case with a bunch of specific operators. In particular this means it's impossible to write a method in Kotlin that works with both traditional nullable values and Optionals, which will make interop a lot worse as the Java ecosystem adopts Optionals. * Ceylon has actually listened to the lessons of Scala tuples and built theirs the way ours should have been all along (HLists), making them much easier to abstract over. (NB not actually an issue in Scala in practice - you import Shapeless and then everything works the way it should - but it's nicer to have the right thing by default, as will hopefully be the case in Scala 3.x) * Ceylon has higher-kinded type support done right - multiple parameter lists to avoid Scala's unification issues that lead to the use of "type lambdas" (hopefully fixed in Scala 2.12). Kotlin simply doesn't support higher-kinded types; combined with the lack of union types this means magical annotations with bytecode manipulation where suddenly the code you wrote isn't the code that runs, because just like Java that's the only way to do a lot of things in Kotlin. Async is a special case with language-level dedicated support code. Error handling is done solely through unchecked exceptions which is fine for system failures but not a good way to handle "expected" failures like input validation.