Prototype wrapup #28

Last week I did 3 prototypes, but this week I only managed one. That isn't too surprising, because last week was a failure week and all that. Still, I'm happy to vaguely keep my hand in, especially with my recent thoughts about tire kicking giving me a better framework for how to think about prototypes.

Thursday

Dithered Yao Ming as a terminal background

I've come to quite enjoy Floyd-Steinberging an image as a tire kicker. In this case, I'd recently learned about the fairly cool 𝚫 now project, which aims to be a sort of minimum viable Heroku. I saw the similarities to the minimum unit of code potential I saw in my AWS Lambda prototype, so I thought I'd try it out.

I had to work a bit harder for this one, because it was going to handle file uploads directly. That meant I couldn't use my node wrapper script trick from last time. Instead, I added http support to the code itself (via hyper). This turned out to be pretty simple, but I went a few rounds running through different options for web libraries before I found one that would let me just stream to the output. Rust's library story for web services is still a bit rough, but I think the main pieces are there once you get used to them. I didn't really deal with errors, so invalid input just brings down the service, but I figured that wasn't such a big deal for this.

As far as deploying (ie, the original goal of this prototype), it was super easy, and I was really pleased with 𝚫 now. Instead of building a binary, I gave it a Dockerfile (thus avoiding my incompatible libc woes with Lambda), and it just slurped it all up and built it. The first deploy did just hang confusedly, but I suspect that's because I was listening on the wrong port. Anyway, if you want to Floyd-Steinberg your own image, feel free to curl -T your-image-here.jpg https://saas-yeozgzvoii.now.sh > output.png.