Why serverless is multilingual?

Oh, just type this question: “why are there so many programming languages?” in Google. The question is still coming back on sites like stackoverflow.com, on Medium.com etc (of course with explanation). The list of programming languages is huge. On the other hand there are areas where there is “one-and-only” dialect, as in case of javascript on her majesty’s browser service. Or Python when we think of data science or modern machine learning. Yes, there is webassembly, and yes, there are R and more low level languages for ML but… let me use some kind of generalization to draw your attention.

What I want to tell is that among myriads of accessible programming languages there are specializations, that prefer one language over the rest. Mentioned before browsers(JS), ML & DataScience (Python/R supremacy), Education (Scratch) to name a few. Is it good to have one language per specialization? In fact, that was the idea behind creating new programming languages — specific language for specific use. Right Matt, Chris?

Why FaaS is not preferring “the one”?

A couple of years ago, a new specialization/area has been introduced: Serverless (or Function as a Service):

A new way to deploy and scale your software You don’t need to worry about administrators

This is what serverless promised and still promises today. But this also means that you cannot install your favorite interpreter/compiler on remote machines you pay for, simply because you don’t have access to these machines. You can upload your code only in the language preferred by the FaaS provider. Languages have been chosen for you. Each service provider can choose what languages you should know to deploy your idea. But why do they give a variety of languages to choose from, instead of a “one for FaaS” approach? Browsers locked it a long time ago and are happy (I suppose).

Ok, so let’s consider what’s good in this multilingual approach:

  • having many languages supported by the platform allows you to pick the one that is already in use in your organization ($)
  • sad but true: you can choose the one that is the cheapest. Yes, we mean hiring cheaper developers ($)
  • if you have an existing code base, you can easily (in theory) move it to the FaaS in cloud. This is great for migrating projects (speed)
  • you can pick the right language for the right job(!); FaaS is just a tool to solve problems from different areas. It’s not an area of expertise itself (btw. browsers aren’t too).

Monolingual approach pros:

  • you don’t have to think which language to pick when new project starts
  • all your developers talk the same language (this is one of the ideas behind node.js- a backend written in javascript, theoretically that means frontend developer understands backend and vice versa)
  • FaaS platform providers do not have to provide support for all possible languages and can focus on performance instead of supporting many languages and issues with them
  • no discussion “is it better to interpret or compile” which is also a big challenge for FaaS platform providers (waiting for Golang function to compile in Google Functions is a nightmare).

Personally I’d prefer to learn a new language only if I can reap benefits faster from the advantages of the FaaS platform. Most of them (languages) look the same, differ in details. It took me a month to learn Go before I could write something useful and another months to feel confident in what I do. What is also important, in case of issues that developers must handle, limiting the platform to one language makes them sure, that having any problems it would be easier to get help from other engineers narrowing the spectrum of possible failure. Using one language eliminates stackoverflow discussions that start with “using X works for me, learn it”. The variety of languages supported by FaaS platforms is huge. But when you look closer there is a common set of 3–5 languages: JS, Go, Python, Java and Ruby. So even having so many languages to choose from, the best choice is to focus on those 3–5. You never know which platform will be the chosen one (by your tech lead or accounting specialist ;)).

Author:

Marcin Bobowicz

Marcin Bobowicz

Product Owner