Ceylon compilation process (JVM)

74 views
Skip to first unread message

Tharindu Ranathunga

unread,
Aug 10, 2016, 2:55:18 AM8/10/16
to ceylon-dev
Hi,

I'm new to Ceylon and I wanted to study the compilation and run time behavior of Ceylon.Can some one explain me whats really a ".car" file is and how it converted into a class file
in order to run it in JVM ?  

Thanks

Bastien Jansen

unread,
Aug 10, 2016, 3:08:22 AM8/10/16
to ceylon-dev
Hi,

CAR stands for "Ceylon ARchive", it is exactly like a JAR file, except it was produced by the Ceylon compiler instead of the Java compiler. Like a JAR file, it's basically a zip file containing folders and .class files, and also a few metadata files that describe the Ceylon module contained in the archive.

To run the module on the JVM, you can either use the `ceylon run` command, or add the CAR file to the classpath of an application like any regular JAR file (although you won't be able to use it as a Ceylon module this way, just as regular compiled classes).

Tharindu Ranathunga

unread,
Aug 10, 2016, 11:27:52 AM8/10/16
to ceylon-dev
Hi,
So is it possible to run these compiled Ceylon modules from Java as well ? 

John Vasileff

unread,
Aug 10, 2016, 12:15:59 PM8/10/16
to ceylo...@googlegroups.com
If you need to load Ceylon modules from Java code, you can use the the tool provider api - http://ceylon-lang.org/documentation/1.2/reference/interoperability/ceylon-on-jvm/#using_the_ceylontoolprovider_api

A real-world example is the WarInitializer, allowing you to run Ceylon modules within a servlet container - https://github.com/ceylon/ceylon-sdk/blob/version-1.2.2/source/com/redhat/ceylon/war/WarInitializer.java. (To automatically package wars, see 'ceylon war --help’)

I believe Ceylon 1.2.3 (yet to be released) will have additional options, but someone else will have to elaborate on that.

John

-- 
You received this message because you are subscribed to the Google Groups "ceylon-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-dev+...@googlegroups.com.
To post to this group, send email to ceylo...@googlegroups.com.
Visit this group at https://groups.google.com/group/ceylon-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-dev/2211c985-5b76-436d-811d-16feb77030a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages