Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Programming Red Hat Software

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.
This discussion has been archived. No new comments can be posted.

Red Hat Releases Ceylon Language 1.0.0

Comments Filter:
  • Cool! (Score:5, Interesting)

    by warrax_666 ( 144623 ) on Wednesday November 13, 2013 @01:34PM (#45414331)

    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)

      by ron_ivi ( 607351 ) <sdotno@cheapcomp ... s.com minus poet> on Wednesday November 13, 2013 @02:15PM (#45414937)
      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.
      • Re:Cool! (Score:5, Interesting)

        by Just Some Guy ( 3352 ) <kirk+slashdot@strauser.com> on Wednesday November 13, 2013 @02:18PM (#45414963) Homepage Journal
        You'd love Haskell.
        • Re:Cool! (Score:5, Funny)

          by Anonymous Coward on Wednesday November 13, 2013 @04:02PM (#45416069)

          You'd love Haskell.

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

          But I assure you, you're wrong.

        • by jbolden ( 176878 )

          I was about to write that too. Type enforcement like he is asking for is trivial in Haskell. So seconded.

          • 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?

            • 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.
            • by jbolden ( 176878 )

              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

      • by naasking ( 94116 )

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

      • 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.

      • 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.

        • 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?

          • 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.

      • 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.

      • 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

    • by Anonymous Coward

      trivial rehash of existing (in practice) ones.

      This is no time to be bashing Objective-C

    • Re:Cool! (Score:4, Funny)

      by amiga3D ( 567632 ) on Wednesday November 13, 2013 @03:28PM (#45415693)

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

    • by fyngyrz ( 762201 ) on Wednesday November 13, 2013 @03:52PM (#45415947) Homepage Journal

      ...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. :)

  • Shite (Score:5, Insightful)

    by Hognoxious ( 631665 ) on Wednesday November 13, 2013 @01:41PM (#45414441) Homepage Journal

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

    Like that comma?

    • 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.

  • by Anonymous Coward

    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

  • There are to many programming languages.

    • There are to many programming languages.

      Especially when you haven't mastered English yet.

    • by Mitchell314 ( 1576581 ) on Wednesday November 13, 2013 @01:52PM (#45414607)
      Honestly, I'd be happy with just a C variant with built-in string support.
      • Honestly, I'd be happy with just a C variant with built-in string support.

        Doesn't D have that?

        • D is probably closer to C++ than C.
        • by ReAn1985 ( 906976 ) on Wednesday November 13, 2013 @03:52PM (#45415949) Homepage

          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.

          • 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

      • 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)

        • by narcc ( 412956 )

          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?

      • by jandrese ( 485 )
        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.
    • by ebno-10db ( 1459097 ) on Wednesday November 13, 2013 @04:32PM (#45416435)

      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].

  • by Anonymous Coward on Wednesday November 13, 2013 @01:58PM (#45414695)

    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)

    by rssrss ( 686344 ) on Wednesday November 13, 2013 @02:18PM (#45414955)

    Shouldn't it be Sri Lanak?

    • Or they could have called it 'Serendipity' if the language is that good
      • Re:Ceylon? (Score:5, Interesting)

        by rssrss ( 686344 ) on Wednesday November 13, 2013 @06:08PM (#45417671)

        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.

  • Ceylon developers wanted with at least 5 years experience with the language.
    Submit your resume till December 1st, 2013...
  • 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?

  • >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

  • Concurrency (Score:4, Insightful)

    by Ted Stockwell ( 2878303 ) on Wednesday November 13, 2013 @03:03PM (#45415451)

    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.

    • I have no interest in a new language that has concurrency story at all.

      Should be 'has no concurrency story', geez....

    • 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.

      • 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)

    by Alomex ( 148003 ) on Wednesday November 13, 2013 @03:09PM (#45415501) Homepage

    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)

      by Anonymous Coward

      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 )
                  {

                  }

      • by preflex ( 1840068 ) on Wednesday November 13, 2013 @05:14PM (#45416997)

        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.

  • Red Hat's plans (Score:5, Interesting)

    by Kongming ( 448396 ) on Wednesday November 13, 2013 @04:56PM (#45416767)
    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?
    • 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...

    • 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!

    • no

  • 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)

    by iliketrash ( 624051 ) on Wednesday November 13, 2013 @06:13PM (#45417711)

    Yet Another Brace Language

  • Unless Gavin King grows some serious facial hair, Ceylon is a doomed language.
  • by Frankie70 ( 803801 ) on Wednesday November 13, 2013 @09:02PM (#45418965)

    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

  • The language features, an emphasis upon readability

    Not inserting superfluous commas, would be a good place to start.

"What man has done, man can aspire to do." -- Jerry Pournelle, about space flight

Working...