Discussion:
[ceylon-dev] Ceylon compilation process (JVM)
Tharindu Ranathunga
2016-08-10 05:50:09 UTC
Permalink
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
--
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 ceylon-***@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/c3f55aa3-9814-4336-8c79-86295f2a07f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Bastien Jansen
2016-08-10 07:08:22 UTC
Permalink
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).
Post by Tharindu Ranathunga
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
--
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 ceylon-***@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/662e8f9b-ba12-4b89-9eac-fccdcd642ed5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Tharindu Ranathunga
2016-08-10 15:27:52 UTC
Permalink
Hi,
So is it possible to run these compiled Ceylon modules from Java as well ?
Post by Bastien Jansen
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).
Post by Tharindu Ranathunga
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
--
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 ceylon-***@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.
John Vasileff
2016-08-10 16:15:54 UTC
Permalink
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 <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 <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
Post by Tharindu Ranathunga
Hi,
So is it possible to run these compiled Ceylon modules from Java as well ?
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).
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
--
You received this message because you are subscribed to the Google Groups "ceylon-dev" group.
Visit this group at https://groups.google.com/group/ceylon-dev <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 <https://groups.google.com/d/msgid/ceylon-dev/2211c985-5b76-436d-811d-16feb77030a2%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
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 ceylon-***@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/08E4885D-889A-4FC4-92A6-894AF2E7102B%40vasileff.com.
For more options, visit https://groups.google.com/d/optout.
Loading...