(#ftqfrta) Day 2 was pretty tough on my old hardware. Part 1 originally took 16 minutes, then I got it down to 9 seconds – only to realize later that my solution abused some properties of my particular input. A correct solution will probably take about 30 seconds. 🫤

Part 2 took 29 minutes this morning. I wrote an optimized version but haven’t tested it yet. I hope it’ll be under a minute.

Python 1 feels really slow, even compared to Java 1. And these first puzzles weren’t even computationally intensive. We’ll see how far I’ll make it …

https://movq.de/v/f831d98103/day02.jpg


#hy4eqla

(#uul7hua) I actually can’t progress to day two till I get home 🤣 – I haven’t pushed the code for the mu compiler yet 🤦‍♂️ So no-one can check my work even if they were so kind 🤣


#ioo7g4a

(#qsrwpva) The most interesting part about mu is that the language is actually self-hosted and written in itself. There is a stage zero compound written and go on a stage one compiler written in mu


#or737sa

Thinking about doing Advent of Code in my own tiny language mu this year.

mu is:

  • Dynamically typed
  • Lexically scoped with closures
  • Has a Go-like curly-brace syntax
  • Built around lists, maps, and first-class functions

Key syntax:

  • Functions use fn and braces:
fn add(a, b) {
    return a + b
}
  • Variables use := for declaration and = for assignment:
x := 10
x = x + 1
  • Control flow includes if / else and while:
if x > 5 {
    println("big")
} else {
    println("small")
}
while x < 10 {
    x = x + 1
}
  • Lists and maps:
nums := [1, 2, 3]
nums[1] = 42
ages := {"alice": 30, "bob": 25}
ages["bob"] = ages["bob"] + 1

Supported types:

  • int
  • bool
  • string
  • list
  • map
  • fn
  • nil

mu feels like a tiny little Go-ish, Python-ish language — curious to see how far I can get with it for Advent of Code this year. 🎄


#qsrwpva

Advent of Code 2025 starts tomorrow. 🥳🎄

This year, I’m going to use Python 1 on SuSE Linux 6.4, writing the code on my trusty old Pentium 133 with its 64 MB of RAM. No idea if that old version of Python will be fast enough for later puzzles. We’ll see.


#ftqfrta

(#d2pj7pq) @lyse@lyse.isobeef.org Damn. That was stupid of me. I should have posted examples using 2026-03-01 as cutoff date. 😂

In my actual test suite, everything uses 2027-01-01 and then I have this, hoping that that’s good enough. 🥴

def test_rollover():
    d = jenny.HASHV2_CUTOFF_DATE
    assert len(jenny.make_twt_hash(URL, d - timedelta(days=7), TEXT)) == 7
    assert len(jenny.make_twt_hash(URL, d - timedelta(seconds=3), TEXT)) == 7
    assert len(jenny.make_twt_hash(URL, d - timedelta(seconds=2), TEXT)) == 7
    assert len(jenny.make_twt_hash(URL, d - timedelta(seconds=1), TEXT)) == 7
    assert len(jenny.make_twt_hash(URL, d, TEXT)) == 12
    assert len(jenny.make_twt_hash(URL, d + timedelta(seconds=1), TEXT)) == 12
    assert len(jenny.make_twt_hash(URL, d + timedelta(seconds=2), TEXT)) == 12
    assert len(jenny.make_twt_hash(URL, d + timedelta(seconds=3), TEXT)) == 12
    assert len(jenny.make_twt_hash(URL, d + timedelta(days=7), TEXT)) == 12

(In other words, I don’t care as long as it’s before 2027-01-01. 😏😅)


#vezpyua

(#idaqsba) @kiwu@twtxt.net I’ve no idea about regulations in your area, but over here there are different taxation rules for video and photo cameras. Hence, manufacturers limit the video recording time of photo cameras typically to half an hour, so that they don’t classify as video cameras with their higher taxes.


#t3nbp3q