Example programs and applications
We're collecting examples here.
Examples of client-side Ceylon
We have three small demo application which illustrate the use of Ceylon in a web browser:
Examples of server-side Ceylon
Ceylon is a fantastic language for writing microservices:
Wildfly Swarm and Ceylon demonstrates the use of Ceylon
to write a Java EE-based microservice for Swarm, using
JPA, CDI, and JAX-RS, and of the
ceylon swarmcommand to package it as a "fat" jar. Alternatively, you can use
ceylon warto package it as a web archive and run it on a Java EE application server!
- Spring Boot and Ceylon demonstrates the use of Ceylon with Spring Boot and Spring Data.
- The Vert.x examples include several samples showing how to use Ceylon in Vert.x.
- Spark with Ceylon demonstrates how to use the Spark web framework in Ceylon.
- The gyokuro demos show off the gyokuro web framework, which is written in Ceylon.
Documentation for Ceylon and Vert.x can be found at the Vert.x site.
Examples of full-stack applications
- The Ceylon Web IDE is a great example of how to build a modern web application using Ceylon, making use of Ceylon's HTTP and JSON APIs, and interoperation with native Java libraries. The example even supports deployment to the OpenShift cloud platform.
- The Ceylon DDDSample demonstrates the use of Ceylon to write a complete Java EE application, making use of JPA, CDI, EJB, JAX-RS, JMS, JSF, and Facelets.
Learn how to use Ceylon with these Java frameworks:
- JDK Collections and Streams in Ceylon shows how easy and natural it is to use Java's collections and streams APIs directly from Ceylon.
- Java Persistence in Ceylon demonstrates the use of JPA for Object/Relational Mapping.
- For Java-style dependency injection, check out Weld and Guice with Ceylon, based on this blog post.
- The RxJava examples project is a port of the basic RxJava examples from the RxJava documentation to Ceylon.
- OpenGL in Ceylon shows the use of JOGL in a Swing application.
- This IntelliJ UI designer example shows how to use IntelliJ IDEA's GUI Designer.
The Ceylon OSGi examples demonstrate how to use Ceylon modules as OSGi bundles, and how to:
- run the Ceylon HTTP server inside an OSGi container,
- call standard OSGi services,
- integrate with Pax Web in order to produce a web application packaged as a single Ceylon module, or
- write an Eclipse plugin.
Examples of libraries
The Ceylon SDK includes plenty of good examples of Ceylon code, including:
ceylon.collectiondemonstrates some very typical usage of generics.
ceylon.filedemonstrates the use of enumerated types and shows how to wrap a native Java API.
ceylon.regexis a cross-platform module that demonstrates the use of
ceylon.localeis a cross-platform module that demonstrates the use of resource loading.
ceylon.testdemonstrates some very typical usage of the metamodel.
ceylon.promisedemonstrates advanced use of abstraction over function types.
ceylon.jsonillustrates a rather cool use of union types.
A plugin for the
ceylon command is a great way to improve
ceylon swarmis a super-simple plugin that just wraps an existing Java library.
ceylon formatis much more elaborate.
Examples of real life warts-'n-all production code
The Ceylon plugin for VS Code exhibits a whole completely different approach to implementing tooling in Ceylon.
The Ceylon Dart project shows that it's possible to write a whole backend for the Ceylon compiler in Ceylon.