Slashdot Mirror


Red Hat Releases Ceylon Language 1.0.0

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.

37 of 159 comments (clear)

  1. Cool! by warrax_666 · · 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.

    --
    HAND.
    1. Re:Cool! by ron_ivi · · Score: 5, Interesting

      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.

    2. Re:Cool! by Just+Some+Guy · · Score: 5, Interesting

      You'd love Haskell.

      --
      Dewey, what part of this looks like authorities should be involved?
    3. Re:Cool! by naasking · · Score: 2

      There are plenty of these around. F# has one. Check out their papers on dimension checking.

    4. Re:Cool! by coolsnowmen · · Score: 2

      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 easily. So, now I always to int interval_ms = 5000; or float box_distance_km = 10; (Time and length were the most common errors)

    5. Re:Cool! by amiga3D · · Score: 3, Funny

      I swear I thought that said Cylon language and I started thinking, first Klingon and now Cylon?

    6. Re:Cool! by Anonymous Coward · · Score: 5, Funny

      You'd love Haskell.

      I hear a lot of scheme-brained hares saying this.

      But I assure you, you're wrong.

    7. Re:Cool! by ebno-10db · · Score: 2

      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.

    8. Re:Cool! by Decker-Mage · · Score: 2

      Actually, you're probably better off implementing the whole job lot of the physical sciences in scalars, vectors, tensors, yada, yada. Then it wouldn't be anywhere as difficult to figure out which type you get out the other side of the equations. Especially when dealing with cross-products and phasing.

      --
      "[I]t is a wise man who admits the limits of his knowledge or skill, and that pretending either causes harm." --Terry Go
    9. Re:Cool! by jbolden · · Score: 2

      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 Qi or Shen both offer a type system fully programmable in a prolog.

  2. Shite by Hognoxious · · Score: 5, Insightful

    The language features, an emphasis upon readability and a strong bias toward omission or elimination of potentially-harmful constructs

    Like that comma?

    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  3. Re:Enough already. by Mitchell314 · · Score: 4, Insightful

    Honestly, I'd be happy with just a C variant with built-in string support.

    --
    I read TFA and all I got was this lousy cookie
  4. So...Off-brand Scala? by Anonymous Coward · · 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.

  5. Ceylon? by rssrss · · Score: 3, Funny

    Shouldn't it be Sri Lanak?

    --
    In the land of the blind, the one-eyed man is king.
    1. Re:Ceylon? by rssrss · · Score: 4, 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.

      --
      In the land of the blind, the one-eyed man is king.
  6. I can see HR all over it... by deimios666 · · Score: 2

    Ceylon developers wanted with at least 5 years experience with the language.
    Submit your resume till December 1st, 2013...

    --
    I think, therefore you are.
  7. Re:Enough already. by jandrese · · Score: 2

    If I was making a language that was C with a few more features, I wouldn't stop at just better string handling. I would also include a method of inspecting the heap so a function passed a pointer knows just how much storage is available at that pointer. I would also steal C++'s single line comment delimiter (//), and pass by value mechanic. I'd also build a first class regex utility into stdlib, but that's just me.

    --

    I read the internet for the articles.
  8. Concurrency by emorning9707 · · 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.

  9. harmful constructs by Alomex · · Score: 2, 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.

    1. Re:harmful constructs by Anonymous Coward · · 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 )
                  {

                  }

    2. Re:harmful constructs by preflex · · 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.

  10. Re:Brain Dead by squiggleslash · · Score: 2

    3.14 * 10 == 3.140?

    (And what would that have to do with anything anyway? And actually, the popularity of the phrase "You're comparing apples to oranges!" shows that, actually, people do think in types, and get annoyed when others treat one type as another unthinkingly.

    --
    You are not alone. This is not normal. None of this is normal.
  11. By your command... by meeotch · · Score: 2

    ...line.

  12. Thank goodness by fyngyrz · · Score: 3, 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. :)

    --
    I've fallen off your lawn, and I can't get up.
    1. Re:Thank goodness by RightSaidFred99 · · 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".

    2. Re:Thank goodness by fyngyrz · · Score: 2

      you mean counting indentation spaces

      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 visually dependent, then sure, Python is probably a pain your ass. But for me, I always put code in deeper visually when it is deeper structurally, and that makes it much easier, rather than more difficult, to debug.

      In my code, indent means dependent. The editor makes sure I can see the indentation properly. This is basically all one needs to manage a language that incorporates the idea of indent into the code. If you're not comfortable with that, there are a plethora of languages that are right with your ideas, and by all means, enjoy them. Me, I'm perfectly happy with Python, and in no way suffering either your imaginary indent-based bugs or the "difficult to support and debug" software imagined by your respondent, below.

      --
      I've fallen off your lawn, and I can't get up.
  13. Re:Enough already. by ReAn1985 · · Score: 4, Informative

    D does!. But D also has so many neat features.

    D is wonderful, and it can interop with C / C++ or write inline ASM for you micro-optimists out there.

  14. Re:Brain Dead by Kongming · · Score: 4, Insightful

    People do not think in types.

    Piaget would disagree with you.

    http://en.wikipedia.org/wiki/Schema_(psychology)

    --
    (no sig)
  15. Re:Why use this? by ebno-10db · · Score: 2

    Haskell is a truly different language, but what's the big deal about Python vs. Ruby Vs. Lua?

  16. Re:Enough already. by ebno-10db · · Score: 4, Insightful

    There are too many programming languages.

    Some people describe the recent increase in the number of languages as the Cambrian explosion, but what we need now is a mass extinction.

  17. Syntax is everything! by Anonymous Coward · · Score: 2, Funny

    Haven't you heard! We discuss this all the time behind the bike shed!

  18. Red Hat's plans by Kongming · · Score: 5, Interesting

    I am curious as to Red Hat's practical motivations for creating this language. Specifically, do they plan on integrating it in their existing business or projects in any way?

    --
    (no sig)
  19. Re:But.. by TechyImmigrant · · Score: 4, Funny

    Only once.

    That's the point - you can never re-assign to a variable.

    It felt like a kick in the monads.

    --
    I should use this sig to advertise my book ISBN-13 : 978-1501515132.
  20. YABL by iliketrash · · Score: 3, Funny

    Yet Another Brace Language

  21. Re:Fits partially with tradition by narcc · · Score: 4, 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.

  22. Re:Enough already. by Teancum · · Score: 2

    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 applications like breathing air... it really is built into the language in a very basic and fundamental way. That in particular is something which should be leveraged more.

    Beyond that, I would agree that most of the new languages I've looked at seem to be a rehash of C in some fashion with a few variations that either try to remove semicolons or do some other interesting things but still are just variants on the same general syntax philosophy. I'm an old Delphi programmer that has been sort of left behind as that programming community has shrunk to just a few diehard fans and I haven't really found anything to replace that kind of programming environment of hand-crafted gems that could do just about anything you wanted including rewriting base classes in the compiler (assuming that was something you felt necessary for that particular project).

  23. Sri Lanka (Not Ceylon) by Frankie70 · · Score: 2

    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