Analytics

Monday, April 11, 2011

Gavin King of Red Hat/Hibernate/Seam fame recently unveiled the top secret project that he has been working on over the past two years, a new language and SDK designed to replace Java in the enterprise. The project came out of hiding without much fanfare or publicity at QConBeijing in a keynote titled "The Ceylon Project - the next generation of Java language?". It took a fair amount of Google translate for me to get to the relevant slidedecks, (Embedded below) but once I found them, the information was all there in plain English.

According to the slides, the Ceylon Project aims to create a programming language and SDK for business computing, designed with an eye to the successes and failures of the Java. It is built to run on the JVM, uses static typing, and supports high-order functions, while maintaining a strong focus on being easy learn and easy to read.

If you ask, me it sounds like just what the doctor ordered. Java is great, it is an extremely popular, open(ish), robust, readable language that as a ton of superb libraries. However it is burdened by its legacy and cant seem to evolve enough to match the levels productivity and fun seen in more recently developed languages like Groovy, Python and C#, with C# being the most apropos comparison due to its statics typing and enterprise focus.

I've been eagerly waiting on the tech media to devour the details of this controversial effort and spew forth a riveting combination of analysis and hypothesis. Up till now, there has been nothing but crickets chirping so I figured I'd get the ball rolling with a layman's blog post.

What I like

The overall vision: learn from Java's mistakes, keep the good, ditch the bad

Things that may grow on me

Classes, Methods and Attributes looking almost identical...can't decide if that is good or bad

Things that make me go hmmm

All the new keywords for existing concepts: shared, satisfies, assign, variable, local

The simplification of the public/protected/private access/visibility levels

The Smalltalk-like syntax for inline functions as parameters

Things I didn't fully get

The Closure and block structure examples had some things that were a little puzzling. e.g. the "name" attribute of type "Name" returns "Name(“Gavin”, “King”)"

Some of the more intricate details of the type system..

While I am still waiting to hear some opinionated analysis from people who study theses things for a living, I am cautiously optimistic about the direction things are headed. I think the Java/Open Source/Programming world needs a language like this. Nevertheless, there are a number of factors that could affect whether or not the project gains momentum.

For one, while a lot of work has clearly gone into the language design, a production ready compiler and SDK a clearly still a ways off. That means that there is still a lot of work left to be done, especially if they plan to try and address the modularity issues that they claim Maven and OSGI have failed to solve. I would also love to see how Ceylon handles integration with existing Java code/libraries...smooth integration/compatibility is key for any pretender to the throne.

Additionally, I don't think Red Hat can do it alone, it is going to take buy in from the Java/Open Source community to really get things going. Google and Apache are two names that spring to mind, but that then immediately raises the question about where Ceylon comes into play in the ongoing power struggle between Oracle, Google and Apache over the rights to use Java without limitation. Could Ceylon become a key piece in the puzzle and spur an influx of supporters? Or will it simply raise Oracle's ire and force IBM to keep its distance?

I for one welcome our new CylonCeylon overlords. Its going to be interesting to watch and see how it all plays out.

Update: Gavin has posted a response highlighting two reasons for not reusing one of the many existing languages targeting the JVM (1) A built in solution for "defining user interfaces and structured data using a typesafe, hierarchical syntax" i.e. less dependency on XML (2) "The extremely outdated class libraries that form the Java SE SDK are riddled with problems. Developing a great SDK is a top priority of the project."

dynamic languages, unit tests. lol try building an enterprise ruby app. They don't exist. Read the text that is being written above, parse it for words like enterprise, then figure out which tool fits. :)

If the Enterprise world needs anything new in the Java vein, it's a VM that can match the performance of the JVM, but without all of the patent and IP baggage, hung around it's like neck an Oracle branded albatross. But a whole new runtime means - most likely - losing the advantage of seamless interop with all those existing Java libraries, which will make it that much harder to sell.

To Anonymous who equates 'Static' language and enterprise: Google's language of choice I read was Python (dynamic). And this thing they call the www is primarily dynamic links being parsed dynamically. There is nothing static about the world: therefore it makes little sense for a programming language designed to model the world to be static.

".net is available on windows, linux, ios, and android. Why do we need something else? C# is a very nice language."

Lets slice this up. .net Windows you have to pay for a windows license. ios You have to pay for the development environment. Android have to pay for the development environment. Linux question mark. Linux is about the only part of .net where you are not paying Microsoft.

Hmm .net does not sound that good. Now Linux Windows IOS and Android under .net don't have the same interface libs that work. This is just getting worse. Code 3 times to get results.

QT comes to mind as a better solution using C++. Only have to pay if developing someone where I will not be giving back the alterations to QT. Covers the same platforms and more. Ok does not cover WP7 but at the way things are looking that might be gone in a few years. Even QML starts looking like a decent solution compared to .net.

Ceylon might be nice. It will be interesting to see if it has a covert to native code out box. So it can proper be used in embed.

What we need is an engine that administers a Meyer-Briggs test and then custom designs a scripting language ideally suited to our uniqueness. Because each of us is special! It's a small world after all, it's a small world ... OK, I'll stop now.

Marc the slide 10 that you mention describes the same features as Scala.(well the only different part is "easy to learn", since Scala basics are easy but other concepts requires more time)

About Ceylon, I'm not so optimist as you: - They don't have a working compiler yet- Some of the items in slide 4, makes me doubt about the knowledge of the author in programming language design - The examples shows type inference only for locals (making the static typing a pain to write as in Java)- They talk about built-in modularity but it seems that they are in an early stage of the language design (built-in modularity is a difficult thing to design right, google for Newspeak and Gillad Bracha blog... he wrote some nice reflections on modularity and language design)

@Anonymous (12:56 AM) LOL. I mean things that seem like a bad idea. At least to a layman like myself.

@Diego There is definitely a lot of work left to be done. With respect to type inference apply to locals only, I think the same restriction applies in C#. Personally I am a fan of the type inference in C#.

.NET is just a Windows only solution right now. Mono is just a bad joke. Mono lags the .NET framework by at least one major release. And if you fire up the new Visual Studio, and use some wizards, you'll no doubt compile code that uses features that aren't present in Mono.

The Mono developers are bogged down re-implementing tens of thousands of API methods that Microsoft keeps adding to the framework. And since there is no standard regression kit available, wanna guess how many of those methods work the same on all platforms? The Java TCK may be restrictive, but is available, and it verifies that your Java is actually Java. MS offers nothing for that.

Why doesn't MS just port the .NET VM to Linux, and just release it as a binary? That would at least give their Visual Studio sales a shot in the arm.

As a Python and Ruby programmer, I also thought that static typing was a deal-breaker... until I found Google's new systems programming language: Go. I love it -- it's basically a modern dialect of C (NOT C++), but with garbage collection and brilliant concurrency primitives. http://golang.org

I'm doubtful that another java knock off helps all that much, especially given the LLVM may eventually eat java's lunch on the server side.

We need a compiled statically typed functional language with good high speed code generation via LLVM that encourages parallelism.

* Erlang has shown how functional languages can obliterate imperative languages for multithreading, but Erlang's interpreted bytecode system necessitates occasionally using C for performance.

* Haskell has shown all manor of advantages of functional languages, but lazy execution makes the compiled code execution speed fundamentally unpredictable, well unless you use the profiling tools deftly.

* OCaml offers solid predictable code performance, albeit not nearly so well optimized as other languages, but handles parallelization poorly relative to Erlang and Haskell.

There is a slight possibility that Haskell could grow into this language by offering more Erlang style parallelism, but that'd necessitate creating a 'culture of profiling', which frankly sounds both unnecessary and impossible.

We should probably be looking towards a non-lazy functional language that offers the power of Haskell's type system and Erlang's concurrency.

I love static typing, especially if it has this proper generics and type inference. seems very nice, hope to be able to try it soon!Also I think the title is misleading, this isn't a Java killer but the best opportunity around to get new life in it.

Indeed it has many similarities with scala, but looks like a striking better syntax.

In attempting to be all things to all people, Scala is at risk of disappearing up its own complexity. Groovy is fun but slightly undercooked. Clojure is sensational, but is also mind-bending (immutability, general arcane lispyness). My suspicion is that Ceylon will be join that conga line of newbies, but definitely won't be the last word.

There's no need for this newfangled Ceylon thingy. What about 6502 assembler? Programming has been going downhill since we went past an accumulator and two index registers. That kept things nice and clean and efficient. Try static typing an index register bitches!

Isn't this whole static/dynamic business really about "correctness"? Static typing lets you essentially prove that the program will behave the way you want. Dynamic typing seems like a way of avoiding that proof until it's too late to do something about it....

Slide 10 of his preso does NOT describe Scala cos Scala is not "readable" or "easy to learn and understand". See this for several billion ways to open and read the contents of a file: http://stackoverflow.com/questions/1284423/read-entire-file-in-scala.

We need a language that's as friendly and enthusiastic as a snuggly puppy (like Groovy), but with a grown up type system. The latter probably means _optional_ typing rather than dynamic. Really dynamic typing (I'm thinking Ruby) just makes it hard to work out what someone else's code is supposed to be doing. I want to type things when it makes sense and not type them when I need the flexibility.

Does this mean that all the developers who jumped through hoops to make their Java applications "database independent" to avoid the hassle of porting between MySQL/Oracle/etc, are now going to want to port the entire app to the latest language that "the cool kids have got a hard-on for"?

If so, will they revisit the argument of placing data (business) logic in the database where it belongs, or continue with a demonstrably failed approach?

just to add a voice on the statically typed issue: I wouldnt touch a non-statically typed language with a ten foot pole. I dont mind other people's taste, but comparing a scripting language with a statically typed one, which comes with an array of tools that are only possible through static typing, is ridiculous.

I partly agree with sarbogast "...right tools for the right job...". However, I can't see myself become fully versed in Groovy _and_ Clojure _and_ Scala _and_ whatever else might come along. To me, Groovy seems like the most approachable and generally useful of the current crop but for some applications, you'll want something more performant.

Thank FSM for having the sense to use := for assignment. This should be an absolute no-brainer. Countless C programmer-hours have been lost to inadvertently typing '=' instead of '==', and perpetuating that blunder in later languages just baffles me.

A lot of the syntactic approach in the power point (https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B7IgMTLsf_SzODkwNGRmYTQtODMyYy00NjhjLTkyZTQtMzBhZmY5NDFjMzMy&hl=en&authkey=CNy76dkK ) reminds me of something from Javascript or Scala. Not a bad thing, but I'm not especially drawn by what I'm reading (unless we are talking about comparing this to Java).

The type narrowing example at the end reminds me of SML (and company's) type matching pattern used to dispatch to the correct function, which Scala has a variant of.

I'm also bothered that I don't see type inference in here anywhere. One of my biggest complaints about Java is that where the type is obvious or irrelevant I can't omit it.

Sometimes I think that the world of computer programming can't see the forest for the trees. We get so wrapped up in reinventing the wheel. Every time I turn around there's some new language that "fixes" some small "defect" that all the other languages fixed in there own way. It's like a never ending conga line. Makes me want to change careers, sometimes. Maybe becoming a gardener or something.

I love the language wars. But I don't see anyone talking about the reason for a language. The expression of idea's that can also be mapped into code. How much time do we spend dotting i's and crossing t's that have no relation to the algorithm we are trying to express. In some languages, having to carry out the trash all the time (garbage collection) is non-essential to the expresson of what you are trying to do, just a byproduct of the envirionment and can be automated in languages like Java.

Strong typing is like having to call your shot in pool. You don't always get it right the first time.

Having to have a collection of just all the very same thing is a confusion. Say a collection of possessions. It could be a house , a dog, an idea, a desease. You strong typed fanatics would know you have to come up with an overriding hierarcy of objects with sub types ... (that is if it is an Object Oriented Language). If it is not well you have to design your own OOJ to express the idea.

Language are to express ideas. If you can't express your idea or the algorithm efficiently, if you can't read someone elses idea and understand it, if you can't maintain it. It is of little use.

My favorite is APL with 'disposible code'. Literally you would document what you wrote heavily because you would have to throw out your function and re-build it if it changed.But for Matrix work, every efficient.

There are more aspects that are important in a language rather than typeing schemes that make a language appropriate for a task or for a problem domain. It the discussion above it seems like those differences are being lost. True all discussed are Turing Complete but then so is Lotus 123. I don't think there is one language discussed that does not have a strength for a particular kind of programming. The strong typed language are good for lock down, not changing business applications, after you figure out what you really want and need. A Dynamically typed or otherwise less prescriptive language is good to run those initial runs to let the users figure out what they really wanted. Easier to change and be responsive. The locked down languages are cumbersome and hard to change and often have fundamental infrastructure changes that have to be made to make a small change (like adding a pencil to the list of possessions), and can be costly and usually ends up with corruptions and work arounds. A hierarchial approach to business development with different tools at different times (or a tool that had different levels of lockdown) would make sense.

I think the interesting question will be whether Java survives Oracle's attempts to monetize it. I have a sneaking suspicion it won't, which will open the door for some other JVM-style language.

At least they are trying to make an enterprise language and not another scripting language. Strong typing and static typing an invaluable once one starts trying to *maintain* large, enterprise programs (have had far too many bad experiences with trying to maintain large script-based programs stemming from the fact that the semantics of the language do not allow the compiler to tell one about errors at compilation time instead of hoping that you happen to run into (and then track down) mistakes at run time during testing). Run time testing is an awful way to find bugs - much more reliable to exploit strong/static typing to rule out errors by definition (at least for large, complex programs where there are too many possible scenarios to catch them all with run-time testing).

Why don't they simply take a pascal with a nice, well organised runtime library and the beauty of Qt. And native compilation of course, no one ought to care about external runtine libraries not packaged with the source.

Check 'modularity' of Hibernate and everything will be as clear as day... If Gavin is the main guy behind this we'll need default constructors and other 'cool' requirements of the 'framework/language'. When hibernate came out there was nothing really like it so many projects sacrificed code quality to get the functionality of the framework. Unfortunately for Gavin, it's 2011 and there's tons of excellent JVM alternatives to Java...

1. How much complaining do we need to do to change the := operator into something easier to type? (This isn't a joke, I'm pretty sure that everyone hates typing this and there's another operator you could use)

2. What about returning multiple values? Lots of new languages do it. For example, GO syntax is:

If you're looking for a language with functional support, good concurrency, no lazy evaluation and an LLVM implementation, Rust might meet your needs. It is still very much in flux at the moment though, at least in terms of syntax.

Interesting, very interesting indeed. I read through slides and I realized that literally everything in Ceylon (with one thrilling exception of reified generics) is already in Scala. This is good thing, for example: use site variance annotations are much better than wildcards. But on the other hand we already have Scala.

One thing that is never mentioned is level Java interoperability. Will be there some major obstacles? For example using java's erased generics from Ceylon code and so on.

Despite it being a competitor, I like a lot of the stuff that they are doing in Ceylon. Not allowing method overloading is a recurring fantasy of mine (although if they intend to offer 100% java interaction, they'll have to still have some insane method resolution logic that will undoubtedly screw their parser up beyond recognition. Ask me how I know.) I like the constructor syntax (nod to scala as well there.)

My first impression is that this is a bit more of a step away from Java than Gosu is. For example, we try to patch up the core classes with some additional functionality and simplified API's rather than wholesale replacing them. Time will tell which approach is better.

concerning the "Name" returns "Name(“Gavin”, “King”)": a quick flight over the slides shows that they want to avoid the 'new' constructor keyword, that is, the example just seems to create a new Name object with two parameters "Gavin" & "King" - though for me it was the first strange thing in the language: coming from a C# background I wouldn't know whether it is creating a new object there or accessig yet another property (without the parameters) or a method inside the class...

Having switched from java to Scala a few months ago, I have to say I do not understand what additional value Ceylon really adds. All it's good ideas are already part of Scala, pus it has some additional great concepts and is already further advanced although yet on its way

Wow, this stuff makes me sad. I use to think opinions were like assholes and that everyone has them.

Apparently when it comes to language design. Everyone is just an asshole. Dude's been working on new language. That's awesome. It's also hard. We should be congratulating him and wishing him well. Instead people are questioning his skills, his ability, and for why? If you don't like it go off and play in your own sandbox with your own language.

"I think the Java/Open Source/Programming world needs a language like this. " — the problem is we already have that, in the form of Mono's implementation of C#. Given the choice, I'd take it over Java (and the JVM) any day of the past decade.

Hopefully the team will be able to garner some useful feedback from all the noise. I hope they are not too distracted by all the hubub and early attention (my bad).

I'm curious to see what they have in store for the SDK, people have been blindly ignoring that part and just condemning project before it even gets a chance to show its full potential.

In the mean time, I'm going to take a look at Scala, hopefully it doesn't magically turn me into an angry, vitrol spouting asshole. At the end of the day its all about survival of the fittest, and for better or worse, the details of the language design are just one piece of the puzzle.

@Spidey01/TerryPIf only things were that simple. Politics, copyright ownership and patent murkiness make that a non-starter.

I wish you lots of fun and discovery with Scala.. .. you just may find yourself drawn deeper and deeper into it… like you're becoming part of or entering LOTR (the book!).

/Then/, once you are feeling your Elvish, mortals calling you vitriolic (or so much worse, saying your language is unreadable!) will not disturb your tranquility :)

Best regards, OP

PS: Jokes apart, too much "Sounds like Sc***!" unfortunately does sound a bit like "Ceylon, go home!". Mea culpa, I suppose.In any case, I still would be love to hear from more knowledgeable people about their impressions.

General take on newer languages: the easier they are to learn, the dumber the programmers using them will be. That isn't to say old languages are The Answer.

I thought function pointers in C were dynamic, maybe i missed the whole static vs dynamic point, but i don't really care and prefer using whichever better suits the job, be it C/++, PHP, Java or whatever.

In the type system presentation it mentions briefly about numeric types. That it solves the floating point precision problems that are present in Java. That has to be one of my biggest annoyances with Java. Because it is so fundamental and Java handles it so poorly.