Fortune Apps

As part of my work in VSHN, I lately prepared a set of demo applications ready to be containerized and deployed in our new product APPUiO Cloud.

The applications are available in GitLab. They have all the exact same set of features (not a lot, mind you), while being written in 15 16 18 different programming languages.

  1. C using the GNU libmicrohttpd system
  2. C# using the standard ASP.NET framework
  3. Crystal with the Kemal framework
  4. C++ thanks to the Drogon web framework
  5. Dart using the Conduit framework
  6. Elixir using the Phoenix Framework (mentioned in a previous article)
  7. F# using Giraffe
  8. Go based on Gin
  9. Java using Red Hat’s Quarkus
  10. Kotlin based on Ktor
  11. Perl with the Mojolicious web framework
  12. PHP with the Slim Framework
  13. Python using Flask (mentioned in a previous article)
  14. Ruby with Sinatra
  15. Rust using Actix and Askama (metioned in a previous article)
  16. Scala based on Scalatra
  17. Swift using the Vapor framework
  18. TypeScript based on Express

Each and every one of these applications are fully containerized, and ready to run. They all offer exactly the same features:

I could not help myself getting some statistics out of these projects, and making a quick and dirty classification of these programming languages and frameworks. I gathered the following data points:

I put all the data in a LibreOffice spreadsheet, multiplied the 5 values above all together into a new score column, and ordered everything in ascending order. The build time was interpreted as a timestamp in December 1899 or something like that.

And the results are here; the lower the score, the “better”.

LanguageEnergy RankMem (MB)LOCBuild (h:m:s)Size (MiB)Score

Taking everything into account, I’d consider using Go, C#, or TypeScript (in that order) for such an API anytime. With each of these three languages, the developer experience is unparalleled, the tooling is excellent, compilation times are super short, the ecosystems are huge and vibrant, and the final results are quite good (by that I mean low energy rank, low memory requirements, low SLOC, and fast build times.)

Why Go, C#, or TypeScript, and not the other programming languages?

Some other observations you might find interesting:

Finally, I used the code of all of these projects to automatically generate the documentation shown in the Getting Started page of APPUiO Cloud, thanks to the magic of Asciidoctor.

Update, 2022-06-17:: I’ve added a version using Dart. The corresponding data appears in the table above. It gets a very promising 4th place in the table, thanks to a very fast build process, a small final container size, and very low runtime memory requirements. Unfortunately the ecosystem is not very strong around Dart, but otherwise this looks like an excellent choice for a web API.

Update, 2022-07-08: Added new versions in Crystal and Perl.

Update, 2022-07-15: Crystal is a real surprise: look at the score in the table above!