Most importantly, this means my type system N-queens solution now works for an 8x8 chessboard (actually up to 10x10) instead of complaining about recursion depth:
There's a recursion depth limit of 500 on the TypeScript compiler, which prevents this solution working for N > 7
Even Aphyr's original Haskell solution only demonstrates N = 6, so in some sense this is an improvement on the state of the art for type-level N Queens solutions /s
I don't think there's any way to do iteration in the type system (other than recursion), so there's no way around it.
I considered forking the compiler to set a deeper limit, but at some point Typescript itself is going to stack overflow. Also that probably goes a bit beyond what Criss is expecting in an interview...
I don't know about the typescript compiler, but the way around template recursion limits in "classic" C++ template metaprogramming is to figure out a way to make it O(log N) depth instead of O(N) (for some value of N). Like instead of linearly iterating through a range of types through recursion, you divide and conquer. Easier said than done, but possible in some cases.
The runes are mostly "just because", but there is a reason.
Ideally, I would have written:
type Nil = unique symbol
Which would ensure the Nil type wouldn't match with anything but itself. Unfortunately, the compiler doesn't allow unique symbol other than on const variables initialised with Symbol(). So I needed some meaningless symbols.
I could also have done
type Nil = "nil"
But then it would have looked like the string meant something.
One of my new years resolutions was to learn to type faster. To get some practice I started taking notes in all the meetings I attend. This wasn't common practice in my team before, but I've found it to be really useful. I've lost track of the number of times someone's said "didn't we talk about this in that meeting a couple of weeks back" and I've been able to point them at my notes.
I've found a really simple way of authoring and sharing notes is to write them in Org mode and then push them to a wiki on github. Github understands how to render Org markup nicely, so you get a nicely formatted wiki pretty much for free.
I'm personally in favour of Cloudflare as the simplest solution - even simpler than letsencrypt. However - there are a few caveats. They tend to hit some countries with a Captcha unless you disable it. Might not be an issue. Their "Flexible SSL is controversial as it only encrypts from client to them - not from them to the server. Personally I think this covers the most obvious threat models and is probably "good enough" for the a lot of use cases.
https://www.richard-towers.com/2023/03/11/typescripting-the-...