Live data from Hacker News

Scala.js has a new website

scala-js.org

11–20 of 31 posts

Re: Scala.js has a new website

#12
post #10

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.

AFAIK 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.

Re: Scala.js has a new website

#13
post #9

For those from Java world wanting to write client-side, there is obviously also GWT[1] and another interesting option is TeaVM[2]. Interesting part of TeaVM is that it translates bytecode, so I guess it could do Scala as well. But I've never used it, so cannot recommend really. 1. http://www.gwtproject.org/ 2. https://github.com/konsoletyper/teavm

I already write client side with Swing and JavaFX....

Re: Scala.js has a new website

#14
post #10

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.

AFAIK 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.

Correct 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.

Re: Scala.js has a new website

#15
post #9

For those from Java world wanting to write client-side, there is obviously also GWT[1] and another interesting option is TeaVM[2]. Interesting part of TeaVM is that it translates bytecode, so I guess it could do Scala as well. But I've never used it, so cannot recommend really. 1. http://www.gwtproject.org/ 2. https://github.com/konsoletyper/teavm

GWT doesn't do Scala. That puts it out of the equation as far as most Scala.js developers are concerned. Also, it's interoperability story is seriously lacking behind Scala.js.

TeaVM is a fun and impressive project. However, although they can compile Scala-emitted bytecode (since a few weeks ago [1]), that's not their main focus. They are unlikely to ever optimize Scala code as well as Scala.js, because Scala.js focuses on optimizing idiomatic Scala. They do have an undeniable advantage over Scala.js, though, which is that they can also compile Java libraries used by a Scala program.

[1] https://groups.google.com/d/msg/scala-js/3jbX9ajIbHM/MbLWIqp...

Re: Scala.js has a new website

#16
Also haxe can compile in javascript and have a type System much similar to Scala. And also macros, conditional compilation and inline functions and constructors. And can compile also in java, c#, c++, lua, php, python, flash

Re: Scala.js has a new website

#17
post #10

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.

Honestly, 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-can...

Re: Scala.js has a new website

#18
post #9

For those from Java world wanting to write client-side, there is obviously also GWT[1] and another interesting option is TeaVM[2]. Interesting part of TeaVM is that it translates bytecode, so I guess it could do Scala as well. But I've never used it, so cannot recommend really. 1. http://www.gwtproject.org/ 2. https://github.com/konsoletyper/teavm

Scala's biggest concern is compilation time. However when comparing GWT and ScalaJS, mostly ScalaJS pulls ahead. So Java -> Js or Scala -> Js you would definitly prefer Scala.

Re: Scala.js has a new website

#19
post #10

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.

For a powerful language with very good support of compilation to JS - you can try ClojureScript.

Re: Scala.js has a new website

#20
Should I start learning scala or typescript? I'm developing nodejs + angularjs apps in my spare time and want to improve the code (native JavaScript 5 currently). Or should I start with babel and ES6?
Post reply on HN