Mike Kreuzer


Ripley - now with added Elixir

21 August 2016

I've been scraping reddit programming languages subreddits since April, ranking them by number of subscribers, and the results are up on the Ripley site. This morning I rewrote the scraper that generates that data in Elixir; originally I'd written it in Go.

The Elixir code's still in a branch of its own, waiting until I write some comments and some tests. Though thinking about it now the Go version's free of both of those too, so this needn't stay un-merged for long.

I planned on writing a "6 months with Elixir" sort of a post, and still mean to, but I thought some code might be better. I'll add this observation here though: I wrote that Elixir solution twice. The first one was a set of piped tasks, and when I finished it it felt like the most Elixir thing I'd ever seen. It ended something like:

Application.fetch_env!(:scraper, :subreddits)
|> Enum.map(&Task.async(Scraper, :scrape, [to_struct(&1)]))
|> Enum.map(&Task.await(&1, 60000))
|> Enum.sort_by(&(&1.count), &>=/2)
|> write_file

But of course, it wasn't. The most Elixir thing. Not really. Because that had no supervision of the separate processes, and at the six month mark of my Elixir journey supervision's what Elixir means to me.

At six months I'm still excited to see just how deep this rabbit hole goes.

Earlier Posts

WWDC 2016 Hardware

7 July 2016

Three weeks after WWDC & I still feel disappointed it was a software only event this year - despite that idea being telegraphed pretty openly via some of the usual sources.

Read more…

JSON: a lowest common denominator too far

10 April 2016

JSON, much like its ancestral home JavaScript, is both horrible and ubiquitous. So because serializing an array of structs to JSON and writing that output to a file either in compact form or pretty-printed is something I do all the time, looking at how different languages handle that task is one way to see how easy the different languages are to work with day to day, as well as perhaps giving something of an insight into their philosophies & communities.

Read more…

Ripley: reddit programming languages index

31 March 2016

Introducing Ripley: reddit programming languages index - the index ranks programming language subreddits by number of subscribers. Ripley, from RPLI.

Read more…

Elixir - Drinking the Kool-Aid

29 February 2016

For the last few Januarys I've taken some time off from the day to day stuff to look a bit further afield, to do something new, code something in a language I've never used before, & have some fun. Sometimes something comes of it -- the static site engine that powers this blog was a January Project -- sometimes it's just ruling something out; but it's always useful, & a practice I can highly recommend to keep jadedness at bay.

Read more…

I, Robot

14 January 2016

I built a robot over the holidays!

Read more…

Reading, a minimal Node.js RSS/ATOM Feed Reader

1 December 2015

I wrote a minimal Node RSS/Atom feed reader, based on code & a blog post by Dr Drang.

Read more…

Or read even earlier posts…