

Red Hat Releases Ceylon Language 1.0.0 159
First time accepted submitter Gavin King writes with news that the Ceylon language hit 1.0 "Ceylon 1.0 is a modern, modular, statically typed programming language for the Java and JavaScript virtual machines. The language features, an emphasis upon readability and a strong bias toward omission or elimination of potentially-harmful constructs; an extremely powerful type system combining subtype and parametric polymorphism with declaration-site variance, including first-class union and intersection types, and using principal types for local type inference and flow-dependent typing; a unique treatment of function and tuple types, enabling powerful abstractions; first-class constructs for defining modules and dependencies between modules; a very flexible syntax including comprehensions and support for expressing tree-like structures; and fully-reified generic types, on both the JVM and JavaScript virtual machines, and a unique typesafe metamodel. More information may be found in the feature list and quick introduction."
If you think Ceylon is cool, you might find Ur/Web interesting too.
Cool! (Score:5, Interesting)
One of the few languages in recent times with an interesting type system which isn't just a trivial rehash of existing (in practice) ones.
Re:Cool! (Score:5, Interesting)
Re:Cool! (Score:5, Interesting)
Re:Cool! (Score:5, Funny)
I hear a lot of scheme-brained hares saying this.
But I assure you, you're wrong.
Re: (Score:2)
I was about to write that too. Type enforcement like he is asking for is trivial in Haskell. So seconded.
Re: (Score:2)
I can see enforcing types for say, current and resistance, but what about the fact that current times resistance is voltage? I can see having a voltage type too, but do you have to write the rules for every combination of units that result in a different unit, or is there a more clever way to handle that?
Re: (Score:3)
Re: (Score:3)
1/2 and 1/2.
Haskell allows types to be in a hierarchy. A => X(A)
So for example you could have acceleration defined as an adjustment type time(distance).
And then you could define a function to take A(B) and Y(A) to Y(B) in an abstract way.
map for example takes a function from a to b, an array of a (i.e. a structured type on top of a) and returns an array of b.
number class is a good example of this sort of hierarchical layering.
So yes, you can do it to some extent in Haskell. If you want to go further Q
Re: (Score:3)
There are plenty of these around. F# has one. Check out their papers on dimension checking.
Re: (Score:3)
Well, force = mass * distance/time^2, but that probably wasn't your point. (or perhaps it was HAH!)
I tried to do that once, it turnes out to get pretty complicated if you don't have compleate symbolic manipulation library at your disposal. Simple unit */ another unit was easy, but then when they were hard to simplify because one unit was to the (1/3) power, my c++ class system couldn't handle it.
I eneded up simply requiring out group to always put units on their variable names so we could follow the code ea
Re: (Score:2, Insightful)
Been there done that in C++. Check Barton and Nackman.
Re: (Score:2)
Thanks for the hint, but I've found the Wikipedia page [wikipedia.org] on it (and the first results on the web) not very exciting. However, Software for Infrastructure [stroustrup.com] from Stroustrup has a really cool example on how to do it very pretty. It uses user-defined literals [wikipedia.org] to create expressions such as "Speed s = 10m/2s".
Re: (Score:3)
I find one of the most effective techniques is just to enforce the rule that any variable that represents a physical quantity must have the units appended to it, using std SI notation, like massCannonBall_kg, or distanceToOuthouse_m. It also helps to insist that all units be base units. With floating point, why use _kOhm or _MOhm, when you can just use _Ohm for everything? It eliminates confusion and errors to stick to base units, and you can easily convert for convenient user I/O.
Re: (Score:1)
like massCannonBall_kg, or distanceToOuthouse_m. It also helps to insist that all units be base units. With floating point, why use _kOhm or _MOhm, when you can just use _Ohm for everything?
Because kOhm is the natural unit, just like kg? Or is that domain specific?
Re: (Score:2)
kg is a troublesome case. You can debate whether it's better to use grams or kg as the base unit, but I'd argue kg is the base unit in the MKS system. Not so for kOhms.
Re: (Score:2)
I'd like to see a type system that can help enforce units (like mass * distance = force). If it were really lightweight (in typing) to create types with meaningful units, it could protect you from accidentally adding things like Mbits with MBytes.
C++11 has very good support for this. You could do it in C++98 with operator overloading and templates, but the syntax was horrid. Combine that with auto type declarations and user defined literals and you're golden.
Re: (Score:2)
Or try Frink!
c2.com/cgi/wiki?FrinkLanguage
From the above link:
One of the distinguishing characteristics of Frink is that it tracks units of measure through all calculations. This allows all values to contain a quantity and its units of measure. Frink understands how different units of measure interrelate, such as a length cubed is a volume, or power multiplied by time is energy. Different units of measure can be mixed in calculations, and Frink automatically ensures that the calculations lead to a result wi
Re: (Score:1)
trivial rehash of existing (in practice) ones.
This is no time to be bashing Objective-C
Re:Cool! (Score:4, Funny)
I swear I thought that said Cylon language and I started thinking, first Klingon and now Cylon?
Re: (Score:2)
I'm not the only one.
So, do you suppose Ceylon is the language that the Cylons were written in?
Thank goodness (Score:4, Funny)
...for Python.
I can continue to completely ignore the incredible, writhing mess that is java and its ecosystem.
Go ahead, mod me down, then go back to fighting with Java. I'll just continue being productive. :)
Re:Thank goodness (Score:5, Insightful)
No, he probably means writing gobs and gobs and gobs of difficult to support and debug software. But yours is right too,
Fuck using a scripting language for anything beyond a "script".
Re: (Score:2)
Wow, wish I'd known that when I wrote my aurora-prediction system, my demonstration database, my point of sale system, and my meter generation software. I didn't know it was supposed to be difficult, so I committed the ultimate sin of writing, debugging and using these things quickly and easily. I just didn't know I was supposed to struggle with something more difficult. Can you ever forgive me?
Re: (Score:3)
No; I've always written code in an indent-structured manner, it's both natural to me and an aid, not a detriment, to my coding. I've even written (and had published) technical magazine articles on it, back in the day when that actually meant something. If your style (and I use that word loosely) is K&R or some other inherently indent-unfriendly method where braces or other forms of structure are visually unbalanced and code that is structurally dependent isn't visual
Shite (Score:5, Insightful)
Like that comma?
Re: (Score:2)
Well, technically it would have been better being altered to a colon if the semi-colon separated list were to parse correctly.. though a human brain would just issue a warning rather than an error here.
Buzzword much ? (Score:1)
I'm sorry, I'd really like to be interested by this, but the second and last sentence is just the usual marketing bullshit that each newest language has been serving us in the past years.
So, here comes the usual question we always end up asking when such a thread shows up: could you give us a simple and clear explanation of what is so good about it as well as the traditional comparison of advantages/disadvantaged of this language with other similar ones.
Thanks
The Internet
Enough already. (Score:1)
There are to many programming languages.
Re: (Score:1)
There are to many programming languages.
Especially when you haven't mastered English yet.
Re:Enough already. (Score:5, Insightful)
Re: (Score:2)
Honestly, I'd be happy with just a C variant with built-in string support.
Doesn't D have that?
Re: (Score:2)
Re:Enough already. (Score:4, Informative)
D does! [dlang.org]. But D also has so [dlang.org] many [dlang.org] neat [dlang.org] features. [dlang.org]
D is wonderful, and it can interop with C / C++ or write inline ASM for you micro-optimists out there.
Re: (Score:2)
The the extent I've looked at it, D seems like a great language. Maybe it doesn't get much attention because it's not one of the new cool (i.e. rehashed) languages, but it'd fill an important role. In many ways it's C++ done right. That fills the need for a language that's higher level than C, without all the historical baggage and minefield complexity of C++, and compiles to fast binary. I know lots of people these days say Java (or whatever your favorite slower language is) is fast enough, programming cos
Re: (Score:1)
Then write yourself or ask a friend a c++ string class with the "operator overloading" you need. Then use a c++ compiler to compile your C code.
OTOH ... the languages you use limit the way how you think about problems and hence it limits your solutions and approaches.
I hope you have at least managed ONE single high level language (and no, C is not a high level language, it is a portable assembler, that is all)
Re: (Score:2)
That was painful. Really. I can't believe that anyone, even you, could write such total nonsense.
What's with the bit about the Sapir–Whorf hypothesis in the middle of that screed? Have you been drinking?
Re: (Score:3)
Re:Enough already. (Score:5, Insightful)
There are too many programming languages.
Some people describe the recent increase in the number of languages as the Cambrian explosion [wikipedia.org], but what we need now is a mass extinction [wikipedia.org].
Re: (Score:2)
How many new languages really have anything new or interesting? Most just seem like whatever struck the author as a "best of" list. I'm learning Haskell out of curiosity, because it's genuinely different from other languages I know. However, knowing Perl and Python, learning Ruby or Lua strikes me about as interesting as watching paint dry. You can argue until hell freezes over about the pros and cons of different ones, but is there really that much difference? I'm not worried about saying that, because I'm
Re: (Score:3)
The one really useful "new" language that I've seen this past decade has been Scratch, something that I think could be turned into a production language (as opposed to the tutorial language that MIT uses it for). There have been some attempts to do just that by some other 3rd party developers, but it certainly isn't widespread and they largely take clues from what MIT is doing with the base language.
The GUI development environment is definitely useful, and I like how Scratch does multi-threaded application
Re: (Score:2)
Having more languages is better than having fewer.
Tell that to the guys who were trying to build that great big tower in the land of Shinar! Enki might agree, though.
So...Off-brand Scala? (Score:3, Interesting)
Reading the language description, I don't see anything notably distinct from Scala. If anything, Ceylon seems a bit clunkier. The one upside appears to be baked in translation into JS, but others have already provided a Scala -> JS parser.
Ceylon? (Score:4, Funny)
Shouldn't it be Sri Lanak?
Re: (Score:2)
Re:Ceylon? (Score:5, Interesting)
Serendib is the Arabic name for the Island, and Serendip in Persian. A Persian folk tale "The Three Princes of Serendip" became known in England through a 16th century Italian translation. The protagonists of that story were in the habit of discovering of things they were not seeking. In 1754 Horace Walpole, English writer and parliamentarian, coin the English word "serendipity" to capture that happy characteristic.
Taprobane, a Greek name for the island, would be another literary allusion.
Re: (Score:2)
I can see HR all over it... (Score:2)
Submit your resume till December 1st, 2013...
Re: (Score:2)
Out of mod points, but a virtual +1 for you, sir.
Re: (Score:2)
Not unreasonable - they're looking for people who understand time travel.
Re: (Score:2)
Comparison to Java (Score:2)
Since Ceylon seems to be Java inspired, I looked for a comparison of the two but didn't find one. Wikipedia's entry about it [wikipedia.org] says, "The project is described to be what a language and SDK for business computing would look like if it were designed today, keeping in mind the successes and failures of the Java language and Java SE SDK." That nice, but can anyone here supply some details?
But.. (Score:2)
>combining subtype and parametric polymorphism with declaration-site variance, including first-class union and intersection types, and using principal types for local type inference and flow-dependent typing; a unique treatment of function and tuple types, enabling powerful abstractions; first-class constructs for defining modules and dependencies between modules; a very flexible syntax including comprehensions and support for expressing tree-like structures; and fully-reified generic types, on both the
Re: (Score:2)
I tried Haskell once. Only once.
Re: (Score:2)
Only once.
That's the point - you can never re-assign to a variable.
Re:But.. (Score:5, Funny)
Only once.
That's the point - you can never re-assign to a variable.
It felt like a kick in the monads.
Concurrency (Score:4, Insightful)
I have no interest in a new language that has concurrency story at all.
Any new language needs to address the biggest development challenge of this time - coding for multiple cores.
Re: (Score:1)
I have no interest in a new language that has concurrency story at all.
Should be 'has no concurrency story', geez....
Re: (Score:2)
Is it really the language's job to bake that in? Akka should run on Ceylon without much issue, unless they've really changed things since I last looked at it.
Re: (Score:1)
Is it really the language's job to bake that in?
Why build a better type system, or any type system at all, when I can just call everything an Object?
A better type system makes it easier for developers to create correctly working, and efficient, code.
Coding for concurrency is very difficult and a proper concurrency approach (ala Go or Rust) make it much easier for developers to develop correctly working, and efficient, code.
Add-on libraries like Akka make things a little easier but can't help nearly as much as a properly designed concurrency architecture.
harmful constructs (Score:3, Insightful)
Any language that states as a goal: omission or elimination of potentially-harmful constructs, but keeps the awful C construct:
...
if (x = 3)
{
}
is not really serious about elimination of harmful constructs.
Re: (Score:2, Informative)
That example does not compile in Ceylon with a compile error that disproves your claim:
expression must be of boolean type: Integer is not assignable to Boolean
variable value x = 3;
if ( x = 4 )
{
}
Re:harmful constructs (Score:4, Informative)
That example does not compile in Ceylon with a compile error that disproves your claim:
expression must be of boolean type: Integer is not assignable to Boolean
variable value x = 3;
if ( x = 4 ) {
}
if(x=true) ...
This is still bad.
Re: (Score:2)
how about
if (parityA=(parityB xor parityC))
is that an extra bug? of course not. It's a buggy construct which luckily gets caught often by the type checker, but still shouldn't be there.
Re: (Score:2)
For some reason, I always hate it when people choose an explicit
rather than just
I'm glad those people have to hunt for extra bugs ;)
Absolutely! If you give the boolean variable a good name it makes the code read logically:
if (thing_is_valid)
{
do_stuff();
}
By your command... (Score:2)
...line.
Red Hat's plans (Score:5, Interesting)
Re: (Score:2)
If they could use Ceylon over python for the system tools, that'd be a godsend. I know there are some good python programmers out there, but everybody writing Redhat system tools isn't a good python programmer. Node.js is coming along nicely, and that'd be a great combination.
Hrm, maybe next time I need to poke the hornet's nest...
Re: (Score:2)
A bit late, but Ceylon creator Brian Krig answered the following question in an interview [jaxenter.com] posted today:
Finally, going forward, do you think that going forward, Red Hat will start coding more in Ceylon?
The first step for us will be to bring some of our pieces that we have in the JBoss ecosystem that we delivered as pieces of the application server, and repackage them, and make them modular, and make those modules for the Ceylon platform.
At the same time as that, we're taking Ceylon, and we're enabling deployment to Openshift. Once we have then the capabilities that we have in JBoss, also for Ceylon, then it's going to be a lot more interesting - what can we do in Ceylon that we can currently do in JBoss?
People often ask me, does RedHat use Ceylon to build internal projects, and I'm always kind of like, I don't quite understand, we don't have internal projects, we're a product company!
Re: (Score:2)
no
Potentially (Score:2)
elimination of potentially-harmful constructs
When did English speakers fall in love with the word potentially?
We already have a single word for potentially harmful: it's called dangerous.
Even worse is the infestation of the phrase could potentially, which means the same thing as could.
YABL (Score:4, Funny)
Yet Another Brace Language
Re: (Score:2)
YAML
Yet another meh language.
Gavin needs a beard (Score:2)
Sri Lanka (Not Ceylon) (Score:3)
Sri Lanka was Ceylon
Now it's Sri Lanka, not Ceylon
Been a long time gone, Ceylon
Now it's subcontinental delight on a moonlit night
Every gal in Ceylon
Lives in Sri Lanka, not Ceylon
So if you've a date in Ceylon
She'll be waiting in Sri Lanka
Readability (Score:2)
The language features, an emphasis upon readability
Not inserting superfluous commas, would be a good place to start.
Re: (Score:2)
I love language wars, but the truth is while fanatics like me are looking for the perfect blend of our favorite features and abstractions from Lisp/Haskell/Scala/C++/APL/Ceylon/Clojure/Python/Ruby/Perl6/J, the people using PHP, Python, Perl, Java, and especially C and C++ rule the world.
Re: (Score:2)
If you want billions, the choice of language doesn't matter. If you've ever seen the Curious George movie though, you'll understand that the real money is in parking garages.
Re: (Score:2)
And it's a fun discussion to have, I really enjoy it. But eventually I realized I was spending so much effort seeking the per
Re: (Score:2)
So what sort of "language tradition" does PHP fall under?
The tradition of using PCP [wikipedia.org]. Did you think that the name similarity is a coincidence?
Re:Fits partially with tradition (Score:5, Insightful)
Pure practicality?
PHP didn't even start out as a programming language. Even now, you can happily look at it as a bunch of stuff that makes it easy for people make dynamic websites. It is clearly quite successful. It's successful because it was really good at doing the job it was, er, "designed" to do.
PHP, then, would fall neatly under the "successful languages" category.
Hate it all you want. Bitch and moan on Slashdot 'till your fingers bleed. It's not going away any time soon. There is no alternative that is even half as easy to set up and use. There is no suitable replacement. That "unusable" language just happens to be the best thing around.
I point out this obvious fact because it drives morons incapable of forming their own opinions crazy. With any luck, they'll stop polluting every programming related thread with their miserable whining.
PHP is there so you use it (Score:2)
Re: (Score:2)
> What's the benefit for people to invest more time into learning a language?
In this case it lets you use a different language than Java in a JVM. That has to be a good thing, regardless of the language.
Re: (Score:2)
Have they done C yet?
Re: (Score:3)
Haskell is a truly different language, but what's the big deal about Python vs. Ruby Vs. Lua?
Syntax is everything! (Score:2, Funny)
Haven't you heard! We discuss this all the time behind the bike shed!
Re: (Score:2)
The farmer's daughter joins you behind the bike shed and you want to debate programming languages? New hypothesis: geeks rarely get lucky because they don't even realize when it's offered to them.
P.S. There was a good Big Bang Theory episode about that.
Re: (Score:2)
Then I discovered Erlang and found it to be the best solution ...
We should recognize a new class of Language Wars for functional languages. Allow me the honor of firing the opening salvo: Erlang sucks, Haskell rulez! (not that I know Erlang, but why should I bother to learn it when it's such a lousy language).
Re: (Score:3)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Consider: int x; What happens here? x = 3.1415
Hopefully you get an error.
BTW, you rounded wrong. Pi to 4 decimal places is 3.1416. However, in order to round 3.1415926 to 4 decimal places "correctly", you should specify the exact type of rounding you want to use. In that case it probably wouldn't matter, but there are plenty where it does. The cumulative effect of rounding a number of numbers can be significant (pun intended).
It's because of all the things that programmers have to memorize that programming is hard.
People learn the difference between integers and reals in grade school.
Having to write int() every time he wants an integer: 1. decreases bugs, and 2. makes the code more readable.
That's an argument for static typing. It forces you to sp
Re: (Score:2)
People can learn to think in types. But that's a learnt ability, not a natural one.
So fractions and decimals are a natural way to think? Most kids in the earliest grades could disabuse you of that notion.
Re: (Score:1)
Like javascript? 1+2 = 12?
If you are not going to have strong types, then you must use a different operator for string concatenation vs. math. The above is one reason I can't stand javascript.
Re: (Score:2)
Re:Brain Dead (Score:5, Insightful)
People do not think in types.
Piaget would disagree with you.
http://en.wikipedia.org/wiki/Schema_(psychology) [wikipedia.org]
Re: (Score:2)
Re: (Score:2)
Speak for yourself. Like most people I learned the difference between integers and reals, and between numbers and the notation for numbers, before high school.
Re: (Score:2)
In programming, our challenges includes some tightly coupled issues. Identifying and removing errors to large programs and keeping code complexity to a minimum. Strict typing usually eliminates a number possible errors. Unexpected autoboxing is one of them, depending on the strength of the type system. You describe adding a 0 to a string, which is how people think for a simple domain. A type is a domain. An int will (in most languages) not contain .01 nor 1i nor A. Representative values notwithstanding. So
Re: (Score:2)