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
Crystal3.52.292100:02:3111.833.48
Rust1.031.006600:11:207.333.92
C14.1110200:02:305.954.33
Go3.234.776600:02:0013.2218.67
Dart3.838.407600:02:359.4241.33
C++1.343.047900:16:0617.5262.93
Java1.986.8013300:15:0925.96488.86
C#3.1433.478800:01:4846.67539.53
PHP29.324.983700:01:3626.1785.34
TypeScript21.514.674600:02:0743.75933.03
Python75.8819.773000:01:2422.54986.22
Ruby69.9128.172000:01:2229.931118.83
F#4.1331.4810700:02:1055.631164.41
Scala1.9896.617000:03:0878.162277.27
Swift2.796.1511000:15:45153.863173.68
Perl79.5838.192900:01:34105.5710122.93
Kotlin1.98308.808000:04:5469.5711579.45
Elixir42.2385.0341400:03:0262.21194810.09


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!