top | item 10463464

Why you might want to choose Ceylon

158 points| mikesname | 10 years ago |ceylon-lang.org

146 comments

order

lmm|10 years ago

Have they tightened up the floating point semantics? Or do you still get different rounding behaviour on the JVM, dart and JS?

I want to like Ceylon because it's the language Scala should be (assuming that higher-kinded types made it in - I could never work without them). It's Scala with all the ugly parts polished away, Scala with ten years' progress in language design.

But it does nothing that Scala can't. Scala might need a pile of bodges to offer these things - Shapeless implicit macros to use tuples generically, type-level libraries abusing the implicit resolution rules to implement unions, a retrofitted JavaScript backend. But that stuff has been written now, and as a developer it works - maybe with a couple of ugly extra lines here and there, but that's all.

I'm glad it exists, but I just can't see people choosing the more polished language over the one with ten years worth of library and tool support when there's no USP beyond that polish.

bad_user|10 years ago

A language without higher-kinded types or type-classes cannot be the language that "Scala should be". And these aren't things that can be easily added later. And I don't think it will ever happen. And don't get me wrong, but software is about trust and I do not trust somebody like Gavin King for delivering a good language after Hibernate :)

> Shapeless implicit macros to use tuples generically

What can you do in Ceylon about this? Or are we talking about a dream?

> a retrofitted JavaScript backend

Not sure what you mean. Scala.js is reusing the Scala compiler in what happens to be the cleanest transition I've seen to such a different platform. And compared to other Javascript compilers, like ones for Ocaml or Haskell, this one actually works well and stays up to date. Care to explain?

taiar|10 years ago

> I want to like Ceylon because it's the language Scala should be

> but I just can't see people choosing the more polished language over the one with ten years worth of library and tool support when there's no USP beyond that polish

It seems all a matter of time. What would Ceylon look like to you after some years of library and tool support?

pjmlp|10 years ago

Fully agree.

I dabble with whatever new languages come out as any other language geek, but at work it only matters the languages validated by the IT department or requested by the customer.

So, like many, I only work with languages blessed as first class languages in vendor SDKs.

With Scala and Clojure barely being adopted by most Java shops (in perpetual terms), I don't see where Ceylon might fit in without a story to sell.

kitd|10 years ago

I agree somewhat.

One feature of Ceylon that caught my attention however is that Ceylon modules are implicitly OSGi modules. If you are building a microservices-type JVM application based on OSGi, Ceylon could make this a lot easier.

pron|10 years ago

I think it's part of a general trend of language designers (and even language fans) not understanding what makes languages work in practice. For academic languages this may not matter, but if you actually want your language to be used, you need to pay attention. A recent study[1] has shown that "extrinsic" factors (performance, tooling, familiarity, libraries) matter a lot more than intrinsic factors (syntax, abstractions) when it comes to adopting programming languages. A language that understood this beautifully was Java[2] (and, I believe, Go, which is very much in the spirit of the Java philosophy), that analyzed existing "advanced" languages like Scheme, Self and Modula (and indeed some of the people involved with those languages were among Java's early designers) and realized that the features that give those languages most bang-for-the-buck weren't clever abstractions but extra-linguistic features such as GC, dynamic linking and JITs[3], that can be packaged in a crude, "blue-collar" language that's familiar (and familiarity is indeed among the top factors in choosing a language, while "correctness" -- as in more powerful type system -- and particular language features are among the last). James Gosling called it a wolf in sheep's clothing. A wolf in wolf's clothing may look more fierce, and the sheep's clothing may indeed limit its maneuverability a bit, but it can still be almost as wolfish, yet much more palatable.

OTOH, Kotlin took whatever it could from Ceylon (the nullability types, flow-sensitive typing) while keeping 100% seamless interoperability with Java as the top priority, so it may not be a revolution, but its adoption costs are virtually zero. It doesn't even have much of a runtime library; it was designed in such a way that all cool features could be applied to Java's standard library. The idea was that abstractions are great as long as they don't come at the expense of more important features, such as availability of libraries, tools etc (Kotlin even supports Java's annotation processors, so popular libraries that rely on compile-time verification/code-generation such as Dagger can work on Kotlin code).

Of course, I take this much further than you and believe, unlike you, that the contribution of advanced language-level abstractions is not so pronounced at all (or, at least, it hasn't been shown to be significant), and obviously I have a very different perspective on Scala than you, but at least we can agree on something :)

[1]: Paper: http://lmeyerov.github.io/projects/socioplt/papers/oopsla201... Accompanying talk: https://www.youtube.com/watch?v=v2ITaI4y7_0

[2]: https://youtu.be/Dq2WQuWVrgQ?t=14m12s about why Java was designed the way it was

[3]: Sun had experimented with a JIT for Self long before it was introduced to Java, and the plan was to make Java exploit JITs almost from the get-go.

TazeTSchnitzel|10 years ago

> Have they tightened up the floating point semantics? Or do you still get different rounding behaviour on the JVM, dart and JS?

Doing so ought to be trivial if they haven't. Java has a mode where it uses doubles everywhere. JavaScript has Math.fround() for single-precision arithmetic.

sz4kerto|10 years ago

> its powerful Eclipse-based IDE

:( This is something that would, in itself, direct me to Kotlin or something else. I know that Eclipse is a better fit for Ceylon (because both are intimately related to OSGi), but I really wouldn't want to go back.

kitd|10 years ago

The past couple of versions of Eclipse have really moved it on IMHO. Mars is a great IDE.

epalmer|10 years ago

I guess for me I don't need nor want JVM + JavaScript VM interoperability. My gut says this limits what can be done. I would rather have just one or the other.

Maybe others feel differently.

oldmanjay|10 years ago

Making technology decisions with your gut is tricky. What if you happen to be hungry? The signalling will be all confused.

codazoda|10 years ago

This language looks pretty cool, but I do agree with your gut. The FAQ says:

"Note that not all Ceylon modules are available for both platforms. A module might be cross-platform, it might by JVM-only, or it might be JavaScript-only. Of course, ceylon.language is completely cross-platform."

Having some modules for JVM and some are for JavaScript-only would make things a little bit more confusing than if the language picked one. I haven't decided if this is a very significant thing or not.

gavinking|10 years ago

Well, y'know, you could go with your gut - or you could actually try it out for yourself!

I think you'll decide your gut was wrong, but there's only one way to be sure.

randomThoughts9|10 years ago

I hope they'll redo some of the documentation with this upcoming release. Every time I read it, I am amazed by how comprehensive it is but still manages to miss some very important points.

Like the fact that on the main page, the link to the online editor is not under the "Try it out" section. The explore action from that section is also misleading.

Or a clean hello world, with a real project structure documented

Or the way collections are documented. Basically, you have section 6 from the tour of ceylon: Streams, sequences and tuples. But it's not obvious what is the big difference between streams and sequences and the fact that sequences borrow the array notation while being immutable doesn't help either. Even when you go to the List api, which is the interface any Java developer will look for,you can't find the mutable collections, because they live in another module.

danesparza|10 years ago

This is great, but who is using it? I enjoy learning new languages, but knowing who is using it (and perhaps why) is a good indicator of momentum in my opinion.

aembleton|10 years ago

It doesn't have extension functions.

Since moving to Kotlin for my projects, I really enjoy the power that these provide: https://kotlinlang.org/docs/reference/extensions.html

What does Ceylon give me over Kotlin?

gavinking|10 years ago

Well, if you read the linked article, a number of things are mentioned, including:

- union and intersection types

- an elegant and powerful representation of tuple and function types

- reified generics

- the cleanest solution to the problem of null

- awesome modularity

- a language module [that] completely abstracts the underlying runtime, and offers a set of elegant APIs that vastly improve on those available natively

- a language specification

None of which is offered by Kotlin.

That's quite a lot, actually.

lighthawk|10 years ago

I looked for example projects in Ceylon with step-by-step info on how to setup/deploy:

* Hello World web application

* Simple online store implementation (authN, database access via ORM layer, logging)

* Todo MVC implementation

* RESTful/XML/SOAP web services

* RESTful/XML/SOAP clients

* Examples for writing AngularJS and React front-ends with Ceylon back-end services, with info on how to host such as to minimize and cache assets and server-side query caching and either side-loading or multi-table joined/extended data structures, updating and reading/accessing those data structures partially.

* Examples for easily timestamping and userstamping models

* Examples for using testing frameworks: unit, integration, (web) acceptance

Here's what I found in looking for that:

* This hello world: http://ceylon-lang.org/documentation/tour/basics/

* No Ceylon JS example at http://todomvc.com/ but this Todo list: https://github.com/vietj/cayla-mvvm/blob/master/source/io/ca...

* Two examples in what I assume is the official examples git repo at: https://github.com/ceylon/ceylon-examples containing N-queens and Game of Life only.

Also, I'd want to see benchmarks. Show me how much it is "like" performance of equivalent Java, Dart, and JS as is claimed by comparing to maybe a Play Framework app, the Dart example client-server https://www.dartlang.org/server/google-cloud-platform/app-en... , and a simple MEAN stack and/or full-stack example using ReactJS.

In addition to those examples, I'd want to see a larger community behind it with a variety of projects, e.g. specialized ORM, larger web app/services framework, simple web app/service framework each that have their own communities using it.

I think it is cool, but I don't think it is even in the same ballpark with solutions/combinations like Play+Scala, MEAN, Rails, Elixir+Phoenix, etc. for wide application in web/services.

NanoWar|10 years ago

I don't like the extensive use of the ` character, because it's really hard to use on a german keyboard: it get's added twice :( Other than that this looks great!

ake1|10 years ago

you might want to look into changing to another keyboard layout. as a swede, using altgr+[7-0] to get (curly)brackets is just ridiculously cumbersome compared to say a us layout.

vorg|10 years ago

Scala and Kotlin are mentioned so many times in these comments about Ceylon (42 times and 66, respectively, as I write), but no mentions of dynamic languages Groovy, Jython, or JRuby. I guess that shows there still a clear distinction between languages built from the ground up for building systems, and languages originally built for scripting, build scripts, and testing.

lmm|10 years ago

I don't think the distinction is the one you're making it. The original intentions of languages are accidents of history (Java was originally for set-top boxes), and the likes of Python and Ruby are perfectly legitimate languages. The best options on the JVM happen to be typed, but there are good untyped languages and bad typed languages, and parochial typed languages and general-purpose untyped languages too.

hcarvalhoalves|10 years ago

Looks like a smaller Scala that also compiles to JS. Might be worth a shot.

lobo42|10 years ago

Did anybody checkout xtend-lang.org? It's for sure better in terms of Java-interoperability and IDE plugins (Eclipse and IntelliJ) And it even has macros!!

trhway|10 years ago

i want it! it will increase my job security with features like this :

==

String name => firstName + " " + lastName;

And an assignment:

String name = firstName + " " + lastName;

In the first example, the expression is recomputed every time name is evaluated. In the second example, the expression is computed once and the result assigned to name.

==

A function which looks like just a variable and recomputed each time! Happy debugging my code, suckers!

findjashua|10 years ago

i've been using fat arrows for function definitions in es6, and haven't had a problem. I think the confusion in your code has more to do with poor code than fat arrows.

Lazare|10 years ago

Speaking as someone who has done quite a lot of work using languages with terse lambda syntax...

...that's just not ever an issue.

oldmanjay|10 years ago

Part of me fears the GWT successors that could end up built out of this.

Part of me is intrigued by the excellent modularity story.

Part of me is excited to try out the type system.

Most of me wonders if I'll get time or an opportunity to explore.

Overall, this generation of languages is pretty exciting!