Questions tagged [ceylon]

Ceylon programming language for Java and JavaScript virtual machines.

Ceylon is a modern, modular, statically typed programming language for Java and JavaScript virtual machines. The language features a flexible and very readable syntax, a unique and uncommonly elegant static type system, a powerful module architecture, and excellent tooling, including awesome Eclipse- and IntelliJ-based IDEs.

The Ceylon language is defined by a readable specification.

Since 'Hello World' is the traditional way to introduce a language, here's how it looks in Ceylon:

shared void hello()
        => print("Hello, World!");

To learn more, you can start with the quick introduction or take the in-depth tour of Ceylon.


Current release: 1.3.3 (Contents May Differ)

  • Ceylon is open source on Github
  • Ceylon 1.4 is under development including migration of the compiler to the Eclipse Foundation.

Ceylon is:

  • Powerful: Ceylon's powerful flow-sensitive static type system catches many bugs while letting you express more, more easily: union and intersection types, tuples, function types, mixin inheritance, enumerated types, and reified generics.
  • Readable: We spend more time reading other people's code than writing our own. Therefore, Ceylon prioritizes readability, via a highly regular syntax, support for treelike structures, and elegant syntax sugar where appropriate.
  • Predictable: Ceylon controls complexity with clarity. The language eschews magical implicit features with ambiguous corner cases. The compiler follows simple, intuitive rules and produces meaningful errors.

Ceylon offers:

  • A platform: Ceylon is a whole platform with amodern SDK designed from scratch. It runs on both Java and JavaScript virtual machines, bridging the gap between client and server. Ceylon is fully interoperable with Java and the Java SDK, and with JavaScript and its libraries.
  • With modularity: Modularity is at the very core of the language, SDK, and tooling. The compiler produces module archives which are then distributed via a next-generation repository architecture with Ceylon Herd as its social focus point.
  • And tooling: Static typing is the technology that enables killer tools. Ceylon comes with a complete command line toolset, and awesome Eclipse- and IntelliJ-based IDEs with searching, refactoring, quick fixes + assists, autocompletion, debugging, and much more.
114 questions
1
vote
2 answers

Using modules in Ceylon

I'm checking out Ceylon. I want to play with the HTML module, but have no idea how to import it. IMHO the documentation about modules do not address this simple task. Thank you Gilad
Gilad
  • 538
  • 5
  • 16
1
vote
1 answer

Using Ceylon classes in Spring Boot application

Is it possible to use Ceylon classes in a Spring Boot application? What would that look like - the Ceylon classes as a separate dependency, or could they be in the same project? I've got a particularly knotty Java problem that would really benefit…
DeejUK
  • 12,891
  • 19
  • 89
  • 169
1
vote
2 answers

Error while running the ceylon tutorial code

I'm following this tutorial which is giving me this code: "Run the module `hello.ceylon`." shared void run() { process.write("Enter a number (x): "); value userX = process.readLine(); value x = parseFloat(userX); process.write("Enter…
rubenh
  • 21
  • 1
1
vote
1 answer

Specify Generic Type In Named Constructor With Ceylon

I have the following code in Ceylon: shared class Try given Result satisfies Anything { late Result|Exception computationResult; shared new (Result() computation) { try { this.computationResult =…
ElderMael
  • 7,000
  • 5
  • 34
  • 53
1
vote
1 answer

Jimfs path to ceylon Directory

I'm trying to create a directory (using ceylon's file module) in the Jimfs file system but I'm having problems with the Jimfs provider not being installed when accessing the filesystem from ceylon. This is my test program: // File:…
Gustav Karlsson
  • 1,151
  • 9
  • 25
1
vote
1 answer

How to build ceylon using the ceylon commandline tools?

How can I setup and build the ceylon distribution as a mixed java and ceylon project using only the ceylon commandline tools instead of ant? I assume having cloned the git repository, cleaned and dist-ed the ant project following the instructions in…
user3464741
1
vote
1 answer

Iterating over enumeration values

Say I have this enum in Ceylon: abstract class Suit() of hearts | diamonds | clubs | spades {} object hearts extends Suit() {} object diamonds extends Suit() {} object clubs extends Suit() {} object spades extends Suit() {} I would like to…
drhagen
  • 8,331
  • 8
  • 53
  • 82
1
vote
1 answer

Is it possible to use Ceylon with Maven and/or Gradle and/or SBT?

I see that Ceylon requires Ant and has its own build system. Is it possible to compile Ceylon files inside common build tools?
Vitaly Olegovitch
  • 3,509
  • 6
  • 33
  • 49
1
vote
1 answer

How can I write a code generator in Ceylon

I want to write a code generator that generates a class based on the meta model of another ceylon class. I want the code generator to run at compile time. What is the best way for me to do this. I could probably accomplish this by writing a plugin…
jgleoj23
  • 262
  • 2
  • 9
1
vote
2 answers

Ceylon version 1.2 Format Command

How can I fix that: Command: $ ceylon format source/com/example/helloworld/* Exception: Exception in thread "main" java.lang.NoSuchMethodError: ceylon.language.runtime_.getMaxArraySize()Lceylon/language/Integer; at…
user3464741
1
vote
1 answer

Compile Ceylon Js Code with Google Closure Compiler in Advanced Mode

What is the recommended way to optimally minimize the size of ceylon javascript code?
user3464741
1
vote
2 answers

Convert a stack trace to a value

I want to get Throwable.getStackTrace() result as a value in Ceylon. Java interface has printStackTrace method with parameter PrintWriter, but Ceylon Throwable interface has not. How can i get it?
omerfarukdemir
  • 158
  • 1
  • 10
1
vote
1 answer

How to instantiate a class using an explicit first, and a default second argument, via the meta model?

I have the following toplevel class: class Example(shared String first = "default one", shared String second = "default two") { } Now, I want to instantiate this class using an explicit value for first, but the default value for second. I know how…
Jean Hominal
  • 16,518
  • 5
  • 56
  • 90
1
vote
1 answer

Ceylon cannot apply some functions to tuples?

What's wrong with this code? value x = [[1, Color(0)]]; //Exception thrown here value y = x.map(([Integer, Color] elem) => "``elem[0]`` -> ``elem[1]``"); ... the last line could be replaced with this: value y = { for(elem in x) "``elem[0]`` ->…
Renato
  • 12,940
  • 3
  • 54
  • 85
1
vote
2 answers

Equivalent to the Java "static" keyword in Ceylon

I wondered if the Ceylon programming language features an equivalent to the "static" keyword in Java, or if there's some common idiom that's used in its place. Edit: elaborating on the answer, here's an example of a scoped "function" (its syntax is…
Magnus
  • 10,736
  • 5
  • 44
  • 57