Solving (or Creating) Bigger Problems With 64 Bits
INTERCAL-64 has been used to solve real algorithmic problems — graph traversal, spatial indexing, combinatorial optimization. Along the way, we proved a fundamental result about the language's control flow that explains why these problems were impossible before.
DO NOTE The board is a single 64-bit value. One bit per square.
DO ::1 <- ####18446744073709551615
DO NOTE All squares unvisited. Let the tour begin.
Key discovery: The select operator (
~) with contiguous high-bit masks implements logical right-shift. INTERCAL has no shift operator, but it doesn't need one.
DO NOTE Morton code: interleave X and Y coordinates
DO :1 <- .1 $ .2
DO NOTE That's it. That's the whole algorithm.
Key discovery: INTERCAL's mingle operator (
$) IS the standard Morton code algorithm used in production geospatial databases. Bit interleaving is exactly what Morton coding does. This wasn't a port — it was discovering that INTERCAL already had the primitive the industry independently invented.
DO NOTE Outer loop: while any man is unmatched
DO NOTE Inner loop: man proposes down his preference list
DO NOTE If woman prefers new suitor: rematch
DO NOTE Else: reject, try next
Key discovery: Gale-Shapley requires nested loops with conditional branching — the exact structure that the COME FROM paper proves is impossible in INTERCAL-72. This implementation validates the theory.
DO NOTE Bubble sort: max 13 elements as a callable subroutine
DO NOTE 13 x 12 / 2 = 78 comparisons ≤ 79 NEXT stack depth
DO NOTE 14 x 13 / 2 = 91 > 79 → E123 PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON
Practical consequence: Bubble sort is limited to 13 elements. Any algorithm requiring more than 79 loop iterations in a callable subroutine is impossible in INTERCAL-72. COME FROM is the only way out.
DO NOTE Native mingle: 1 clock cycle instead of 200+ INTERCAL statements
DO NOTE Native select: 1 clock cycle instead of bit-by-bit extraction loops
DO NOTE DIVIDE32: from 30 seconds to 4 microseconds
Key insight: INTERCAL's instruction set maps directly to useful bit-manipulation primitives — Morton codes, spatial hashing, GPU texture swizzling. A mingle instruction isn't a joke. It's a pdep/pext equivalent.