Why serverless is multilingual?
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
- 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 ;)).