Sep. 3rd, 2014

jducoeur: (querki)
This week's main project is to add scala.js to the Querki build. scala.js is -- well, let's put it this way. Querki is made up entirely of leading-edge technology. Some of the libraries qualify as bleeding-edge -- open-source bits that are very new and novel, but still decently mature.

scala.js is *hemorrhaging*-edge technology -- a project being run out of EPFL, the university where Scala was largely born in the first place. It's still officially pre-release, and has no commercial entity behind it. (Although a lot of us are starting to agitate for Typesafe to pull it in as an official piece of the Typesafe Stack.) But man, it is the coolest and most useful thing on Earth.

scala.js is a Scala-to-Javascript compiler. Everyone is beginning to acknowledge that Javascript is kind of a pain in the ass for serious work: while it is much more powerful than anyone understood at the beginning, it has all sorts of nasty limitations that you have to work around -- all sorts of table-stakes features like classes and modules and such have to be added as libraries, and all of it is dynamically typed, so you have to catch your errors at runtime. OTOH, those runtimes are now *blisteringly* fast, thanks to Google forcing everyone else to up their game, so you can basically treat it as machine code, and scads of languages are being produced that compile down to Javascript.

A couple of years ago, some folks decided to see whether it would be possible to compile Scala -- one of the most un-Javascript-like languages around -- to Javascript. It's taken a lot of releases and some very clever work, but the answer turns out to be yes. By now, scala.js works with the vast majority of the Scala language, as well as the most important libraries. And it's hit a point of maturity where a bunch of folks have been producing libraries that are specifically designed to be useful in the browser environment. (Big h/t here to Li Haoyi, who in his spare time has been doing some really amazing work.)

Anyway, I've now got that up and running, at least in test form. But today's "wow" moment was the tweak I just put in place, to get Source Maps working. This is a tech that Google has been pushing: basically, if you think of Javascript as machine code, this is the debugging symbols. The end result is that I can not only *write* my UI in Scala, I can (in Chrome, at least) *debug* it in Scala. I've now got things wired up so that I can, right in the browser, view the Scala source code for my client, set breakpoints in that code, inspect variables and parameters, the whole nine yards.

Of course, now I get to rewrite all of my existing Javascript code in Scala, which will be a mild PITA -- expect some bugs to sneak in while I iron that all out. But in the long run, this should make Querki's UI both more powerful and easier to develop. Javascript has been the biggest pain point in my programming life for many years now (I actually learned Flash in order to give myself an alternative to it), so the notion of being able to write Querki in end-to-end Scala fills me with absolute glee...
jducoeur: (device)
Strictly for the Scala programmers in the audience, but I've noticed a lot of folks using it to one degree or another recently: the Typelevel group is prepping to fork the Scala language. Read the article for more details, but none of it is especially surprising -- as Scala has become a "realer" language, being used in a lot of major enterprises, Typesafe (the official maintainers of the language) have become more conservative about changes, especially in the name of back-compatibility. The folks at Typelevel, who are by and large doing most of the most advanced and ambitious stuff in Scala, have become frustrated by this, and want the language to be able to evolve more quickly.

They seem to be doing it right: while they're planning on moving faster, they're also planning on making the changes in a compiler-mergeable way. So the overall effect is that the new effort is probably going to become a community-driven fork whose better ideas will gradually feed back into the official trunk of the language. Typesafe have officially declared their support for the effort, which should greatly reduce the potential for stupid politics. Overall, it's likely to be a win for everybody.

So if you're seriously interested in Scala, keep an eye on this project. I expect it to be provocative, sometimes controversial, but really interesting...

ETA: Just to head off other people having the same confusion I had, there is also a *second* fork of the Scala Compiler (although not so much the Scala language), from Paul Philips.  I get the impression that Paul has been working on this for a while, and he decided to go public in response to the Typelevel announcement.  There, there *is* a fair amount of stupid politics going on.  Nothing new and surprising, though: the friction between Martin (the primary author of the language) and Paul (who wrote much of the compiler) has been brewing for a long time now, and is pretty well-known: by now, they have deep divisions over how things should proceed.  Paul has long been on the record that (a) the compiler has become an unmaintainable mess and (b) since there is no fully-detailed language spec, that's unhealthy for the language.

Not quite sure how that's going to play out; my hope is that the Typelevel folks find a way to bring Paul into the fold, calm him down a bit, and give him a way to feed his work back into the "mainstream" without being directly under Martin's thumb.  He is unquestionably one of the most important long-term contributors to the language, and I have a nasty suspicion that his version of the compiler is going to be significantly more stable than the official one.  But he is explicitly *not* making a goal of compiler compatibility -- whereas Typelevel is trying to improve the language, he is mainly concerned with replacing the compiler with one that can be enhanced and maintained with less pain...

Profile

jducoeur: (Default)
jducoeur

June 2025

S M T W T F S
12 34567
891011121314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags