I don't care about one over another, but I would prefer if all examples followed the same approach. It would make the comparison more valuable.
Personally I think a more real world method would have been to use the most popular web server framework for the given language. Someone else already commented that the Swift example would never do it this way in a real application.
var app = WebApplication.Create();
app.MapGet("/people", () => new[] { new Person("Ana"), new Person("Filipe"), new Person("Emillia") });
app.Run();
record Person(string Name);
The above (struggling to find the backtick on my Mobile keyboard) is straight from the ASP.NET website: https://dotnet.microsoft.com/en-us/apps/aspnet/apis
In any case - https://github.com/begoon/http-server/pull/1
But it's still valuable to know which languages support this out-of-the-box, perhaps.
also of note is to notice how many languages lack good support in standard library and therefore require much more code to be needed.
That’s fine for web oriented languages. But I sure hope others aren’t including a complete HTTP stack in the standard library.
Agree, I wasn’t consistent with “a framework” vs “just language” approach. Ideally it should be 100% one or another.
My idea was to use the standard library as much as possible, but I didn’t eliminate the use of third party libraries entirely if it would allow async/concurrent processing.
It all started with Go vs Rust vs Zig as the main point of comparison. Then I added more languages I am familiar with.
By far, IMHO, Go is a clear winner in terms of being 100% with the standard library, fully concurrent and quite concise.
Sure, JS/TS implementations are also concise but it is different, not natively compiled technology.
The language's selection is purely my personal familiarity, so nothing wrong with Java, it’s just not my area.