Scala.js – Does anyone use it production or plan to use it production ?
Scala is an large investment in time for most programmers, but once you get the hang of it you become very productive. So when facing the task of writing for the frontend, I would like to utilize my investment by using scala.js
Have anyone here had any experience in using Scala.js for any production system or planing to use it in production ?
24 comments
[ 4.3 ms ] story [ 58.9 ms ] threadI have written a Chrome extension[1] using it which has a thousand or so users.
I use it to make in house visualizations / web based user interfaces for commodities trading. In this use case being able to have statically checked rpcs (via autowire + some modifications) and share domain objects / business logic between client and server really helps keep things DRY & statically checked.
Currently, as a hobby project, I am using it to work on a video game built on top of phaser.js.
As a long time Scala programmer I would strongly recommend it. It's amazing being able to re-use all your domain objects between server and client, and get great performance on both sides.
1: https://github.com/benjaminjackman/looty
I have used it in closed-source production and its awesome!
By now, I'm at the point where adding a whole new API and making use of it in the client can be done in minutes -- having Scala end-to-end is a huge win. And having static type checking for the client code means that there are far fewer bugs, so coding the client itself is much quicker and less frustrating. Really, it's the first time in 20+ years that I've enjoyed web programming.
That's just a tiny startup (https://www.querki.net/help/#What-is-Querki -- note that everything you see there is Scala.js), but I don't think it would have been possible without SJS...
I'm currently using Angular, React and Moment.js on the scala side, so I can confirm JS library interop is possible.
That said, if you're familiar enough with both platforms to handle an app that has both, moving the interop from your head to the scala.js code isn't that big of a leap.
The reason for using it was that as I rarely have time to spend on the code, and often months apart (when the next term comes around), I wanted something where the compiler will catch more of my mistakes.
(Generally, I've been using scalajs-react on the client side)
We are working on a system that monitors, analyzes and reacts to telemetry sent by industrial machines. Part of this project are very JS/Ajax rich interfaces (plural) that show graphs, telemetry updates and alerts in real-time, interfaces that have to be kept up and running in the same browser window for days without refresh. The problems we've experienced is that the client-side is not front-end work, where the people involved need to have UX skills and stuff like that. Oh no, this is about building a reliable UI that doesn't leak, that doesn't choke on too many updates sent by the server and that can recover after networking issues.
Scala.js is great because we can use Scala-related tooling, which are much, much saner than what you get in Javascript's ecosystem (e.g. IntelliJ IDEA, SBT, dependencies managed in Maven repositories, Google Closure tree-shaking your code by default, etc.), a statically typed programming language that can help prevent accidental errors, which is very important for us because the complexity of the business logic involved is very problematic, plus a very rich standard library. For example we don't have to wait for async/await because we already have it. The libraries you can work with are pretty cool as well. Facebook's React is a popular choice for usage in combination with an FP style and interoperability is great. Plus the ecosystem of Scala.js-specific libraries is very active. As a shameless plug, we've built our own library for dealing with reactive streams, cross-compiled to Scala and Scala.js: https://github.com/monifu/monifu
Here are the slides from my recent presentation at "Scala by the Bay" conference narrating our experience so far (video for the same will be released by the conference organizers soon): http://www.slideshare.net/ramnivas2/full-stack-scala
Please be noted that we won't use scala-react because Scala.js can communicate with React by postMessage.
disclosure: I work for chatwork as chief front-end engineer.