Hacker News new | past | comments | ask | show | jobs | submit login
Two million checkboxes (written in Elixir) (twomillioncheckboxes.com)
122 points by pjullrich 5 months ago | hide | past | favorite | 56 comments



Fuck everything, we're doing 5 million checkboxes

[0] https://www.theonion.com/fuck-everything-were-doing-five-bla...


Funny how these things are fairly simple on BEAM. Funny how majority of industry won’t ever learn anything about BEAM and will keep hitting walls for the rest of their careers.


Without evaluating the merits of your statement, I find it funny you start out implying others are close-minded, but end up rather close-minded yourself.


Considering how many other solutions that are all trying to solve distributed systems issues but avoiding just using Erlang or Elixir I think the statement has merit.


Exactly, I've commented many times on here that at least half the show hn posts (like Hatchet from yesterday) are just overlycomplex implementations of features that have existed on the beam for decades. Or at least already in the Erlang/Elixir ecosystem (Oban, for example).


Proof that the only thing that matters about any software is whether it's easy for beginners to get into. What's wrong with Erlang that in ten years it's seen so little adoption?


10 years? You mean 38 years. And Elixir (a language on top of Erlang) has had solid adoption and is very easy for beginners.

https://joyofelixir.com/


The majority of the industry is made of people who care mostly about their own careers. If solving nasty distributed system problems is simple, you can't justify having a huge bloated expensive team. If your team doesn't spend a lot of money, you aren't seen as very important within the company. Since people want to be important, it's hard to get more productive languages to be adopted.


It's way too slow and per-task overhead is much higher than in compiled alternatives (Rust and .NET - BEAM performance is much worse than these, sometimes by a factor of 10).

Surely you're not asserting that other platforms that provide concurrency and parallelism primitives are designed by people who don't know what they're doing?


What can BEAM do that other languages can't? Do you have a favorite learning resource for it?


Check out this presentation :)

"The Soul of Erlang and Elixir by Sasa Juric"

Really one of the best presentations to show what you may get out of adopting Elixir.

https://www.youtube.com/watch?v=JvBT4XBdoUE


Here's the meme https://www.reddit.com/r/elixir/comments/gpdlp4/the_more_i_l...

It's not so much that it does things others can't, it's that it does all the things, running in the same application space, and things like background jobs, or a caching layer, or cron are all things that most stacks these days need to sort via another library, and Erlang/Elixir apps just do it all on BEAM.


I find the pedagogy of Erlang and Elixir to be sparse. Maybe those programmers just start out strong and don’t need soft on-ramps. I know they’re working on it but not having types is also a big deal for project scalability and not just performance scalability.


What is BEAM?


BEAM is the VM that Erlang, which Elixir (which this project uses) runs on:

- https://www.erlang-solutions.com/blog/erlangs-virtual-machin...

- https://www.erlang.org/blog/a-brief-beam-primer/


Unfortunately the Elixir app seems more flaky and keeps disconnecting with even a small number of users compared to the 1m checkboxes guy.


tbh, the 2m app is more clunky than the OG 1m. Virtual scroll is very poor. Jump doesn't seem to work (it works just sometimes).


Any recommended learning resources?


There is currently a HumbleBundle running with a bunch of Elixir books from PragProg. I won't share the link as I don't want to spam.


get your feet wet with elixir or gleam. i think they are way more approachable than erlang


I upgraded the server to 2 performance CPUs and 8gb of ram, running on Fly.io Should be fiiiiiiine, right?


Definitely needs more edge functions to scale horizontally across a global CDN.

Sincerely, Your friends at the triangle company


Nope, sorry. Not at 8:05am Eastern.


It’s actually fascinating to watch this one. You can see scripters fighting for control. I just watched all the checkboxes get unchecked within a couple seconds, followed by an equally swift counterchecking from the opposing side.

Love the user count too. That was missing from the first one.

It would be nice if it had a fixed zoom level so that messages like "hi" would show up the same for everybody. But given the scripting, I guess it wouldn’t matter anyway.

Now you know what you have to do next: add 8-bit color selection support. Then we can prove once and for all what HN’s favorite color is.


Ha, nice. Any interesting notes on scaling and load testing? At what point does it fall over? We all found it out empirically with One Million Checkboxes, so I'm curious how this compares.


I'll let you know once we had actually hit some performance ceiling. Right now, there like 50 users. I don't even see that in my metrics. But I'll keep you posted.


Some numbers. When cursors.io (now dead, search images) had a huge influx from China for some time, it went into thousands daily. According to wiki, r/place attracted 90k, mostly bots, I guess. There isn’t much to retain a “player” in subj tbh, so…


You can read more information here: https://github.com/PJUllrich/twomillioncheckboxes


What is wrong with un-checkers.

Like do y'all leave carts out in the parking lots and Starbucks drinks on shelves? What went wrong in your life that you think it is fun to destroy other people's work.

EDIT: Feature request with that in mind: you should block someone's ability for 5 seconds to click if they are clicking subsequent boxes and someone reverses the check/uncheck within 2 seconds. Turn it into a real war.

eg: you are checking/unchecking in a line and someone clicks the box right as you click it, you get stunned.


It's a checkbox. It has one job in life. To be clicked. Your OCD isn't going to prevent me from clicking some checkboxes, either to check or uncheck them.


Awesome! Would it be possible to make checkbox number part of the url? This way, I could send someone a link straight to part of canvas, that I worked on :D


For every checkbox unchecked there should be a pop-up ad.


For every comment like this you should have to sit through a PSA for OCD /s


Is this going to be a thing now where someone releases a doubled version every week?

I would like that.


I just built my own version because I was curious how this would look like in a server-side rendered framework like LiveView. But I'm all for it that we build different versions in different stacks and compare notes :)


I’d like to see it go exponential: “one million websites of one million checkboxes”

Perhaps every checkbox in the toplevel site spawns a new, million-checkbox page? :)


If there were to be an arms race like that, my first attempt would be infinite-checkboxes or similar. Would probably run absolutely horribly on anything but the beefiest machines, and cost thousands of dollars for bandwidth.

Would need to come up with a way to make (un)checking computationally expensive to stop the state immediately ballooning to gigabytes in size.


We could call it More's Law.


I’ll setup a chessboard to keep track of them on.


Elixir + Phoenix Liveview is such a mind blowing set of software. It really is something different that works so well for the majority of web applications.

I really do recommend everyone to try it out.


I was expecting it to keep 2million checkboxes updated in my browser.

But looking at the websocket messages, it seems to only send updates about the slice I am looking at which consists of 1441 checkboxes at a time.

https://i.imgur.com/uKH4wee.png


Darn, I was gonna do that optimization


Which coordinate is the "opt out of targeting cookies" checkbox at?


It has gone wonky. An hour ago even with more users circa 170 I was able to jump to 1900000 and above and get a display.

As of now (14:00 BST, circa 70 users)there is no display even for the numbers before that, 95000.


Ok but where is the ceiling? I was told there would be a ceiling!


Let's find out! :D


Ceiling found, check!


Did they do Rust yet?


Excellent! The scrolling could be better though. I love elixir - but the scrolling from the site a couple of days back was much snappier.


Seems like the server disconnects pretty often. I get disconnected twice now which ruined the boxes I had selected. :(


Yes sorry I just had to upgrade the server and deploy a new version which now shows an updated checkbox checked count.


Will one of those checkbox pages finally add support for "indeterminate" state?


Think about it. You walk into a video store, you see 8-Minute Abs sittin' there, there's 7-Minute Abs right beside it. Which one are you gonna pick, man?


“What about 6-minute abs??”


This has a much higher build quality than the one submitted a few days ago.


Haha, this is so much fun! I love Elixir/LiveView!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: