Cover image created by me using the Community TypeScript Logo, the Go logo, the .NET logo, and Ferris the Crab.
I'm a big fan of serverless functions, but my perspective is usually limited to what will run on AWS Lambda. So I took a tally of the supported languages on the serverless platforms that I've heard of.
Caveats
- I didn't go searching for new serverless providers, these are the ones I already knew about.
- These are only the languages prominently listed with tutorials or examples on the provider's website. You'll notice, for example, that Rust on AWS Lambda is not included here even though I've written several blog posts about it!
- This is not an endorsement or review of any languages or providers, merely a count of official support. If you have specific questions you want answered (or a slightly different list ranking related things) let me know.
- Some of these entries have their own specific caveats, they are indicated with a number at the end of the entry. Details on that number are at the bottom of the post.
- I have not used all of these language/provider combos, I'm assuming if they are displayed prominently on the site then they are possible to use effectively.
Big Takeaways
- The best supported language is JavaScript, followed closely by TypeScript. No shock there.
- Python and Go are tied for third place in availability.
- Cloudflare Workers are by far the most flexible in way of supported / documented languages with 12—though many of those rely on cross-compiling the language to JavaScript.
- AWS, Azure, and GCP are all tied for second at 8 supported languages. Realistically, these are the most flexible platforms as those 8 languages don't require transpilation (except for TypeScript but... you know...).
- Rust has an explicit tutorial on the Azure website! 🥰 I'm suddenly more likely to use Azure than AWS in my next big project.
The List
Here is the list of all the supported languages with the platforms that support them. Reminder, a number in {} after the language means there's a caveat, check the bottom of the post for it!
JavaScript
- Netlify
- AWS
- GCP
- Azure
- Vercel
- Cloudflare
TypeScript
- Netlify
- Azure
- Vercel
- Cloudflare
- AWS {1}
- GCP {1}
Go
- Netlify
- AWS
- GCP
- Azure {2}
- Vercel
Python
- AWS
- GCP
- Azure
- Vercel
- Cloudflare {3}
Ruby
- AWS
- GCP
- Vercel
Java
- AWS
- GCP
- Azure
C
- AWS
- GCP
- Azure
PHP
- GCP
- Cloudflare {3}
Powershell
- AWS
- Azure
Rust
- Azure {2}
- Cloudflare {4}
C and Cobol
- Cloudflare {4}
Kotlin, Dart, Scala, Reason / OCaml, Perl, and F
- Cloudflare {3}
Language-Specific Caveats
- The runtime is for Node.js and there is no TypeScript example, but TypeScript is fairly easy to compile to JavaScript.
- There is a tutorial for using this language, but not an official runtime.
- Supported by compiling to JavaScript, some language features / libraries may not work.
- Supported by compiling to WebAssembly, your mileage may vary.
Was this post super helpful to you? Tip me on GitHub.
Have a question or comment about this post? Leave it in the discussion thread on GitHub!
Want to be notified of future posts? Watch releases in the GitHub repo or follow me on Twitter.
Have an idea or request for a future blog topic? Drop it in the GitHub discussions under ideas.
Top comments (2)
I find the bit about cloudflare supporting Kotlin interesting. Normally, Kotlin would be executed on the JVM, so any provider that supports Java would allow running Kotlin. However, since it seems cloudflare doesn't support Java (only AWS, GCP and Azure support it), they can only support Kotlin via Kotlin's support for JS. The problem with this, of course, is that I imagine the libraries/packages available for use are completely different when transpiling to JS, as JVM based libraries probably can't be used. I'll add a note about it being possible to compile Kotlin to native as well, for those providers that support binaries. Compilation is possible while relying on the JVM ecosystem using the GraalVM native-image tool (which is really a Java tool), or by using Kotlin/Native itself.
Right, Kotlin, Scala, etc. support is probably better on the Java-supporting platforms even though they don’t explicitly call it out. Same with F# and the C#-supporting platforms.