Curious project I wonder how it compares in actual portability to a project like Kotlin? Been enjoying that language and the possibility of the apps core functionality being cross platform.
I developed one into a a mobile game. It pretty much just worked across iOS, Android, Native Linux, Native Windows and flash. It really does compile as the same project and Build for $platform. With the exception of iOs which needs to do shenanegans with xcode. Flash version as a free to play here http://fingswotidun.com/Potato/
Looks like it's using Flash, and like most sites the "ask" mechanism doesn't work - it'll only show the SWF if you tell Chrome to allow it and then reload the page.
Haxe has been around many years before Kotlin. People have done flash games in Haxe that also compile to other platforms including HTML and mobile platforms. It also compiles to many other languages. It's definitely work investigating and seeing the output.
Kotlin compiles to JavaScript, Java bytecode or native code (via LLVM, currently only a "technology preview").
There is a small standard library but it relies on the platform libraries for most things. For collections, Kotlin/JVM uses the Java collections with some extension functions, but on Kotlin/JS and Kotlin/Native the Kotlin standard library itself provides the same Java-like collections API.
For other things, Kotlin/JS provides a tool for converting TypeScript bindings to Kotlin as well as a special "dynamic" type (kind of like .NET) to call JS APIs without bindings. Kotlin/Native has a bindings tool to generate Kotlin wrappers for C libraries.
The size of the standard library for Kotlin/JS is roughly similar to AngularJS – 1.4 MB unminified or 100 kB minified and gzipped. But there is a tool (since 1.1) to eliminate the unused parts and reduce the size – e.g. for one simple tiny program I have here, library + program is 28 kB minified and gzipped.
Okay, based on what you're saying, Haxe would be a lot more portable then. The unified standard library is key. It seems like Kotlin compilation target is more a choice you make initially, not a portability feature.
Depends on whether you need whatever is in Haxe's standard library, I guess?
I have a Kotlin program running on Windows, Linux with X11, Java with Swing, as well as in the browser, i.e. targeting native, JS and Java. That seems pretty portable to me. You just need to provide an implementation of whatever API you need on each platform you target.
Well, your portability for Windows and Linux is just from the JVM no? What does Kotlin add that java didn't?
And your Kotlin to JS, when you say target API? I mean, how similar is it to your JVM one? If you had to rewrite everything you were using Swing for, that's a lot of rewrite.
I think with Haxe, though not sure, but it's my impression with Haxe it would be almost 100% same code. Because whatever UI framework you'd used in Haxe is in the standard library, and would therefore be availaible on all its target platforms.
Hum, actually I take that back, it seems HaxeUI supports most platforms but not HTML5. Though HaxeUI2 seems to be in development adding support for it.
Ok, I see what you mean then. I don't know if I'd call that truly portable, but if they add native WxWidget and say QT to Kotlin native, it would slowly tend towards what Haxe has going.
I don't really think of that as portable personally. So many languages offer it today, Java with GWT, Clojure/ClojureScript, Kotlin, OCaml/BuckleScript, PureScript, Ruby/Opal, Python/PyJamas, Erlang/Shen, Scala, etc.
You save a bit of time not having to learn another language, and can reuse all pure code, mostly. But I'd really like to see a language develop which supports multiple platforms from the get go by having a unified standard library that was very complete, including UI.
> Well, your portability for Windows and Linux is just from the JVM no?
No, there is a native binary executable for Windows and a corresponding one for Linux. There is no Java embedded in or required by those, although separately (!) I also target Java, in addition to Windows and Linux. (I knew I should have used more parentheses in that post.)
> If you had to rewrite everything you were using Swing for, that's a lot of rewrite.
Yeah, but there is no Swing on the web, so what can you do? We used to have Swing, in the form of applets, and it was horrible. If you want something to work well on the web, you have to write it for the web. (But you can write it in Kotlin!)
Again, there is no Java when you target JS. Instead you can use any JS API and any JS library. The Kotlin standard library provides some basic data structures, math functions, etc. No Java.
> if they add native WxWidget and say QT to Kotlin native, it would slowly tend towards what Haxe has going.
wxWidgets and Qt happen to be in C++, which is difficult to use from other languages, but you can use any C-based library from Kotlin/Native, such as GTK+ or the native Win32 API.