Replr: Easy Command-line REPLs

I built a small utility this week to help anybody start a REPL in any language stack[1], with any libraries of their choosing. It’s built on top of docker, and it was a fun exercise for a couple of days to build something that’s I’ll personally use quite a lot when trying out new Ruby gems.

So instead of creating a Gemfile, making sure that its syntax is correct, installing the version of Ruby you’d like via rvm, instead, you just type in a single command:

replr ruby chronic

& your REPL is ready!

Do check it out at Github and gem install replr

A few things I learnt while building this:

  • I wanted to keep dependencies low (because this is something people will install as a binary into their machines), so I did all the argument parsing et. al. manually. It’s not that hard or clumsy at all. replr currently has 0 dependencies.
  • I used Visual Studio Code as the editor for building this, and its quickly becoming my go-to editor for every kind of code editing. I was one of the last few folks holdouts at Textmate 2, and while VSCode is still not native enough for my tastes, the breadth & depth of its editor and tooling integration is hard to live without now.
  • Speaking of VSCode integration, I’ve heavily used the Ruby editor integration to make sure code conforms to Rubocop​ guidelines. It’s nowhere near as good as Prettier​ on JavaScript though. Prettier just has you spoilt with its auto-formatting & opinionated code rewriting. I feel Ruby can really use a tool like that.

[1]: Well, it currently just supports Ruby, but am planning to add new stacks soon!

Trip to Hampi

Uma & I went on a trip to Hampi recently. It’s an easy place to travel to if you’re based in Bangalore: we took an overnight train to Hospet (& then an auto ride on to Hampi), but you can go by road—take a car or a bus—or even a flight if you’d like.

The north side of the river seems drier, and these sort of spindly trees are everywhere.

This was one of the best trips I had in recent memory. Hampi in its heyday, as part of the Vijayanagara empire, must have been one of the most wonderful places in the world. The extent and immensity of the ruins, and the stories and legends behind each are simply mind-boggling. There are rock pillars that make sounds of musical instruments. There are huge street markets made of stone that used to sell diamonds.

Hieroglyphics anyone?

The Vijaya Vittala temple is just a work of art. If you drive around the Hampi area, every 200 metres or so, you come to a random protected monument: it has no name, but it looks as sweet as any Roman ruin. If you think North India is teh shit, do visit Hampi: the ruins and the glam on display here puts to shame any North Indian monument.

Monkeys are constant companions wherever you go in Hampi.

We stayed at Shanthi guest house during the 3 days we spent at Hampi, and it’s a good enough place to stay. The ruins of Hampi are bisected by the river Tungabhadra, and touristy guest houses are on the north side of the river. The south side is where most of the important sights to see are, but staying on the north means that you can take a good break from all the walking around and just chill.

Both greenery & dry stones. Hampi is a study in contrasts.

The first day we took a scooter (around ₹600 bucks a day + fuel), and traveled around the North side of the temple. We saw:

  • Pamba Sarovar & Lakshmi temple, which you can safely skip. Pamba Sarovar sounds awesome, but it’s just a temple pond.
  • Anegundi: Chinthamani temple, which is cool. This is apparently where Bali & Sugriva fought.
  • Hanuman temple/Monkey temple. This is one of the those places that I struggled to climb up the 575 steps to the temple. Having asthma and long climbs is not a fun combo. My brain went into reptilian survival mode by the time I got up to the temple. It’s a good enough place if you just want to checklist it out.
The Virupaksha temple. By half.

There are good places on the north side of the river if you want to have food: a notable mention is German bakery, where they have low-floor seating and great desserts.

Old Kannada writing is everywhere.

The next two days we spent south of the river, returning by 5.30PM when the last ferry starts. There’s a truckload of places to see here, so I would recommend at least 3 days for this part as we found it a bit rushed. Here’s some notable stuff we saw:

  • Virupaksha temple is the main temple still functioning just on the banks of the river. It’s huge, with immense towers all around and has nooks and corners with a lot to explore.
  • Kadalekalu Ganesha & the Monolithic bull are cut from single pieces of rocks. The figurines have deteriorated quite a bit, but it’s still an impressive sight.
  • Hemakuta temple area south of the Virupaksha temple is a series of several temples and structures. It’s one of the first such places I’ve visited and you can spend a long time wandering around the area and taking photos of odd structures (which is what I did).
  • Elephant stables are a cool structure just outside the Zanana enclosure. I kept picturing the huge place alive with Elephants and their trumpets.
  • The black stone Pushkarni is also a good visit. You can’t climb down into its depths unfortunately, but I’ve always been fascinated with old Indian well constructions.
  • Vithala temple was the best temple structure we saw. This is the place that has large complexes surrounding the main temple, a dance hall with instruments from stone, and a Konark ratham duplicate (that has a great backstory).
  • Mathanga hill is the iconic Hampi sunset destination. It’s calm, quiet and peaceful, and the sun contrasted with the greenery and the mountains, and the temple structures leads to great shadows all around.
Doesn’t this remind you of Roman viaducts?

There’s a lot more that we saw, but the ruins start to blur into one another after a while. It’s a place where you can spend a week or more though, slowly enjoying the old structures.

The black stone Pushkarni.

I would love to learn more about the rise and fall of the Vijayanagara empire. And since I love to read historical fiction and alternate history, I would love to read about stories about the empire. It must have been a great place in time.

New Year Trip to Maldives

Had a wonderful time at Maldives recently. Uma, Gautham, Mekha and me went there for the New Year, and it was one of the best beach vacations I’ve had. Maldives is probably the closest best beach and coral destination to Kerala—it’s just one hour away by flight from Trivandrum.

It’s a huge island country in terms of total land and sea area, but the proportion of land to sea is skewed a truckload: most islands are less than a kilometre long, and far from each other. We stayed in Maafushi, which is touristy, but also affordable, and visited Guraidhoo and Gulhi. To just to give you an idea about how that looks on the big Maldives map, here’s some map porn:

Screen Shot 2018-01-06 at 3.19.54 PM
Yes, that’s pretty much the entirety of Maldives that we saw.

This also means that Maldives is a destination you can go to many, many times. Next time I want to go to the south. Fun facts and observations:

  • The language spoken is Divehi, which is an Indo-Aryan dialect, much like how Sri Lanka has Sinhalese. I would love to understand which seafaring aryan tribe (from India?) first spread this language to these countries, and why they don’t have Dravidian roots instead.
  • The English word atoll is from Divehi atoḷu. Very appropriate!
  • Snorkeling in the Maldives is just divine. The first time I put my head under water, I had a mindgasm. We snorkelled along the shore, the coral reefs, and the deep sea.  There’s so many places near to Maafushi that you can snorkel and see everything from turtles to octopuses to fishes, and dolphins in all their spectral colours. It’s just wonderful.
  • We did a Discover Scuba dive, and it was good, but not as great as the snorkelling. I missed the fact that I wasn’t in control, and there was just too much gear in the way. Should do this again though!
  • Maldives is a dry country without alcohol, but if you stay at Maafushi, it’s pretty easy (and expensive) to get bottles. We got whiskey and vodka for around ₹8K a bottle.

And as usual, took some pictures with my Leica. It was hard to get the camera out with so  much water (& fun in the water) in the way.

This was a wonderful place. By the sea, under the shade, on a swing.
These kinds of chairs (I call them a mini hammock), were everywhere. Not so good for my back though.
The streets were all unpaved. Good enough for an island just a kilometre long.
We did do some water-sports: kayaking (ok), jet-ski (fun, but hell on my back), catamaran ride (awesome, especially how the wind drives the boat), and fun boat (Uma loved this).

In short: great trip with fun people. Should do this again.

A Trip to Bekal

So Uma took me on a surprise trip to Bekal recently, and it was a lovely break. We got to stay in an old Nair Tharavadu that has been converted into a homestay, and the food there was just plain amazing.

I took along my Leica, and got some nice photos.

From the Bekal fort. A great old ruined fort.
The fort has these nooks and corners that lead to some really nice light.
When we went on an unofficial thoni ride.
Some good light at the numerous beaches that dot Bekal.
The “Grandmom” of the tharavadu where we stayed. Wonderful family, great conversation and amazing food.

Having used the Leica for a bit more, here’s my observations:

  • It’s a 10 year old camera, and that shows. If I had more of a budget, I’d have bought the M9, the M240, or maybe even the M10. But the Leica experience is very immersive for shooting photos. I’m more focused on the scene and the feel of the photo than fiddling around with camera controls.
  • I’m not so enamoured with the shoot RAW, use Lightroom RAW conversion, and get a JPG workflow that I’m using now. Even though it provides me a lot more flexibility, I’m more of an in-camera conversion guy. Might be that I’m spoilt by the great Fuji X100S filters.
  • There’s no beating the Leica colours, especially the M8 black and white shots. Even the colour shots — the greens have an otherworldly feel.


The Engineering Metrics Dashboard at SV.CO

We recently built an engineering metrics dashboard at SV.CO. On a single page, it tracks nine things that are like health statistics for a project. In addition, it provides me as an engineering lead, a bird’s eye view of our team performance.

Here’s how it looks like:

Engineering Metrics Dashboard

This is what we track

  • Deploys: The number of deployments per day. Because we use continuous deployment, this number is often north of single digits. What I look for in this stat are long stretches (2 weeks+) of stalled deployments: this often means that we’re not breaking down work into small units, and it’s time I stepped in to take a look.
  • Bugs: The number of bugs reported per day by the team. We want to improve this with the number of bugs fixed and also include in our production automated error reports. This stat, which a slightly lagging indicator of code quality, is still useful especially immediately after our feature sprints. At SV.CO, we try to go by a tick-tock cycle (with the tick representing new features, and tock the needed stabilization or bug-fixes necessary for those features), and examining this stat after a tick cycle will provide a good thumb-rule for the time necessary for the tock.
  • Git Commits: This metric tracks our velocity. As all our stats, it’s not a perfect indicator (especially when team members pair off), but it’s a good way to track slow periods. Since we emphasize atomic commits, it’s also a warning flag when a big feature lands with a lesser commit count.
  • LOC Change: I’m a strong believer in the adage that the best code you write is the code you do not. Or better yet, the code you delete. So we track both LOC additions and deletions. And we celebrate the code that we throw away.
  • LOC Language Split: This is a companion metric to LOC Change, and the one thing I track here is removing older deprecated languages (like CofeeScript).
  • Test Coverage: is a good useful indicator of code quality. As a development shop, we’re not anal-retentive about TDD or unit testing, but we do like to cover features with good integration test coverage. This usually means Selenium-style testing with capybara.

While building this dashboard, we kept several common criticisms in mind.

  1. These are vanity metrics. I’ve explained the usefulness of these metrics above, but this requires a bit more explanation. As a human being, I don’t see a problem with taking pride in the work we do. And as a software engineer, most of the work we do happens to be ephemeral: we work with building blocks that do not stand the test of time. What we can be proud of constantly is the programming journey. So I call these metrics what we can (or should) be proud of.
  2. It’s hard to keep them updated. What we’ve done is hooked them up to APIs that our services provide. For example, the code commits are pulled directly from Github, and the Bug reports are pulled off our Trello boards. This still will require maintenance but hopefully far less than if these were manually tracked.
  3. Why don’t you track these data where they originate? The answer to this is pretty simple: we use quite a lot of software to manage our work, and it’s nice to have all the data in one place.

That’s it for our dashboard! Any feedback appreciated.