Prototype Wrapup #20

Last week I made 1 prototype, but I suggested that things might pick up this week. As it happens, they did; this week was 5 prototypes, and what's more they were were all pretty small and prototypey. I feel fairly vindicated in my plan to avoid using prototypes for non-prototype work, but I'll wait a couple of weeks before getting too exuberant.

Monday

I wanted to try making something like the next action idea I described a while ago. Something where I can put in a simple list of tasks and just see the next one. I used Elm again, which mostly worked okay, but I didn't quite get to the point of figuring out how to persist anything. It's hard to tell how much is me not being familiar with the platform and how much is the platform being underdeveloped.

Tuesday

I thought it'd be kind of fun to make a hosts file mangler to disable Reddit. I was thinking about making a big physical "distractions/no distractions" switch, which I might still do, but I figured I'd start small with just a command-line tool. It worked great, and actually I got to use someone else's atomic file writing implementation, so hopefully it won't even corrupt the hosts file.

Wednesday

Following on from the distraction switch, I started on a web-based version. I ended up down a giant rabbit hole with routing and mounting and whatnot in Rust's Iron framework, and it took a surprising amount of effort to get that all to work the way I expected. I definitely get the feeling that, at least at the moment, the web isn't Rust's strong suit.

Friday

This was the start of an attempt to work around a limitation of CouchDB that makes it difficult to post things in advance. CouchDB is deterministic, which means it doesn't know how to update views based on the current date. So I wanted to make something that could run in a cron job and update future posts for me. I thought I'd do this one in Rust too, just to get an idea of whether it's good for the kind of standard web api plumbing code I've done a lot of in Coffeescript and Javascript. The answer is no, or at least not yet. Dealing with JSON is really awkward, though I hear there's a new JSON library coming that might be easier.

Saturday

Part 2 of the CouchDB updating was to make it put an update to bump the scheduled document. This turned out to be tricky too (see above about Rust not really being great at web stuff), especially because I ended up fighting with the percent_encoding function for ages before giving up. Still, I got it to the point where it can query and update, though it doesn't yet have the right logic to figure out whether it should update.