I guess maybe I'm back again? We'll see

The issue: github.com/ankitects/anki/issu
And the reason I'm aware of that issue is because I finally got a nixpkgs version working! github.com/NixOS/nixpkgs/pull/

I'm a fan of the new ninja+rust build system, very generate-ninja vibes, and definitely made packaging it for nix easier than the old setup. I failed several times to get a working bazel-based package there, and this one only took like 5 hours total of banging my head against silly issues and waiting for rust to build.

Show thread

I'll add another one, since it hit me again today:
If I put the screen to sleep (tapping the power button) and change the volume up or down too near to each other, the volume gets "stuck" going up or down, and either goes to 0 or blasts my ears.

Show thread

Another for the list:
Progressive web apps seem to only be addable to the home screen from safari. The "share" button on firefox-for-ios just doesn't have the option.

This came up because Japan's immigration app is a PWA now (awesome!), which meant I had to open safari-for-iphone for the first time in months (bleh), since I kinda do want offline access to this one.

Show thread

Happy international tea day (disputed), everyone!
I don't care what day the UN says International Tea Day is, I'm going to drink tea today anyway 🍵 🍵

2. It took me over a year to figure out that I could make my alarm fade in by going through setup in the health app... which now makes a special "sleep" alarm show up in the alarm app, which does fade in. But also has a different ux to set it and can only be set in increments of 5 minutes?
I would not have ever found this special type of alarm that does fade in by default if I hadn't googled this.
The health app changing the options in alarm app feels bonkers.

Show thread

To start with, I'll do the two that stick out the most:
1. iOS limits you to 1 timer at a time. On my android phone "Okay google, set a timer for 10 minutes. Okay google, set a timer for 20 minutes" resulted in two timers. iOS will only let you replace the older one. This still bugs me since it changes how I cook a bit.
(1/2)

Show thread

I've been annoyed by enough stuff in iOS that I'm going to just kinda keep a list via a mastodon thread as I run into or remember them.

turns out chatgpt is bad at math:
> Is 21 prime?
>> Yes, 21 is a prime number [... etc]

However, chatgpt in japanese is better at math:
> 21は素数ですか
>> 21は素数ではありません。[... etc]
(translation: Is 21 prime? 21 is not prime)

Unfortunately, just having a faster foldl has not been enough to make day11 complete.
At this point, my day11 solution uses all my ram (64 gigs) for something like 25 "rounds", and part2 requires 10k rounds. I feel like this really might be the point where I have to start improving the interpreter itself since that memory usage is just ridiculous.

I'm going to try and get it to work without interpreter changes a bit more since I do have some ideas to try still...

Show thread

That realization has let me write a foldl that has a call stack depth of 2, rather than O(n), which honestly has solved the performance issues for half the days so far
github.com/euank/advent-of-nic

Show thread

My main realization since last time was that function calls appear to have a cost based on their call depth, and that dwarfs basically all else once you hit several hundred calls deep.
Which, given that it's a functional language, even just finding the max of an array is typically a `fold` operation recursive to the depth of the array. There's no TCO or anything to make it efficient.

Show thread

Though, first, as a random aside it turns out they do not yet have exhaustive tests for their stdlib. As shown by an update making a stdlib function reliably error: github.com/tweag/nickel/issues

Show thread

I haven't nickel-posted for a few days, but I have still been writing nickel for advent-of-code! So, that means, nickel thread. tl;dr: nickel is still slow, it is not fast.

Or oops, there was a methodology error in there.
The first one is 2 minutes and ~4GiB of ram, not 2s. I was accidentally leaving part of it un-evaluated.
Still, a darn sight better than the foldl bit.

Ultimately I ended up with this non-foldl max github.com/euank/advent-of-nic ... that ended up being plenty fast.

Show thread

Learnings from day 8 for advent of code in nickel:
`array.fold` is slow on larger lists in nickel. Very slow.
Time to process day 8's input into a list of ~10k numbers: 2 seconds & ~250MiB of ram
Time to find the max in that list using `array.foldl num.max 0 list`: oomkilled after 2 hours for using >60GiB of ram

I skipped posting these for a couple days since day 3 and 4 were pretty boring.
Day 5 again makes me afraid i may not complete all of them in nickel. My part 1 code took 60GiB of ram (I've only got 64!)
Either way, when AoC is done, I'll go upstream and drop a note about all the functions that weren't in the stdlib, but felt sorta like they could be github.com/euank/advent-of-nic

Show thread

On the bright side, I found my bug and it gave the correct answer.
However, the ~4GiB RSS and ~4 minutes of spinning a core is uh.. I dunno, seems like a lot for basically adding up 2500 numbers.
Done posting about today's AoC

Show thread
Show older
Wobscale Social

wobscale.social - a server for friends of the Wob, affiliated with Wobscale Technologies