News for hackers. Stuff that matters.
Re:TypeScripting the Technical Interview by ycitm on Sunday March 12, 2023 @03:18PM (#35124875)
I wondered if anyone would spot this :)

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

Re:TypeScripting the Technical Interview by davidmurdoch on Sunday March 12, 2023 @03:56PM (#35125382)
I don't really know what it means, but I've seen it used to work around depth issues in Typescript, but can this use a "trampoline"?
Re:TypeScripting the Technical Interview by ycitm on Sunday March 12, 2023 @06:11PM (#35126970)
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...

Re:TypeScripting the Technical Interview by planede on Monday March 13, 2023 @05:51AM (#35133409)
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.