Pike: To Exit or Not to Exit

2026-03-0810:516732tomjohnell.com

Download Pike on the App Store 01-upcoming-exit Why Google & Apple Maps don't work Picking the right exit when you are road-tripping is not a solved prob...

Download Pike on the App Store

01-upcoming-exit

Why Google & Apple Maps don't work

Picking the right exit when you are road-tripping is not a solved problem. The "Add Stop" functionality on Apple is frustrating, often-times wrong, and has no option for rest areas. I've noticed the "Add Stop" options are not holistic - they are just a smattering of options at exits ahead. Google Maps and Apple Maps on the phone are great when you are doing a radial search, but you don't care about the options that are near "as the crow flies" but far in terms of detour time. You want "1 minute off the exit for the next 5 exits" options.

A solved problem, re-solved in an app

That's where Pike comes in. With Pike, you can swipe through the next exits and look at the options at a glance via exit cards that are reminiscent of the famous blue logo signs you've undoubtedly used on the interstate before. Every option is within 5 minutes driving time of the exit. I love the simplicity of logo signs - it's why we generally rely on those over my wife searching on her phone. It's not that important of a decision and trying to Minority Report the next three exits on your phone for the right stop is not ideal.

Who is this for?

Well, my wife and I plan on going on a 6 week roadtrip starting in May, and we'll be doing a heck of a lot of driving on the interstate. She and I have similar tastes in food, but we have definitely made the mistake of waiting too long for an exit, getting hangry, and then ultimately stopping somewhere neither of us are crazy about.

I'm trying to make shopping for where to eat next easy to do. Maybe you're not terribly hungry right now, but wouldn't you want to know you're about to pass the last Chik-fil-A for 300 miles?

But also, we'll be traveling with two golden retrievers: Goose & Peanut. My app doesn't offer this feature just yet, but soon I will add parks and dog parks to the categories on the app. We like to let the dogs stretch their legs and RUN on a big travel day. This is a real problem we have, trying to track down a good place to let them loose, so I will be very much incentivized to get it right.

IMG_6919

How did I build it?

Same as I've built everything these past several months. With Claude & Codex. This time I went in with no spec and no idea how map data actually works. I'd like to share early iterations and why they were wrong and briefly explain how I fixed them:

v1 - Directional Points of Interest (POIs)

The first iteration was basically "find restaurants that are ahead in my current direction of travel". What a terrible idea.

Why it didn't work

Roads, even interstates, have curves. As your car is driving, "restaurants in your general direction" will change over time and be inaccurate.

v2 - Non-directed interstate graph

Second iteration was to pull interstate data from OpenStreetMaps (OSM) and build a non-directed graph of the interstates. First, the app latches you to the closest edge of the graph and then traverses the graph in your current direction of travel via Dijkstra's algorithm to find upcoming exits. When I found an exit, I would do a radial search for POIs.

Why it didn't work

Because the graph was non-directed, it would encounter exits that are inaccessible to the user's current bearing via Dijkstra's. e.g. it would recommend the westbound rest area while you are traveling eastbound.

v3 - Directed graph for every direction

Third iteration was to solve the inaccessible exits by creating a directed graph for both directions of travel. At this point I'm face-palming thinking to myself - "If I has just stopped to think about this problem even just a little bit, I wouldn't be having to rework this so much." Does that remind you of a product manager you once worked with who had a skinny spec?

Why it didn't work

Well, it did kinda work, but the problem is, OSM data is quite messy, and traversing graphs in real-time to find exits can lead to dead-ends if you're not on the right node or "component". I'm sure this was solvable, but I often found there was yet another edge-case every time I thought it was fixed. Side note: a very hard lesson learned in developing an app with map data - DO NOT USE HEURISTICS - YOU MUST FIX THE DATA.

v4 - Sequences

This should have been REALLY OBVIOUS early on. The graph is not going to change dynamically over time at a rate that would warrant traversing it in real-time while folks are driving. Just pre-compute the sequence of exits and create canonicalized exit & exit sequence data - AKA a linked list. This is so unbelievably obvious upon reflection - but I had a ton of fun building ridiculous graph traversing logic.

Why it didn't work

Actually - the sequence data is great, and it's what powers Pike today. However, there was a separate problem: the POIs it was recommending sometimes didn't make sense.

Remember earlier when I said "find the upcoming exits and do a radial search for POIs". Well - imagine how well that worked for exits that don't actually exit the interstate, but instead take you onto another interstate? YOU CAN'T EXIT!

This was the magnum opus of this project. Pumping all of the data from OSM into Open Source Routing Machine (OSRM) and pre-computing the driving time from every interstate exit to every restaurant, gas station, EV charger, rest area, and hotel across all of the continental United States. This required an instance on AWS with over 200 GB of memory that cost $1k+ a month (thankfully I only needed for a few hours) in order to compute. What a magnificent open-source project. Both OSM and OSRM. Incredibly simple to do given the overarching complexity. With this tool I pre-computed both the driving distance and driving time for every exit POI combination. That is what enables Pike to be so accurate with the POIs it recommends. If you can't get there in 5 minutes, it's not going to recommend it. I plan on making the timing configurable in the future.

Closing thoughts

So there you have it. Pike was a wonderful lesson on how OSM data works and the tooling ecosystem that surrounds it. I learned a valuable lesson of ditching heuristics for map problems - never again. I also, for the first time, wielded the power of a super chonky machine in the cloud. I've always wanted to just solve problems "locally" but in this case I simply didn't have the means. Using Claude to help guide me on how to spin up the instance and prepare it for the compute was so dang easy - I couldn't believe it. I couldn't believe I had spent HOURs running out of memory on my local machines before finally begging Claude for mercy.

If you think this app could be useful for you in the future, give it a shot! I would love any feedback. Safe travels.

Download Pike on the App Store

More Screenshots

02-rest-stop 03-exit-view 04-poi-view 05-list-view

Download Pike on the App Store


Read the original article

Comments

  • By sharkjacobs 2026-03-116:041 reply

    My phone is littered with apps like these, which seem well designed to address a very specific problem which I don't have very often. The problem is remembering the app's there 3 or 6 or 9 or 18 months later when it would actually be useful to me.

    • By Affric 2026-03-116:381 reply

      I always think that the goal of apps like these is build userbase and then get acquired, like darksky or waze: the big providers realise they have missed a trick and then it becomes the default.

      • By tbyehl 2026-03-1112:481 reply

        "Needed tens of dollars of rental compute" isn't much of a moat to get acquired instead of copied.

        I loath Waze. Its idea of shortcuts are terrible, its search routinely suggests things hundreds of mile away ahead of the match that's nearby, and sometimes I go through an area of intermittent service where it just decides to stop routing without giving a heads-up.

        But Waze is so much better at accurately alerting me to police than my Valentine 1 was that I never even bothered mounting it in my latest car. Google supposedly integrates that data for years now but every time I try it comes up short. Google and Apple Maps are better in every other way, but for me at least, that one feature of Waze is a massive moat.

        • By kelvinjps10 2026-03-1112:591 reply

          Why they police alerting feature it's so important for you? Google maps it's almost as good I find anyways.

          • By projektfu 2026-03-1116:261 reply

            His car burns cannabis while blasting "Fuck Tha Police" at 10,000W.

            • By tbyehl 2026-03-1313:40

              Nonono, despite my outward white appearance, I follow the sage wisdom of Chris Rock[0]. It's so I have enough advance notice to blast "Fuck the Fire Department" so we can share a nice laugh at the historic rivalry between LE / FD.

              [0] How Not To Get Your Ass Kicked by the Police: https://www.youtube.com/watch?v=uj0mtxXEGE8

  • By vmilner 2026-03-1110:001 reply

    I thought this was going to be an article by Rob Pike on control flow in golang...

    • By jhbadger 2026-03-1110:491 reply

      Or the (mostly forgotten) scripting language Pike (derived from the internal language of a MUD) https://en.wikipedia.org/wiki/Pike_(programming_language)

      • By cestith 2026-03-1113:251 reply

        I was prepared for a debate on calling _exit() vs exit() vs no explicit exit in Pike. This app is pretty interesting, too though.

        • By em-bee 2026-03-1114:441 reply

          there is also the use of return from main(), in particular return -1; which doesn't exit.

          i was debating whether i should post this discussion on the pike language discord, but now i will. you two made my day!

          • By cestith 2026-03-1116:38

            I don’t program regularly in Pike. I’ve played with some of the examples from various benchmark and language comparison sites for the most part, but given additional free time it’s a language I’d like to actually use sometimes.

            I therefore wasn’t even aware of returning -1 from main() doing that. It’s an interesting thing. I’d like to read about that, but maybe not enough to join the language discord.

  • By jonathaneunice 2026-03-1116:301 reply

    Love this!

    Have wanted to work on a "better situational awareness while traveling" app, but haven't yet had the chance. Reachability of a POI is a great place to start, and I _feel_ that "it's a lot harder than it at first looks" aspect.

    It would also be cool to:

    * Become aware of local attractions. Esp. good restaurants, shops, views, hotels, hiking trails, etc. A lot of rating systems seem to give every fast food venue 3 or 4+ stars. Impossible to sift out the truly good and local / unique from the chaff.

    * Become aware of time-limited events. Fairs, art shows, VFD chicken BBQs or fish fries, ... all the little "I wish I knew that was happening, I would have stopped by!" I constantly search for the local, the offbeat, the not-yet-another-corporate-outpost. But again, the chaff!

    * Be able to navigate on backroads and scenic roads. Mapping apps are so hyper-focused on getting you there fast. They're not good at "get me there happy"—at least not for those of us that value the path less traveled far more than the highest-speed highway.

    • By tjohnell 2026-03-1116:39

      I'm also interested in your second bullet. The likelihood that you're passing by a cool outdoor event while blazing down the interstate is a lot higher than if you're staying in town. The data would be very difficult to source.

      Thanks for the ideas though. Give Pike a try and let me know what you think.

HackerNews