r/ada • • 6d ago

Show and Tell Sparrow Web Stack v0.1.0

ada-lang.io crosspost: https://forum.ada-lang.io/t/sparrow-web-stack-0-1-0/4961

Hey fellow Ada enthusiasts.

I was watching some youtube and I came on this video: https://www.youtube.com/watch?v=sQXFhh_PiG4

Where everyone implements a web server with some specific requirements and constraints. 8 CPUs, a fixed postgres database with a specific config. A benchmark script, and some rules etc…

Unfortunately I’m not a member of this guy’s community so I was a bit late to take part in the challenge but I did see the typical languages up at the top of the leader board. Some rust, some zig, etc etc. I decided I would take some time and make a late entry and see how far I could push Ada. Could I get to the top of the leader board? I tried some experiments with AWS and while it is a good piece of software it wasn’t exactly written with performance in mind. It uses blocking sockets and it doesn’t have pools of reactors that handle responses in bulk.

Here was my submission: https://github.com/arjaythedev/multicore-server-challenge/pull/235

Yes I used Claude Opus 5.5 in the preparation of the submission, but it is not vibe coded. The engineering decisions were made by me. I chose the features and the path forward. I suspect if it ever gets accepted and bench marked it should place near the top. The top of the leader board is 230k users before breaking. On my machine I got just above 500k but that’s on 8 AMD Ryzen 9 9950X3D cores and not whatever weaker VCPU the bench marking machine has.

I spent some time extracting the core of the submission and building a web programming stack that would work with how people build web applications these days. The result is here: https://github.com/michael-hardeman/sparrow

What do you think of the repo? Should I take it any further? Should I publish it? Should we take the improvements and apply them to AWS?

The stack so far has:

  • http focused crypto crate provided by OpenSSL
  • postgres client crate provided by libpq
  • sqlite client crate provided by libsqlite3
  • valkey crate in native Ada
  • async TCP socket support for Linux, BSDs (Mac, etc..), and Windows.
  • Ada HTTP/1.1 and HTTP/2 server with gzip and TLS (via OpenSSL).
  • Ada HTTP/1.1 client with TLS
  • Support for health check and metric endpoints
  • logging with request tracing
  • Ada Open_Telemetry support crate
  • Ada S3 support crate
  • Ada Mustache logic-less template crate.

We have spark silver proof of absence of runtime errors throughout the stack. There is fuzzing testing using libfuzz across all communicating interfaces.

12 Upvotes

4 comments sorted by

3

u/rajandatta 6d ago

Publish

3

u/SirDale 6d ago

Publishing software that works is always a good thing. Especially for Ada - you need it to be seen.

2

u/I_hate_posting_here 6d ago

The code is on github, I meant should I publish it to the alire store.

2

u/MonospaceMentor 4d ago

Why wouldn't you? It's not much effort, free, and there's a good chance it'll be of use to someone if only as learning material.