Blog of David Festal

First maintenance update for the Ceylon IDE version 1.2.0

Introducing the first Ceylon IDE maintenance update

Just after the release of Ceylon 1.2.0, we started managing a maintenance branch of the IDE-related code, that will always be fully compatible with the last release of the Ceylon (Command line distribution and SDK).

This way we've already been able to very easily backport to this branch many bug fixes or enhancements implemented on the main development branch.

As a result, the first maintenance update of the Ceylon IDE plugin for Eclipse, which fixes about 30 issues, has just been published onto the main Ceylon IDE update site.

So if you currently use the version 1.2.0 of the Ceylon IDE Eclipse plugin, simply run the Check For Updates command in the Eclipse Help menu, and Eclipse should propose you to update the Ceylon IDE features.

And if you still don't use the Ceylon IDE Eclipse plugin, just install it and give it a try now.

Source tracking

Of course each maintenance update will be tagged inside the GitHub source repositories.

So as soon as we know the version of the Ceylon IDE feature, visible from the Eclipse About dialog:

we can immediately checkout the precise source code corresponding to a Ceylon IDE installation.

This will help us reproducing more easily, and fixing more quickly, any issue encountered on the production Ceylon IDE.

Maintenance update release notes

Detailed release notes of this maintenance update can be found here, and related commits can be found here.

Issues

Bugs and suggestions may be reported in GitHub's issue tracker.

About Ceylon

Ceylon is a highly understandable object-oriented language with static typing. The language features:

  • an emphasis upon readability and a strong bias toward omission or elimination of potentially-harmful or potentially-ambiguous constructs and toward highly disciplined use of static types,
  • an extremely powerful and uncommonly elegant type system combining subtype and parametric polymorphism with:
    • first-class union and intersection types,
    • both declaration-site and use-site variance, and
    • the use of principal types for local type inference and flow-sensitive typing,
  • a unique treatment of function and tuple types, enabling powerful abstractions, along with the most elegant approach to null of any modern language,
  • first-class constructs for defining modules and dependencies between modules,
  • a very flexible syntax including comprehensions and support for expressing tree-like structures,
  • fully-reified generic types, on both the JVM and JavaScript virtual machines, and a unique typesafe metamodel.

More information about these language features may be found in the feature list and quick introduction.

Write in Ceylon, deploy as OSGI, use in Java EE

... or how to use Ceylon inside Java EE application servers.

The Ceylon language is inherently modular, and is shipped with a complete infrastructure that allows leveraging this modularity out-of-the box. However Ceylon is not captive of its own infrastructure. After the Java and JS interoperability efforts, the 1.1.0 version has brought out-of-the-box compatibility with OSGI, which enables running Ceylon code inside many other containers.

Every module archive produced by the Ceylon compiler contains OSGI headers in its MANIFEST file, that describe the module as it should seen by OSGI containers.

Containers tested so far are:

  • Apache Felix 4.4.1,
  • Oracle Glassfish v4.1,
  • Equinox platform,
  • JBoss WildFly 8.0.0.alpha3 (with JBossOSGi installed)

Of course, the Ceylon distribution and SDK modules should first be added inside the OSGI container as OSGI bundles.

But instead of writing long explanations here, let me direct you to some concrete examples provided, with the required instructions, in the following repository:

https://github.com/davidfestal/Ceylon-Osgi-Examples/

For the moment, it contains a single example that, though very simple, will give you the main steps to start.

It also shows the use of a Ceylon module totally outside Ceylon's standard infrastructure, even outside the JBoss world, in a Web application servlet running on a Glassfish v4.1 application server. But of course you should be able to run it inside other OSGI-enabled application servers or containers.

In the next examples we'll try to go further an do more interesting things such as providing services, using Ceylon annotations (which are compatible with Java annotations), or using OSGI services.

Please report any problem you might encounter while testing, and feel free to submit pull requests for any other successful use cases you might have built.

Looking forward for your remarks, and for the time to write the following examples.

First official release of Ceylon IDE

Today, we're proud to announce the first official release of the Ceylon IDE.

teaser

This release is fully compatible with the already-released Ceylon M1 "Newton" command line distribution which contains the compiler, documentation compiler, language module, and runtime. On the other hand, Ceylon IDE can be used as a standalone Ceylon development tool, even if the full Ceylon distribution is not already separately installed.

You can install Ceylon IDE from our Eclipse plugin update site. The welcome page is a gentle way to get started with Ceylon.

Main features

A full list of features with screenshots can be found here.

Among the features that have greatly enriched the IDE since its first pre-release builds, the following stand out:

  • A Ceylon perspective, welcome page, and cheat sheets.
  • Wizards to create new Ceylon projects, modules, packages, and units.
  • Cross-project dependencies and navigation: add another Ceylon project on the build path, and dependencies are automatically handled.
  • Full integration with the Ceylon module architecture: resolve dependencies in an external module repository, and easily export your Ceylon project as a module to a selected repository.
  • Enhancements to refactorings, including the ability to refactor even in dirty (unsaved) editors.
  • New quick-fixes: for example, when an identifier is unknown, automatically create a new file containing a stub for the missing declaration.
  • Improved autocompletion: proposals are now sorted to prioritize those which are assignable to the expected type, as well as those which are declared nearby.
  • Customization: easily configure your own colors for syntax highlighting.
  • And, of course, many adjustments and bug fixes to provide a stable release.

About Ceylon

This page provides a quick introduction to the language. The draft language specification is the complete definition.

Source code

The source code for Ceylon, its specification, and its website, and its IDE is freely available from GitHub:

https://github.com/ceylon

Issues

Bugs and suggestions may be reported in GitHub's issue tracker.

Community

The Ceylon community site includes documentation, the current draft of the language specification, the roadmap and information about getting involved.

http://ceylon-lang.org

Update on the debugging support in the IDE

Basic support for debugging ceylon programs is now available in the IDE plugin on GitHub.

Description of available support

How to install

From the sources

For those who already have the ceylon-ide-eclipse plugin project in the Eclipse workspace, just pull the last GitHub version and run with a "Eclipse Application" launch configuration.

From the update site

  • From within Eclipse, install or update the Ceylon plugin through the Ceylon Update Site : http://ceylon-lang.org/eclipse/updatesite/
  • Restart Eclipse
  • You should be able to use basic debugging support

How to use it

Start debugging a ceylon program

In order to debug a ceylon program, just do the following : - When editing a ceylon source file, you can add a breakpoint by double-clicking in the editor ruler. - In the Package Explorer, select the ceylon source file. - In the contextual menu, start the following command : Debug as -> Ceylon Application - If more than one top-level definition is available in the source file, a dialog allows you to choose the one you want to debug. - The program is then started and paused at the first breakpoint. - You can then use the Step into, Step over and Step out or Resume buttons, just as with JDT debugging.

Step Filtering

In order to avoid going into unwanted stackframes when stepping into the code, you should activate debug step filtering in the Eclipse general preferences : Java -> Debug -> Step Filtering

Select all the proposed filters, as well as the simple getters and setters.

Variables View

The Variables is available in the Debug perspective, and shows the variables in the current stack frame context. variables are shown in their Java flavour (that means how they had been translated to Java). However thanks to the Ceylon-Java mapping, the variable representation of objects is very near to what is declared in the ceylon file.

For the moment, the Change value contextual command only works for simple types such as String or numeric values.

Breakpoints View

The Breakpoints view is also available and, for each breakpoint, allows enabling/disable it, but also setting a hit count. However do to the type of breakpoint used internally, it is not possible to add a breakpoint condition for the moment.

Known problems and limitations

Line problems

It might happen that when paused on a specific stack frame, the instruction pointer is not positioned on the right corresponding line in the ceylon source file. This is due to wrong line information in the class files generated by the ceylon compiler. Such errors should be reported with the corresponding source code and erroneous lines, so that the corresponding problem in the compiler code would be corrected and additional tests implemented.

Limitations

  • In the Variables view, the Open Declared Type and Open Declared Type Hierarchy contextual commands don't work, since for now the variables are seen as pure Java variables. Thus the source file of the Ceylon objects cannot be found. This will be solved once the plugin is able to support a true Ceylon-specific debug model (see next section).
  • Also in the Variables view, the Watch contextual command doesn't work : the Watches is opened but the expressions are not successfully parsed and evaluated. This will also require some overloading of the standard JDT Debug support.

Next steps

  • Extend/override JDT debug model in order to :
    • add ceylon-specific step filters (e.g. for attribute generated getters, etc ...),
    • define ceytlon-specific lin-breakpoints that allow advanced usages such as conditions,
    • manage variables and values and type references with the ceylon semantics,
    • etc ...
  • Provide a more powerful breakpoint support (conditions, watchpoints, etc ...)
  • Override the expression management to support ceylon code parsing/evaluation
  • Allow ceylon code snippets in breakpoint cnditions for example
  • etc ...

Some (many) of those next steps, which mainly consist in extending/overriding existing implementations in JDT debug plugin, imply building a Ceylon-specific logical core resource model, by extending the JDT core model.