3 ms·
Speaking of bringing nice languages to the browser. Kotlin is a simpler language than Scala and also compiles to JS. Unlike Scala.JS which seems to be a complet
by raquo 11y ago
Speaking of bringing nice languages to the browser. Kotlin is a simpler language than Scala and also compiles to JS. Unlike Scala.JS which seems to be a completely third party project, Kotlin's compilation to JS is considered one of the primary features of the language.
Kotlin is barely at 1.0 at the moment though.
- stewbrew 11y agoAFAIK javascript support is put on hold until 1.0 is reached. Kotlin/JS doesn't provide much help to make Kotlin/Java code run without modifications. So, it isn't there yet. ScalaJS on the other hand is fully functional.
- raquo 11y agoCorrect me if I'm wrong, but I think the relationship of Java and JS in ScalaJS and Kotlin is about the same: If your Scala/Kotlin code depends on any Java classes, you won't be able to compile it to JS. You can only compile pure Scala/Kotlin code to JS (and that comes with a few caveats in both cases). It's true that Kotlin's JS support is pretty raw today. There are virtually no docs for it for example. They do have a basic feature set working though. I think in a few months it should be in great shape.
- stewbrew 11y agoScala has a bigger runtime, which is supported by ScalaJS. ScalaJS also has implementations for some Java classes. There are also some Scala libraries with explicit support for ScalaJS around. Kotlin relies more heavily on the underlying runtime. Unless they re-implement a large part of the Java standard library in JS, they'll never achieve that level of compatibility.
- sjrd 11y agoHonestly, I am very doubtful about Kotlin's JS support to be a "primary feature". They have certainly advertised it as such since day 1, but the facts are that they have not treated JS as such in practice. Here are some of those facts: * They intend to release 1.0 without finalizing JS support [1] * The documentation for Kotlin on JS is virtually non existent * The primitive data types don't behave the same on both platforms [1] http://blog.jetbrains.com/kotlin/2015/10/kotlin-1-0-beta-candidate-is-out/#comment-40153 http://blog.jetbrains.com/kotlin/2015/10/kotlin-1-0-beta-can...
- mateuszf 11y agoFor a powerful language with very good support of compilation to JS - you can try ClojureScript.
- lmm 11y agoIt's not really a simpler language than Scala - it's less powerful and as a result many of its libraries are simpler (probably - there's no real Kotlin library ecosystem yet, for all we know they may end up combining the worst aspects of Spring and ScalaZ), but the language itself is a mess. Scala.js uses much of the scala compiler infrastructure and is worked on by many of the same people; while typesafe doesn't support it commercially it's hardly "completely third party".