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

Multidimensional-array in Ceylon

I would like to work in Ceylon with a multidimensional array. Is this planned in Ceylon? If so, how can I declare it? I would like to use this construct in Ceylon, as shown here in Java: int x = 5; int y = 5; String[][] myStringArray = new String…
Martin
  • 11
  • 2
1
vote
1 answer

ceylon.test.TestRunner fails when tests fails

Whenever a test function (a function annotated with test) contains assertions that fail, the assertion has the same effect as when trowing an exception: no further code lines in that function will be executed. Thus, assert statements in functions…
user134055
1
vote
1 answer

TestRunner.run() doesn't run testst?

I have created a 'Hello World' type test suite, but I can't seem to have it run any tests. When executed, it simply says: reached run function Process finished with exit code 0 I can thus tell that my two functions containing tests are never…
user134055
1
vote
1 answer

Creating a ceylon.test.TestRunner

I'm trying to create a test suite that I can run programmatically. (The documentation does mention that one can tease an IDE into doing the test running, but it seems to me a more regular approach to set up the test suite as a standard Ceylon module…
user134055
1
vote
1 answer

Top level function names restricted?

Normally Ceylon loves when a file name corresponds with the name of the (only) class that gets declared in that file. When I try to follow the same pattern with a top level function, the IDE barks at me. Example: File…
user134055
1
vote
2 answers

Check the type of an enumerated class

I have an enumerated abstract class: shared abstract class Foo() of bar|baz {} And a function that attempts to check if a Foo is not a bar: shared void test(Foo foo) { if (!is bar foo) { } } I get the error incorrect syntax: no viable…
Papershine
  • 4,995
  • 2
  • 24
  • 48
1
vote
2 answers

RMI/Proxy in ceylon and relation to non-default methods

I want to write an RMI library in/for Ceylon (since I have not found one so far). The first thing I need is a proxy. In Java I used something like Proxy.newProxyInstance(classLoader, interfaces, handler); 1. Is there something equivalent in…
1
vote
1 answer

Are there wildcards for use with the switch expression/statement in Ceylon?

The title is my question. Specifically, wildcards are important when matching against values in tuples. In OCaml it is possible: match x with (3, _) -> 5 | (_, 4) -> 7 | (4, 5) -> 6;; A 'switch' contruct, that allows matching against…
Malelago
  • 31
  • 3
1
vote
1 answer

Writing an if statement in Ceylon

I have tasked myself with writing a file writer in Ceylon and in the process of doing so I have been hit by the crushing difficulty of writing an if statement in Ceylon, that will be allowed to pass when facing the mighty Wizard of Type Correctness…
user134055
1
vote
1 answer

Where to put a module descriptor for the default module?

I have chosen to put the code of my small project in the 'default' module (in the file /source/main.ceylon), but where do I then place my module descriptor? Currently I have it in /source/module.ceylon but that gives me the dire warning "module…
user134055
1
vote
4 answers

ceylon run: Module default/unversioned not found

Today i installed the intelliJ ceylon IDE on my macbook. When compiling my project I get the following message /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java…
Kadziola
  • 13
  • 2
1
vote
1 answer

Compiling code from within IntelliJ

I've managed to compile and execute Cyelon code in the 'Walkthrough' repository, by right clicking a function and choosing 'Run functionName'. I've also tried creating my own Ceylon-project (named POSTtoFile) and seeing if I could execute a 'Hello…
user134055
1
vote
0 answers

How can I serialize a Ceylon 'Bean'?

How can I (easily) serialize ceylon objects to json with jackson? I assume it should work 'out of the box' - because the specification says: "... Ceylon maps instance attributes to JavaBean properties, so naturally, every JavaBean property defined…
1
vote
2 answers

The ceylon copy tool

I'm using the ceylon copy command of ceylon version 1.2.3 to download a dependency: ./bin/ceylon copy --rep "http://repo.maven.apache.org/maven2/" -out outdir "joda-time:joda-time/2.9.4" Why is the result that the tools skips downloading…
user3464741
1
vote
1 answer

Runtime meta programming in ceylon

I get unexpected results from the following code snippet using the eclipse ide: class Example(String s = "init") { shared String a() => "Func 1"; shared String b = "Attr 1"; shared String c(Integer i) { return "Func 2"; } } shared void…
user3464741