Closed ErikSchierboom closed 3 years ago
In general, it seemed to me that in most instances where the language design had a choice between "make the rules strict to forbid people from doing the wrong thing (but also sometimes forbidding programs that would otherwise be valid)" and "make the rules lenient to allow more programs (but some of them will do the wrong thing)" Ceylon chose to make the rules strict. Here is one example:
You cannot give anyone a reference to this
in your initialiser, as stated in https://ceylon-lang.org/documentation/1.3/tour/initialization/. As the page states, "Unfortunately, these rules make it a little tricky to set up circular references between two objects."
Compare to Kotlin's handling of the same: They mention that this is one of the only four ways you can get a NullPointerException in Kotlin: https://kotlinlang.org/docs/reference/null-safety.html "An uninitialized this
available in a constructor is passed and used somewhere ("leaking this
");"
This comes up as an issue in exercises like react
, and perhaps others that are not yet implemented.
A characteristic of Ceylon that is rare is the presence of union types and intersection types in the type system.
I have not thought carefully about whether there would be an exercise that would require the student to use intersection types, but some exercises of the Ceylon track do use union types to describe the possibility of an error: hamming, largest-series-product, rna-transcription.
It's a little hard for me to tell how widespread this is among other languages since searching for the term sometimes gets things mixed up with C's union
or a tagged union, common to many languages. And based on one's definition of these concept, one might argue just how much difference there is between them.
Of the languages known to me, the ones with the most similar feature would be:
catch
https://docs.oracle.com/javase/8/docs/api/javax/lang/model/type/UnionType.html; Intersection types seem to be allowed more generally https://docs.oracle.com/javase/8/docs/api/javax/lang/model/type/IntersectionType.html but are most commonly used to denote that a type parameter extends two interfaces.
https://en.wikipedia.org/wiki/Intersection_type has section https://en.wikipedia.org/wiki/Intersection_type#Comparison_of_languages_with_intersection_types
We're closing this issue as it was part of our research for the v3 version of Exercism which has just been released.
Thanks everyone for chipping in! It has been greatly appreciated.
We’ve recently started a project to find the best way to design our tracks, in order to optimize the learning experience of students.
As a first step, we’ll be examining the ways in which languages are unique and the ways in which they are similar. For this, we’d really like to use the knowledge of everyone involved in the Exercism community (students, mentors, maintainers) to answer the following questions:
Could you spare 5 minutes to help us by answering these questions? It would greatly help us improve the experience students have learning Ceylon :)
Note: this issue is not meant as a discussion, just as a place for people to post their own, personal experiences.
Want to keep your thoughts private but still help? Feel free to email me at erik@exercism.io
Thank you!