(#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

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

The classified information in the future classified information the surface so classified information is classified information and I wasn’t hurt

In fact, look at how soft this ball is

~ Mikuru Asahina The Elder (The Melancholy of Suzumiya Haruhi-chan)


#c2xbjca

@kentonvarda.com That is a fair point. It is also not very cohesive in a ā€œI don’t know what you want, but I’m required to say somethingā€ way. It managed to cover your grammar, the source of food insecurity, telling you ā€œjust eat somethingā€ (which is how I respond to family members who say they’re hungry), and tops it off with a funny video.


#tmw5zsa

@kentonvarda.com I really hate to defend an AI model, or Google, but you did not give it much to go on here. I would’ve assumed you were telling the machine you were hungry and wanted it to suggest food near you.


#cbyflfq

Rental car company absolutely tried scamming me. Obviously they didn’t have the car I reserved, so they wanted to upcharge me like 40% for a nicer car they had… I was able to edit the reservation online while standing there to ā€œwhatever you haveā€ for the same cost as my original reservation.
I walked out with the same car they wanted more money for at the same price I had booked for.


#e2uasba