I understand why these types of compilers lack reflection support, but it still bothers me (and general makes me want to avoid them). JavaScript is naturally a very dynamic environment, and both Java and Scala have some pretty strong dynamic capabilities of their own. But somehow when they are combined (GWT or Scala.js) you end up with something that is more static than Java or JavaScript. I know the reasons have to…
I don't understand why compilers can't simply emit global variables containing structural descriptions of types. It seems like such a trivial thing to do. It would increase the size of the binary, but it would be possible to disable in projects that aren't using reflection, even automatically if the code never imports the reflection package. Maybe someone can explain this.
Scala.js no longer experimental
81–90 of 135 posts
Re: Scala.js no longer experimental
#82Earlier quoted context omitted.
So here's my question, how come no browser has a way for a java applet to manipulate the DOM? We've got GWT compiling java to JS, we've got this compiling scala to JS.. and the JVM was originally built to run inside of a browser. Why can't we just close the circle? I guess people don't want their website visitors to see a "you must upgrade java" popup first thing?
Wasn't the JVM originally built to run inside of a toaster?
Likely it was designed, and then used for their first product. Then when that failed, they kept the language for other possible targets.
http://www.oracle.com/technetwork/java/javase/overview/javah...
Re: Scala.js no longer experimental
#83Re: Scala.js no longer experimental
#84Earlier quoted context omitted.
Let me contradict the other answers with my personal experience: the two IDEs for Scala I know, Scala-IDE (Eclipse based) and IntelliJ are relatively bad. - They are very slow. - They have poor refactoring support (Scala-IDE's support is still marked as experimental; all but the simplest refactoring will often randomly break code, either by not doing a full refactor, or by introducing gibberish). - Until the latest v…
I program in Scala at work full time using Intellij and I'm having a great experience. No weird compilation errors, quick, responsive. Works almost as well as with Java files.
Out of curiosity:
- Do you have incremental compilation enabled with IntelliJ?
- Do you ever experience a compile error in the IDE for code that SBT is able to compile successfully?
Re: Scala.js no longer experimental
#85I was very sceptical of Scala.js, but decided to use it in a low risk project ( http://github.com/underscoreio/doodle ) to render to the HTML canvas and I am shocked at how well it works. The community is moving very quickly as well, and many advanced Scala projects have had the necessary tweaks applied to run in Scala.js. Looking at broader trends, there is a clear movement towards static typing on the Javascript VM…
Google is developing SoundScript Aren't they doing Dart as well? That has optional typing. Plus they have GWT, which is Java to JS. Don't get me wrong, I'm super grateful to receive their fruits of labor for free, but this looks like a case of the left hand not knowing what the right hand is doing.
Re: Scala.js no longer experimental
#86Earlier quoted context omitted.
I program in Scala at work full time using Intellij and I'm having a great experience. No weird compilation errors, quick, responsive. Works almost as well as with Java files.
Awesome. My own experience is more with Scala IDE, which is terrible. I tried IntelliJ for a brief time last year, saw it had spurious compilation errors, and the gurus at my office told me it was even worse than Scala IDE (but you know how gurus are...). Out of curiosity: - Do you have incremental compilation enabled with IntelliJ? - Do you ever experience a compile error in the IDE for code that SBT is able to comp…
Re: Scala.js no longer experimental
#87Looks like I'm gonna have to ditch React and IO now. I think those are getting outdated. Will be rewriting all apps in Scala.js.
[0] http://www.oracle.com/technetwork/articles/java/jf14-nashorn...
Re: Scala.js no longer experimental
#88Earlier quoted context omitted.
You don't run code in multiple threads, but Scala's ExecutionContext is not about threads, but about asynchronous execution and JS is fine with that. Also, all of Scala's collections, including the persistent ones are supported.
This (asynchronous execution) means we are forced to use cooperative multitasking, which is probably not good for reduced latency, and therefore bad for responsiveness (compare to the Windows 3.11 days where we were forced to use cooperative multitasking). Yes, I know most JS programs today use asynchronous execution successfully in practice, but to use it as the basis of a language platform is not a good idea IMHO.…
Re: Scala.js no longer experimental
#89Earlier quoted context omitted.
If you care about the learning curve: Take a look at https://github.com/sinelaw/inferno It aims to add a type system to a subset of Javascript. It's not quite ready yet, but it already shows quite some promise. There's also Flow and Google's Closure/et-al, but they are more lenient and accept more valid and invalid programs.
If I just want types+js, Typescript is already pretty mature and widely supported (e.g. good integration with node, support for lots of popular libraries via DefinitelyTyped). What does this inferno offer over that?
Re: Scala.js no longer experimental
#90Earlier quoted context omitted.
You can actually have multithreading by running Scala actors in web workers: https://github.com/sjrd/scala-js-actors
But you still can't use structurally shared data, which you need when you want to share large data-structures between threads.