mattbaker
Anyone else doing the Protohackers challenges?
I’m having so much fun working on the “Protohackers” challenges, I never got into Advent of Code much but this has been amazing. The challenges are all centered around protocols, so far they’ve all required you build a TCP server (gen_tcp makes it easy).
Also it’s an area Erlang/Elixir really excels at, so it’s fun to build lower level things that leverage all the great Erlang stuff, something I don’t think most of us get to do too often! Good opportunities to play with gen_tcp, messing with bits and bytes, and using binary pattern matching.
There’s an #elixir channel in the protohacker discord if you decide to jump in! ![]()
Couple last things to mention:
- ngrok doesn’t work, it seems to mess with TCP traffic, so I opened a port in my firewall and forwarded it to my laptop, then I provided that port along with my public IP. I liked that because I didn’t have to bother deploying my app to a VPS/Fly.io/etc. I just closed the port when I was done.
- The Elixir intro actually has a section where you implement an echo server with gen_tcp, it’s perfect for getting started.
Most Liked
ahamez
Hey! If anyone’s interested, here’s my solutions for problems to to 8: GitHub - ahamez/protohackers: Elixir solutions for https://protohackers.com.
It was a fun experience so far (except for problem 7, the specification lacks some details which nearly drove me nuts
).
Also, I’ve been able to use Nx for problem 8 by encoding the cipher as a matrix, it was very fun to do!
lud
Okay, today I learnt
Thank you. I do not use ngrok but it seems that all commercial tunnel software will suffer from the same problem.
@mattbaker here is my last attempt https://github.com/lud/protohackers/blob/main/lib/proto/p0/smoke_test.ex .
jackharrhy
I’ve been doing them! My question 2 (means to an end) solution needs work, but otherwise been having a blast so far.
NobbZ
I finished my attempt to the smoke_test yesterday and tinkered a bit with the repo setup over the day.
jackharrhy
I’ve been cloning the repo to my server, and wrote a little script to book into an iex shell w/the application running ( protohackers/run-in-docker.sh at main · jackharrhy/protohackers · GitHub )
been working good so far!







