Michael Bacarella
michael.bacarella.com
Michael Bacarella
@michael.bacarella.com
Founder GPShopper (successful exit)
ex-Jane Street (pre-SBF)
ex-Google (pre-Sundar)
occasional shitpoaster
Capturing a dictator whose legitimacy collapsed to the point that his opposition won a Nobel Peace Prize is good, actually
January 3, 2026 at 10:03 PM
Advent of OCaml, day 12 👹

**SPOILERS**

This ended up being a troll problem. You could get to work like a sap, do some best-fit bin packing heuristic and it'll take 1000 CPU minutes (✋)

Or you can ignore geometry entirely and pick trees whose area >= max-present-size * number-of-presents 🤦‍♂️
December 12, 2025 at 10:25 PM
from r/adventofcode
December 11, 2025 at 4:36 PM
Advent of OCaml, day 11, solved! 😼

A welcome reprieve from yesterday. Today's solution can be solved quickly with "merely" coding interview level DFS graph search with memoization.
December 11, 2025 at 4:15 PM
nobody says you have to limit yourself to one CPU right?
December 10, 2025 at 5:35 PM
Advent of OCaml, day 10, part 1 😩

You know it's getting grim when people are posting just their part 1 solutions. Took about 4 minutes of CPU to brute force.

I'm sure someone has a cute number theory solution on r/adventofcode that takes 1ms for the whole thing.
December 10, 2025 at 4:23 PM
Advent of OCaml, day 9

These are starting to take too long to solve! 😅

Part 1 done (after a fun misstep trying to allocate a 100M element array...) Part 2 seems... non-trivial. Might have to throw in the towel so I can do, like, other stuff today.
December 9, 2025 at 3:53 PM
the awkwardness of the separate add_circuit and join_circuits code was weighing heavily on me so I combined them. reduces runtime from 2s to 300ms!

99% of the time is now spent sorting 1000² pairs by distance and that seems fine
December 8, 2025 at 11:20 PM
Advent of OCaml. day 8

By far the hardest yet. Both in terms of time to code but also it pegged my CPU for about 2 seconds to compute the answer 😱
December 8, 2025 at 6:24 PM
Advent of OCaml, day 7, solved 🥵

This one threw me for a bit but once I drew the path finding out on paper and stared at it for ... uhm, 40 minutes I got it.

Even though this is mostly imperative, I contend you still have edge using OCaml when it comes to understanding state machine transitions.
December 7, 2025 at 6:12 PM
@heathhenley.dev you inspired me to code golf an imperative solution (in OCaml this time @c-cube.bsky.social!) based on your approach
December 7, 2025 at 12:48 AM
Advent of OCaml, day 6, done (🙀)

This one was quite mind numbing. It reminds me of processing those nasty "grid oriented" EDI order/sales formats that were popular as late as the 1990s

I'm sure COBOL programmers would feel right at home with this one.
December 6, 2025 at 5:56 PM
At the risk of getting myself excommunicated from the OCaml community, day 5 is an example where imperative solution is easier to grok because there's no ready-made higher order function for the pattern you're employing.

That is, IMO, this imperative C++ solution is clearer 🦆
December 5, 2025 at 7:35 PM
Advent of OCaml, day 5 done

Whew. Getting the details right on this one took forever. Happy that the naive brute force solution (just construct a set in memory of the ingredients) couldn't be done and it required a bit more thinking.
December 5, 2025 at 4:47 PM
Advent of OCaml, day 4, solved

wasted about 20 minutes trying to understand what "eight adjacent positions" meant, squinting at only the row instead of realizing it meant also the cells above and below of course
December 4, 2025 at 5:40 PM
Advent of OCaml day 3 solution: donezo

Pleasantly, part 1 and part 2 have similar enough algorithms that you can get away with tweaking only one variable (digits_needed).

github.com/mbacarella/o...
December 3, 2025 at 4:32 PM
Advent of OCaml day 2 solution in the bank!

Spent about an extra hour spinning my wheels because I skimmed the requirements and I kneejerk thought it wanted the part 2 style digits scheme. Which it does, but that doesn't get you past part 1!

All solutions here github.com/mbacarella/ocaml-aoc2025
December 2, 2025 at 8:23 PM
Got day one done. Will be posting all of my solutions at github.com/mbacarella/o...
December 1, 2025 at 6:09 PM
July 1, 2025 at 1:48 AM
Your kid comes back from his first semester of CS101. First it was Python, you let that slide. Then came Go. "At least it compiles" you told yourself. But now... C++?

Your own flesh and blood, wearing that shirt under your roof. This is what happens when you let the universities get to them.
June 6, 2025 at 5:13 PM
May 17, 2025 at 12:06 AM
if the net result of an earthquake destroying TSMC/Taiwan is that every LLM gets repurposed towards rewriting Java, C#, Python and Javascript into C++ or Rust ASAP, that'd be pretty cool
May 13, 2025 at 2:03 PM
Thank you OCaml
March 16, 2025 at 3:34 PM
I may be misreading your requirements but the big thing I'd change here is using zip so you can create a staggered list of dates
December 3, 2024 at 3:42 AM
ackshually
November 30, 2024 at 4:22 PM