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 20 different programming languages.

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

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!

Update, 2022-08-26: Moved the TypeScript version to use Fresh instead of Node.js, thereby creating a much simpler, JavaScript-only version. And then I added a new version written in the D programming language, effectively reaching the number of 20 variations for this project.