News for hackers. Stuff that matters.
Re:Why I'm joining the Dart Team by Yuioup on Saturday January 09, 2016 @06:37AM (#10870901)
I've made this comment before. I'm wondering if there are plans to replace Java with Dart or Go on the Android platform. This because of the continuing threat of lawsuits from Oracle.

It's probably impossible to replace Dalvik because you need the bytcode but maybe replacing the language might shield Google from Oracle.

Re:Why I'm joining the Dart Team by on_and_off on Saturday January 09, 2016 @07:35AM (#10871026)
The Dart & Go teams have projects to target Android but AFAIK these are independent projects with no relation with the Android team.

Dalvik -> it is already replaced by ART, but it is still a VM (for ART the bytecode is compiled AOT though).

AFAIK, there is no public plan to replace java, neither are there any public commit on AOSP indicating a move in that direction.

Many Android devs are following Kotlin very closely (it is a boon for Android app development) but again there is no known plan from the Android frameworks team to switch to it.

Re:Why I'm joining the Dart Team by V-2 on Saturday January 09, 2016 @08:27AM (#10871161)
Which is a pity. With Google's backing (and they already collaborate with JetBrains, as Android Studio is forked IntelliJ Idea) Kotlin could really grow.
Re:Why I'm joining the Dart Team by on_and_off on Saturday January 09, 2016 @10:55AM (#10871641)
it is :( .

I hope that Google will reconsider. Being stuck with Java 6.5 is more and more of an issue. You can use ThreeTenABP, Retrolambda and some other libs to get past some of the languages limitations but that's far from ideal.

Even if Google switches to OpenJdk 8 (or even 9 or 10), if the adoption times stay consistent, we will have to wait 3 years before being able to use their new features in mature apps.

I do hope that either the android team is working on a new language (along with a framework revamp) or will reconsider its position on Kotlin and starts adopting it.

Re:Why I'm joining the Dart Team by izacus on Saturday January 09, 2016 @11:27AM (#10871769)
Why do you expect any other language would have a lower adoption time? Kotlin has to pay the same performance penalties RetroLambda and others do until the device runtime itself is updated.
Re:Why I'm joining the Dart Team by on_and_off on Saturday January 09, 2016 @11:45AM (#10871849)
because kotlin can target devices already in the wild (albeit with a perf cost indeed) whereas languages features added by a new jdk will only be useable with terminals sporting a new version of Android.

Just like right now most of us can't use try with resources.

Re:Why I'm joining the Dart Team by pornel on Saturday January 09, 2016 @07:39AM (#10871041)
It would be fantastic if Swift was adopted as the language for Android.

It's a very well-designed language (with non-nullable types and immutability!). It's now open-source, and development model is even more open than Android's throw-over-the-wall.

Swift's type inference and ARC makes it feel very script-like, but it supports AOT compilation and tighter control over memory usage.

While Cocoa won't be available on Android, having a single language that's usable on iOS, Android and server-side would be great for reusing as much as possible.

Re:Why I'm joining the Dart Team by V-2 on Saturday January 09, 2016 @08:24AM (#10871157)
Android already has Kotlin. It's kind of similar to Swift. You're quoting non-nullable types, immutability, open-source, well it has it all.
Re:Why I'm joining the Dart Team by mwcampbell on Saturday January 09, 2016 @11:51AM (#10871868)
Having two similar languages on different platforms isn't as useful as having the same language on both platforms, though.

So, you can have Kotlin on iOS via RoboVM. But that's kind of expensive. Also, RoboVM brings its own heavy runtime environment with its own class hierarchy, garbage collector, and the need to bridge between that world and the ObjC runtime.

Or you can have RemObjects's almost-Swift (http://www.elementscompiler.com/elements/silver/) on Apple platforms, Android/JVM, and .NET as well. I call Silver almost-Swift because some permanent differences from real Swift are documented here: http://docs.elementscompiler.com/Silver/DifferencesAndLimita... For that reason, though I like the Elements compiler's approach of targeting each platform in the most native possible way, I'd recommend using their C# front-end or even their Oxygene language (a Pascal derivative) instead.

Re:Why I'm joining the Dart Team by cwyers on Saturday January 09, 2016 @02:38PM (#10872517)
> Having two similar languages on different platforms isn't as useful as having the same language on both platforms, though.

Sure, but as we've seen from the WebKit/Blink fork, Google and Apple aren't capable of sharing stewardship of something that central to both of their platforms in the long run. So it's not going to happen.

iOS and Android both disappoint me as being one-language-dominates platforms; I much prefer the paradigm of Windows, Linux or OS X, where you can have apps in Python, apps in C, apps in VB or Lisp or FORTRAN or Brainfuck, all running as first-class citizens. It feels like a real step back for me.

Re:Why I'm joining the Dart Team by leppr on Sunday January 10, 2016 @10:20AM (#10875563)
It's a step back just as the walled garden ecosystem is in general, but it did make it easier to find documentation and hire developers, and thus grow the platform.
Re:Why I'm joining the Dart Team by voider1 on Saturday January 09, 2016 @08:34AM (#10871182)
How well does Kotlin perform on Android? Can you use all the native stuff? Are there some successful apps written in Kotlin?
Re:Why I'm joining the Dart Team by on_and_off on Saturday January 09, 2016 @10:42AM (#10871577)
>How well does Kotlin perform on Android? Can you use all the native stuff?

Not only is Kotlin a great language, it is also a good fit for Android since it outputs bytecode and is entirely interoperable with java. The only cost of using Kotlin are the 6k methods that it adds to the apk. You can call all the native Android APIs. Of course they are not idiomatic kotlin code, but you can cope with that, especially since the Kotlin team has written some Extensions methods in order to facilitate this process.

>Are there some successful apps written in Kotlin?

I know that Expedia uses some Kotlin for its new features (since there is full interop, you can switch gradually). I am working alongside 12 or so other engineers on a successful Android app. Most of us (especially the more experimented) would like to switch to Kotlin but we get a lot of resistance from an extremely change averse team leader (we have just convinced him to start using EventBus and are still pushing for Dagger 2 & Rx).

This kind of move is always complex for a large team though. You need to get everyone on board and up to speed with this new language. Even though I think that kotlin is very easy to learn (especially for a java dev), this is still a significant effort.

Re:Why I'm joining the Dart Team by V-2 on Saturday January 09, 2016 @01:08PM (#10872182)
Personally I think a good way to set a foot in the door (with Kotlin) is to use it for unit tests. Hey, unit tests aren't production code, so what's the worst that can happen, right? Plus in many projects - sadly - tests are still perceived as an optional thing.

And Kotlin is very well suited for tests, because it's so expressive, DSL-friendly etc. There's also this pleasant framework: http://jetbrains.github.io/spek/

If you can't convince your team (or bosses) to switch to Kotlin, start writing unit tests in Kotlin. They can even coexist with Java ones, so I believe this is an easy way in. And once people get to see it at work...

Re:Why I'm joining the Dart Team by on_and_off on Sunday January 10, 2016 @04:50AM (#10874827)
thanks, that's an interesting idea.

we already have started making more and more tests several months ago (the code base we inherited is awfully architectured and entirely untested), I will try to win over our test engineer with that idea.

Re:Why I'm joining the Dart Team by DrBazza on Saturday January 09, 2016 @08:50AM (#10871226)
From the jetbrains site:

http://blog.jetbrains.com/kotlin/2015/11/the-kotlin-language...

JetBrains has been using Kotlin in production of IntelliJ IDEA, YouTrack and other products for quite a long time now. We have more than 250’000 LOC of Kotlin in production at the moment (plus about as much in the Kotlin project itself). While some of our projects are entirely written in Kotlin (account.jetbrains.com), others have introduced it to existing Java codebases, as we planned initially. We reached the level of interoperability where freely putting Kotlin alongside Java is transparent for Java clients: Java can be called from Kotlin and vice versa, sources can be mixed in one project, resulting .class files are totally compatible with Java tooling.

Re:Why I'm joining the Dart Team by incepted on Saturday January 09, 2016 @10:35AM (#10871545)
> How well does Kotlin perform on Android?

Pretty much as well as Java. No other alternative language comes close on Android.

In my opinion, the only two credible future languages of Android are either Kotlin or Java 8.

Re:Why I'm joining the Dart Team by V-2 on Saturday January 09, 2016 @01:12PM (#10872195)
Some folks use Groovy (I've attended a talk about it on one of the DroidCons), although the tooling is a bit lacking, and there are some other drawbacks such as long build times.
Re:Why I'm joining the Dart Team by vorg on Saturday January 09, 2016 @07:00PM (#10873439)
Groovy for Android isn't being maintained. The programmer maintaining it was retrenched by Pivotal 12 months ago. Groovy's used quite a lot for scripting, but the more recent statically-typed additions for Java and Android aren't being used much and have QA issues.
Re:Why I'm joining the Dart Team by V-2 on Saturday January 09, 2016 @08:40AM (#10871199)
Yeah you've got full interop with Java. There is some overhead in terms of executable size, but not significant. As for commercial apps written in Kotlin, I have no way of knowing, but there's a lot of open-source projects. It wasn't long ago that Kotlin reached 1.0, and prior to that I would myself err on the safe side not recommending it for production yet. It's been improving very fast though.
Re:Why I'm joining the Dart Team by incepted on Saturday January 09, 2016 @10:35AM (#10871549)
> It wasn't long ago that Kotlin reached 1.0

It's not quite 1.0 yet, but getting close.

Re:Why I'm joining the Dart Team by V-2 on Saturday January 09, 2016 @01:08PM (#10872184)
I stand corrected. I thought they did it already. They planned it for autumn.
Re:Why I'm joining the Dart Team by on_and_off on Saturday January 09, 2016 @10:58AM (#10871658)
I doubt that Google would adopt a language owned by a main competitor, they had enough troubles already with Java. And as already mentioned, Kotlin feels a lot like swift and is interop with Java.
Re:Why I'm joining the Dart Team by 762236 on Saturday January 09, 2016 @12:24PM (#10872010)
Garbage collection is absurd to run on a battery-powered device (both Go and Dart are garbage collected, like Java). I think that Swift would be a great choice, and would allow some sharing of code between the platforms.
Re:Why I'm joining the Dart Team by danieldk on Saturday January 09, 2016 @07:03AM (#10870965)
They'd still need to ship the class library (with 'infringing' API copyrights) for many years for backwards compatibility. Their current strategy of replacing Apache Harmony classes with OpenJDK seems like a good shot to get rid of Oracle's claims for future versions.

My guess is that they'll wait and see how that move pans out first.

Re:Why I'm joining the Dart Team by pron on Saturday January 09, 2016 @09:22AM (#10871318)
Now that Google has decided to comply with the OpenJDK license (as they should have done years ago, IMO), this should not be a problem. They will now be using a license officially granted to them (and anyone else) by Oracle, a completely free license, with no restrictions (Oracle are prohibited to place further restrictions by their own license).
Re:Why I'm joining the Dart Team by _pmf_ on Saturday January 09, 2016 @07:22AM (#10870998)
> I'm wondering if there are plans to replace Java with Dart or Go on the Android platform.

There are very few languages choices where I prefer to keep using Java. Go and Dart are two of these.

I'm a dedicated Apple skeptic, but Swift is nicer than both of these trainwrecks.

If what the article claims is true (that Dart can be used to target µCs), which I highly doubt, it might become interesting for me. My doubts arise from the fact that the standard library for a language makes some opinionated design choices, and in my opinion it's impossible to make an idiomatic library that works the same (and is usable!) in a GC context (existing deployment) and a non-GC context (embedded).

It's sad that of the dynamic languages, Python and Ruby are performance deadends, and LuaJIT is too obscure for most people.

Re:Why I'm joining the Dart Team by kelseydh on Saturday January 09, 2016 @09:40AM (#10871368)
Elixir (and the Phoenix web framework) is getting a lot of attention these days from Rubyists who are looking for something that speaks their language that is also fast in realtime distributed environments.
Re:Why I'm joining the Dart Team by rdtsc on Saturday January 09, 2016 @12:59PM (#10872144)
+1 for Elixir and Erlang VM.
Re:Why I'm joining the Dart Team by coldtea on Saturday January 09, 2016 @11:30AM (#10871784)
>My doubts arise from the fact that the standard library for a language makes some opinionated design choices, and in my opinion it's impossible to make an idiomatic library that works the same (and is usable!) in a GC context (existing deployment) and a non-GC context (embedded).

What microcontrollers you have in mind? He mentioned Arduino in the post. It's not like we need Dart for extremely low spec-ed mCs, and we could run GC just fine in higher level mCs for ages...

Re:Why I'm joining the Dart Team by xxgreg on Saturday January 09, 2016 @07:08PM (#10873480)
> What microcontrollers

STM32F7

* high-performance MCU with ARM Cortex-M7 core

* 32-bit ARM CPU @ 216 MHz

* 320 KB of RAM

* 512-1024 KB of Flash

* Single precision FPU and no fancy MMU

https://github.com/dart-lang/fletch

https://www.youtube.com/watch?v=Hx2iGEAvZRk

http://gotocon.com/dl/goto-cph-2015/slides/KasperLund_Intern...

Edit: Sounds like they plan to support the Arduino Due, but this is not implemented yet. They do not intend to support 8bit or 16bit MCUs.

Re:Why I'm joining the Dart Team by _pmf_ on Saturday January 09, 2016 @12:47PM (#10872089)
> What microcontrollers you have in mind? He mentioned Arduino in the post. It's not like we need Dart for extremely low spec-ed mCs

The article mentions the Arduino, which in its original incarnation is an extremely tiny AVR. Maybe the author has a more powerful Arduino variant in mind, but I'm pretty sure you cannot run a GC runtime on the AVR Arduino. The only language that runs on such tiny devices is probably eLua.

> , and we could run GC just fine in higher level mCs for ages...

Yes, RPi/BBB won't have a problem.

Re:Why I'm joining the Dart Team by pjmlp on Saturday January 09, 2016 @08:03AM (#10871101)
The Android team has publicly stated that only Java matters on Android and the NDK is only a means for games and code from other platforms.

Anything else isn't related to Android's roadmap, at least from their public statements.

Re:Why I'm joining the Dart Team by _pmf_ on Saturday January 09, 2016 @08:40AM (#10871196)
> The Android team has publicly stated that only Java matters on Android and the NDK is only a means for games and code from other platforms.

The NDK isn't going anywhere, of course, and the recent switch from a GCC based toolchain to a LLVM based toolchain is an indicator that a lot of things are going on in native land.

Re:Why I'm joining the Dart Team by pjmlp on Saturday January 09, 2016 @04:40PM (#10872993)
I don't mean it is going away. What I mean is this attitude:

"The NDK is not appropriate for most novice Android programmers, and has little value for many types of Android apps."

"Squeeze extra performance out of a device for computationally intensive applications like games or physics simulations."

"Reuse your own or other developers' C or C++ libraries."

Versus the Windows Phone and iOS that allow full use of the OS APIs via their Objective-C++ and C++/CX, instead of a thin set of libraries + JNI boilerplate.

Then we have the way the whole Eclipse CDT -> Android Studio process has been handled and Gradle still cannot handle the majority of ndk builds.