CameronDugan.com

Home - Blog - Mirror - Projects

Gleaderboard

Stats -> The average person can read this 295 word page in 1 minute.


Over this past weekend I created an online real time multiplayer “leader-board” over ssh in gleam.

It was a very pleasant step back from spending my time in complex and interconnected systems. On the contrast, building this in a scalable and fault tolerant way was easy, considering that I’ve never used gleam before.

Here’s how I got here.

Since people keep telling me that the way I spend my free time is questionable at best.

  1. Spend most of this past week watching YouTube.
  2. Get reminded that BEAM exists
  3. Get sad that all the BEAM languages are all functional.
  4. Realize Gleam is my favorite among the others.
  5. Look through the available options for libraries.
  6. Discover shore, a library that lets you write tui from gleam.
  7. And finally, discover beach. A library for serving that tui over ssh.

And now we have the perfect recipe for serving an unreasonable number of requests :)

I’ll update this with more details later. Until then star the shore and beach libraries! And take a look at gleam!

Later on…

I’ve tried to setup a way of hosting this without spending a monthly subscription.

What should be of no surprise is that CloudFlare tunnels really don’t like to have ssh connections incoming from the open web…

So…

You can also check out the code on github.

Known limitations:

My implementation of the server state updates synchronously because actors are designed that way.