Sam Gentle.com

Prototype wrapup #25

Last time I made 3 prototypes as part of a single project. This time was a bit more modest, just a simple experiment with some new tech, but I was pretty happy with it. I've missed having regular prototypes as a way to keep trying out new things, but I'm hoping to ramp them back up soon as things stabilise with my writing.

Tuesday

Yao Ming dithered

I've wanted to try out AWS Lambda for a while, since it seems like an interesting way of shrinking the smallest unit of code. I thought I'd take my Floyd-Steinberg prototype and make it run as a Lambda function that dithers any image you upload to a particular S3 bucket. Rust was pretty neat for that, because it just spits out a static binary so I didn't have to worry about dependencies. I did have to wrap it in a little node script to handle the AWS side of things though, which seemed like a bit of a waste.

Unfortunately, as with many things AWS, the core offering is pretty cool but everything around it was really hard work. I wanted anyone to be able to upload, but you can't do that and limit the file size, so I would have been on the hook for someone uploading their favourite Linux distribution images or whatever. I also had some difficulty with my version of libc being different than the one on the Lambda machines, but in the end the right answer was to just spin up a micro with the right AMI and compile it there, and everything was fine after that.

All said and done, though, I think it turned out well. Lambda seems like an interesting technology and the pricing is ridiculously good. I'm curious to try out the API Gateway/serverless stack at some point, which seems much more complicated but also more polished.