11

Looking for the recent and powerful upcoming programming languages over net, I came across Ceylon. I dropped in at ceylon-lang.org and it says:

Ceylon is deeply influenced by Java. You see, we're fans of Java, but we know its limitations inside out. Ceylon keeps the best bits of Java but improves things that in our experience are annoying, tedious, frustrating, difficult to understand, or bugprone.

What are the advantages of Ceylon over Java?

4
  • 1
    Hmmmm, I checked around on their site and found no compelling explanation to why I would like to switch to Ceylon from Java... fair enough, they are still in the early phase, so maybe they don't want to raise hype too early and then disappoint... Commented May 17, 2012 at 8:01
  • 1
    Mmm, I thought it was yet another language by an overenthusiastic programmer (not that there is anything wrong with that :P ), but I see Gavin King of Hibernate's fame is in the team, which is reassuring. Still, I don't see who would choose Ceylon over other languages such as Scala, Groovy or Clojure.
    – Andres F.
    Commented May 17, 2012 at 12:38
  • 1
    related: programmers.stackexchange.com/questions/117561/… Commented Jul 11, 2012 at 12:31
  • 1
    @AndresF. looks like it is a Red Hat project. Should warrant some traction, but as always it is hard to say if this will be maintained as long as the rest of us wants. Java has proven to be backward compatible for the last 16 year - that is hard to beat for now.
    – user1249
    Commented Sep 11, 2012 at 9:37

5 Answers 5

27

Ceylon seems like a nice fun language but I'd argue it has relatively few "advantages" over Java.

I think it has a nicer syntax and some more "modern" language features - though this is subjective and I'd argue should be relatively minor factors in choosing a programming language.

Much more important factors when choosing a language / platform for a serious project:

  • Does it enable you to develop in a better paradigm for your given problem? (no - Ceylon is clearly yet another language in the over-crowded statically-typed Java-like OOP space. Contrast with e.g. Clojure which is targeting the functional language space or Groovy which is a very dynamic OOP JVM language so they are addressing different niches)
  • Has it got a better library ecosystem? (no chance.... Java is unmatched in this regard. At best you'd probably just end up using the Java libraries from Ceylon)
  • Can you get more skilled developers? (unlikely, few people are currently using Ceylon and even if they did there would be a big learning curve to climb)
  • Has it got better tools? (no - Java tooling is very comprehensive and mature)
  • Does it make you more productive? (debatable - it has some nice productive language features, but combined with learning curve and tooling effects it might actually end up behind)
  • Does it provide better performance? (no - the JVM is extremely well optimised for Java, it's a tough call for any other JVM language to beat it. Scala comes close, but that's after many years of fine-tuning...)
  • Does it support more target platforms? (no - it's a JVM language so exactly the same as Java)
  • Is the code going to be more maintainable? (probably not - Java has stood the test of time here precisely because it is relatively stable, mature and doesn't have a lot of advanced language features that might confuse future maintainers)
  • Is there a large, active and helpful community? (no, at least not compared to Java or the other big JVM languages like Scala, Clojure, Groovy etc.)

Overall I'd certainly encourage people to experiment with Ceylon and have fun with it from a learning perspective.

But I don't currently see any compelling advantages that would make large numbers of people want to switch to it (or choose it ahead of other JVM languages like Clojure, Scala, JRuby or Groovy).

8
  • 2
    "does it support more target platforms?" YES - you can compile Ceylon to Javascript.
    – Chochos
    Commented May 17, 2012 at 17:09
  • 1
    Also, I think your evaluation of some points is not really valid since Ceylon isn't even finished yet, so there's no point in comparing it to other languages that have been around for years now.
    – Chochos
    Commented May 17, 2012 at 17:10
  • 5
    @Chochos - you can also compile Java to JavaScript (Google Web Toolkit does this) so it's nothing in addition to what Java does. I agree Ceylon is clearly not finished, however I think all of my points are valid now and are unlikely to change in the next 5 years at least (even if the Ceylon team finish all of their current roadmap).
    – mikera
    Commented May 18, 2012 at 0:26
  • 1
    @mikera Chochos is completely right. Ceylon does support compiling to JS by design / natively. It can also be compiled to native code. I think this is a big difference then "there is somewhere a tool, by someone, that does the same, if.."
    – Gundon
    Commented Nov 15, 2013 at 11:07
  • 5
    @mikera - The "is there a large community" is, of course, a killer argument for each and every upcoming language. That being said, a small community is often more responsive and competent. (Look what scrap concerning Java is written all day over there at SO ....)
    – Ingo
    Commented Nov 15, 2013 at 12:50
3

It has some nice features not found in java:

  1. Reified Generics
  2. Type Inference
  3. Mixins (although this is coming in JDK8)
  4. Union and Intersection types (which is really cool and not found in many languages)
  5. "Higher order functions" (although not quite functions as first class objects)
  6. Closures (also coming in JDK8)
2
  • 3. Defender methods in JDK8 can deliver some of the functionality of mixins, but they come neither close to mixins nor traits. 4. Union and intersection types are a weird concept to me. I have problems to understand the added value. AFAIK it only saves you some typing effort when not having to define an interface that combines two other interfaces. Other than that I'm sure that Java will never have any advanced feature found in Scala/Kotlin/Ceylon/whatever that is a problem for binary backwards compatibility. So abandonning Java as with Ceylon has some justification.
    – OlliP
    Commented Nov 16, 2013 at 11:52
  • @OlliP You really wouldn't like to define all the union and intersection types the compiler generates. Java has intersection types, but only as generic arguments. It converts union types to some common supertype, which leads to funny compiler messages ("& capture of ?"). Union types get also used for nullability, which is fairly superior to both Java null and optional.
    – maaartinus
    Commented Nov 28, 2016 at 19:55
2

As far as I noticed, one of the biggest difference between Ceylon and other "hobby-created" JVM languages is that it's gonna be backed by Red Hat / JBoss. So it's gonna get a really nice tooling set integrated into JBoss Tools / Developer Studio, good interactions with JBoss AS / Gatein Portal and all the Midleware / JEE 6 / BRMS. So you might at some poing develop full fledged Ceylon applications in JSF, very productive portlets with a PHP "change and refresh cycles" and what not.

As most JVM-based languages, I don't see it as a replacement for Java for projects needing huge code-bases, but for some small to mid size projects, especially once which are very modular (like CRUD-intensive, portlets, etc). I think it's gonna be extremely well received in the web world, especially by JBoss fans.

2
  • 1
    "Ceylon and other "hobby-created" JVM languages". So Scala and Kotlin are hobby-created languages?
    – OlliP
    Commented Nov 15, 2013 at 23:20
  • I think the way the Ceylon IDE creates module definitions for you when you create a Ceylon project is an inspiration for Jigsaw. They Ceylon IDE makes it easy for the user to have modularization. With OSGi it's very cumbersome as you have to play around with maven plugins and various parameters. I guess the Jigsaw people at Oracle will take notice of the smart user-friendly tool integration in the Ceylon IDE and try to produce something similar for Jigsaw.
    – OlliP
    Commented Nov 16, 2013 at 11:50
1

I think Ceylon is interesting in many ways. And maybe they are right in the way that you need to depart from Java in some ways if you want to leave some problems of Java behind you. Ceylon seems to have quite a few language features and I hope this does make the compiler slow as in Scala or even worse cause build times that don't scale with the code size (see Two years of Scala experience feedback). The pace of the Ceylon dev team is quite impressive.

Kotlin is still 0.6 and, judging from their development speed in the last year, I would say about a year away from 1.0. It does not have that many language features like Ceylon (but those important ones java is missing like traits and extension methods) and seems to be more some kind of Scala without the problems of it. I guess scalable build times won't be a problem with it. But Kotlin can only be a nicer Java like Groovy. It can't provide a way out of Java commodity programming with XML dependency, boilerplate code, byte code manipulation, etc. It is something like Java and Scala done right. Whether Kotlin or Ceylon will be able to make a difference remains to be seen. I think both attempts are worth the effort and I wish them both good luck.

-2

Ceylon is producing a specification during its development, like all the big JVM languages (i.e. all those mentioned above except Groovy)...

Ceylon (http://ceylon-lang.org/documentation/1.0/spec)

Clojure (http://clojure.org/Reference)

Scala (www.scala-lang.org/docu/files/ScalaReference.pdf)

Java (http://docs.oracle.com/javase/specs/jls/se7/html/index.html)

JRuby follows Ruby's spec which must be paid for (http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579).

Not the answer you're looking for? Browse other questions tagged or ask your own question.