These last years, the trend has been to export web technologies out of the browser, into the desktop (e.g., electron) and more and more into Mobile Applications (e.g., Ionic). Whether or not we like this trend, it is in any case a bargain for any technology that can produce HTML, CSS and JavaScript. One such technology is Scala, via its Scala-to-JavaScript compiler, Scala.js.

In this blog post, we will start from scratch and arrive at a convenient setup for building cross-platform mobile application, using Scala and Capacitor. However, if you prefer to TLDR, you can directly check the final result.

Step 1: The sbt project for Scala.js


A while ago, I watched a talk from Netflix from the Scala days 2019, and the speaker Jeremy Smith said that a Scala program is actually made of two programs. The one that everybody knows, but also the one which happens at “compile time”.

Justin Luebke on unspash

When we (at least I) think about compilation, we oftentimes only think of it as a “static” process of checking that things have been wired up properly (e.g., right arguments at the right places). However, some compilers actually compute things while “compiling”, and they are able to help you in tremendous ways. …


Those following my blog posts know that I like to take Scala everywhere. This time, let us write Angular services in Scala.

If you don’t know Angular, it’s a frontend web framework developed by Google in TypeScript, similar to React or Vue. It is a component based framework, and to each component is associated a TypeScript class aiming to control what the HTML component must do. These classes can use services. …


Not so long ago I was thinking “how is it not possible in 2020 to have a free (crappy) host for a JVM based server with a (potentially also crappy) database?”. And then I discovered Heroku.

Heroku gives you the opportunity to host for free a server with a small (no more that 10k lines) Postgres database. They moreover have built in support for a Scala Play application, in which case you can very easily push your application code, and Heroku compiles and deploy everything for you.

In my case, though, I wanted a little bit more: my frontend is…


Introduction

If you are a Python developer, perhaps you ever felt the need to step up your Django application, or your data pipeline, to the next level, towards a technology which allows to build larger, safer and more robust softwares.

It turns out that Scala is an excellent fit to these issues. In particular for Python developers who, I’m sure, value the clear and intuitive syntax, the scripting-like feeling while coding, and the support for object oriented programming. Good news, you also have all of that in Scala, and so much more…

One thing that could refrain someone is the “where…


Recently we stumbled on a problem that at first glance looks particularly simple: overload a method for a `List[String]` and a `List[Int]`. One could expect that simply writing

def foo(ls: List[String]): Unit = ???
def foo(ls: List[Int]): Unit = ???

would do the trick, the same way as we would do

def foo(s: String): Unit = ???
def foo(j: Int): Unit = ???

As much as the latter will work like a charm, the former will gratify you with the following compile-time error:

[error] both methods
[error] def foo(ls: List[Int]): Unit at line 11 and
[error] def foo(ls: List[String]): Unit at line…


It is stating the obvious to say that nowadays, Data Science (DS) is dominated by python (with R being a decent challenger). It is however arguably not the best for Data Engineering (1), where more robust languages such as Scala tend to shine more. As we shall see, though, Scala is also a prime choice for tinkering with data. It has all the tools you as a data scientist needs, and it has several advantages over python, that I list at the end.

In order to see that Scala is a good fit for DS, we have to accommodate all…


Google Spreadsheets (and softwares alike such as Excel) are a great way to visualise and organise (medium-sized) data. Google spreadsheets are also easily connectible to a whole lot of Google services such as Google analytics. Hence, they are the perfect entry point for your data. They even offer powerful tools for manipulating the data via a fully featured API.

However, the problem is that with this power comes a great responsibility to keep the code inside the cells readable and easy to maintain. Sadly, this task quickly becomes impossible to accomplish, and you soon break any of the “clean code…


If you’re not a mathematician, you’ve probably never heard of Category Theory. Even if you are one, it is such a niche field of mathematics that you may not have studied it. Category Theory tries to unify all algebraic structures to better understand their differences. On the other hand, if you’re not a developper, you’ve probably never heard of type variance. Well, even if you are, type variance is rather an advanced topic that you may also not have run into it.

Surprisingly enough, Category theory has many “applications” (if we can say that) in programming paradigms. One of these…


Scala is hard. Scala has a steep learning curve. That’s the kind of things that you can read, or that you may think. I strongly disagree. Granted, there are things that are complicated in Scala. But for the overwhelming majority of tasks that a developer has to do in its day-to-day job, it is as easy as, if not easier than, for other languages.

In order to show you a token of the fact that Scala is easy, we present below possible implementations of five common tasks that you find yourself doing a lot as a developer. As Scala can…

Antoine Doeraene

Mathematician, Scala enthusiast, father of two.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store