Dart backend preview release DP1

559 views
Skip to first unread message

John Vasileff

unread,
Nov 23, 2015, 1:59:00 AM11/23/15
to ceylo...@googlegroups.com
A current build of the Dart backend is now available on Herd, released as Developer Preview 1 (DP1). Details about what’s supported and what isn’t are available on the github page https://github.com/jvasileff/ceylon-dart. In short, quite a bit is supported, and what isn’t supported should, in theory, fail gracefully.

Installation is easy, with just:

ceylon plugin install com.vasileff.ceylon.dart.cli/1.2.0-DP1

which enables the following commands:

ceylon compile-dart
ceylon run-dart
ceylon assemble-dart

several important SDK modules are included: collection, html, json, math, promise, and time.

To install Dart on OS X, use 'brew install dart'. For Linux, see https://www.dartlang.org/downloads/ for a Debian or zip package. Sorry, no Windows support.

Give it a try, and let me know what you think!

John

Gavin King

unread,
Nov 23, 2015, 3:18:06 AM11/23/15
to ceylo...@googlegroups.com
Congratulations, John!

PS. FTR, here are the instructions for installing Dart using homebrew:

https://www.dartlang.org/downloads/mac.html

i.e.

brew tap dart-lang/dart
brew install dart
> --
> 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 http://groups.google.com/group/ceylon-dev.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-dev/2331A9AB-D535-4AA5-A2FD-4474403BDC5D%40vasileff.com.
> For more options, visit https://groups.google.com/d/optout.



--
Gavin King
ga...@ceylon-lang.org
http://profiles.google.com/gavin.king
http://ceylon-lang.org
http://hibernate.org
http://seamframework.org

Gavin King

unread,
Nov 23, 2015, 3:32:04 AM11/23/15
to ceylo...@googlegroups.com
Very cool!

OK, so, a word of warning to people installing this plugin: the
*first* time you use "ceylon compile-dart", the plugin downloads some
dependencies. If you have a very shitty connection, as I do, this can
take time, and you might be tempted to cancel the compilation,
thinking that something has gone wrong, as I did. Don't do this! I was
left with a corrupted copy of ceylon.ast in my repo and had to remove
it by hand. But after removing the corrupted file I was able to
recover using "ceylon install-dart --out ~/.ceylon/repo" as suggested
by the tool itself.


On Mon, Nov 23, 2015 at 7:58 AM, John Vasileff <jo...@vasileff.com> wrote:

Tom Bentley

unread,
Nov 23, 2015, 4:34:38 AM11/23/15
to ceylon-dev
I was
left with a corrupted copy of ceylon.ast in my repo and had to remove
it by hand.

That must be a bug in CMR, no?

Gavin King

unread,
Nov 23, 2015, 4:43:35 AM11/23/15
to ceylo...@googlegroups.com
I assume so, yes.

Sent from my iPhone

John Vasileff

unread,
Nov 23, 2015, 11:41:06 AM11/23/15
to ceylo...@googlegroups.com
Oh, thanks, I forgot about the ‘brew tap’ step!
> To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-dev/CAP7PoCcooQhoP5HvR8NYhK_fs%2BA5QbFs14WFWq3yJN%3D%3DL5210w%40mail.gmail.com.

Steven Sagaert

unread,
Dec 25, 2015, 1:45:37 PM12/25/15
to ceylon-dev
What's the point? What does this enable that's not possible with the JVM/JS backends?

John Vasileff

unread,
Dec 30, 2015, 1:38:30 PM12/30/15
to ceylo...@googlegroups.com

On Dec 25, 2015, at 12:15 PM, Steven Sagaert <steven....@gmail.com> wrote:

What's the point? What does this enable that's not possible with the JVM/JS backends?

Steven, that’s a fair question, and one that hasn’t previously been addressed. Your question is rather open ended, so I’ll share a variety of thoughts.

Tangential benefits include:
  • Improve the JVM & JS backends by discovering bugs as a side effect of creating tests for the Dart backend and exploring corner cases.
  • Further prove Ceylon’s cross-platform nature, and help keep Ceylon truly cross platform.
  • Stress test the Ceylon language by having a partially self-hosted backend. The Dart backend is the first Ceylon backend written in Ceylon. The Dart compiler still does, however, run on the JVM since the typechecker is written in Java. Note: this benefit is more one of perception; work on the Dart backend hasn’t really uncovered any weaknesses in the Ceylon language itself. The language is quite good, and the performance is excellent!
  • Help lay the groundwork for other backends to be written in Ceylon. Contributions have already been made to the LLVM backend project, and should a JVM or JS backend be written in Ceylon, the existence of the Dart backend will undoubtably help.
Potential uses include:
  • Write Android and iOS apps in Ceylon. Flutter (http://flutter.io) is an early stage project “to help developers build high-performance, high-fidelity, mobile apps for iOS and Android” on Dart. The potential exists to write Flutter based apps in Ceylon.
  • Write Server-side Dart VM apps in Ceylon. Personally, I’m a fan of the JVM for server side apps, but alternatives such as Node.js and Dart remain popular, and the idea of working within a newer ecosystem on a simplified VM is compelling.
  • Use Ceylon as a scripting language. The Dart VM has a faster startup time than the JVM, and therefore would be well suited for running scripts written in Ceylon.
  • Write browser-based apps in Ceylon. While compiling Ceylon->Dart->Javascript sounds pretty awful from an engineering standpoint, early results are encouraging, and there may be real benefits such as a) leveraging the Dart compiler’s “tree shaking” feature to significantly reduce executable code size, and b) having access to client side Dart APIs. Ceylon does of course already have a very good Javascript backend compiler, so this potential use is perhaps the most speculative.
And finally:
  • I find this project interesting, and I hope others do too!

The Dart backend started as an experiment (but has since become quite advanced). Goals and potential uses were not defined at the start, but those outlined above will be validated or refined once real progress is made on interop, that is, consuming Dart APIs from Ceylon. Given the success of Ceylon-Java interop and the similarities between Java and Dart, I’m optimistic in this area.

In the mean time, I encourage you to give the Dart backend a try! While it’s not ready to use for mobile, server side, or web apps, it does support a significant portion of the Ceylon language, and can be used for CLI apps, learning, and experimentation.

Finally, if you are interested in contributing, please do! The code base is mature enough that contributions are welcome. And, for anyone interested in helping validate potential uses, interop *is* possible today, just with manual effort to expose Dart APIs in terms of a Ceylon module, as demonstrated here: https://twitter.com/jvasileff/status/672562333068206081.

HTH, and Happy New Year!

John

Robert Åkerblom-Andersson

unread,
Dec 31, 2015, 11:44:01 AM12/31/15
to ceylon-dev
Great summary John, keep up the good work and have a happy new year!

Best Regards, Robert

Steven Sagaert

unread,
Jan 8, 2016, 5:38:14 AM1/8/16
to ceylon-dev
Are you going to expose Dart's isolates to Ceylon? That would be one killer feature of Dart that actually would set it apart from JVM/JS backends and something I'd be interested in as a concurrency model (a la Erlang).


On Wednesday, December 30, 2015 at 7:38:30 PM UTC+1, John Vasileff wrote:

John Vasileff

unread,
Jan 11, 2016, 10:25:29 PM1/11/16
to ceylo...@googlegroups.com

> On Jan 8, 2016, at 5:32 AM, Steven Sagaert <steven....@gmail.com> wrote:
>
> Are you going to expose Dart's isolates to Ceylon? That would be one killer feature of Dart that actually would set it apart from JVM/JS backends and something I'd be interested in as a concurrency model (a la Erlang).
>

Yes, absolutely, I think working with isolates will be an important part of interop.

John

Reply all
Reply to author
Forward
0 new messages