Elektrine lite

← Feed

@void_friend@tech.lgbt

Post #1141046

2026-04-13 19:11 UTC

Do I know anyone with a 32-bit computer, an OCaml compiler and 30 minutes of compute time to spare? I would like to see what this program prints if you give it about that amount of time (give or take). In theory all exceptions Foo are supposed to be different (https://ocaml.org/manual/5.4/coreexamples.html#s%3Aexceptions "the function f cannot raise a Done exception"). let the_exn = ref Exit let c = ref 0L let rec f () = let exception Foo in if !c = 0L then the_exn := Foo; if Foo = !the_exn then Printf.printf "The %Ldth exception is the same exception\n%!" !c; c := (Int64.succ !c); f () let () = f()

Replies (4)

  • @atax1a@infosec.exchange 2026-04-13 19:16

    @void_friend@tech.lgbt if you don't have someone by this evening we'll spin up a 32-bit VM in 86box

    Open ##2423041

  • @stylus@social.afront.org 2026-04-13 22:43

    @void_friend@tech.lgbt Running on a 64 bit host but within podman --arch i386 debian:bookworm, # ./a.out The 0th exception is the same exception The 2147483648th exception is the same exception

    Open ##2423042

  • @void_friend@tech.lgbt oh I remember hitting this edge case a loooong time ago

    Open ##2423046

  • @cigix@pouet.chapril.org 2026-04-14 16:36

    @void_friend@tech.lgbt there were other warning signs before that, but... > From OCaml 5.0 onwards, native compilation is available only on 64-bit systems. Native compilation on 32-bit systems is no longer available, nor are there plans to bring it back. https://github.com/ocaml/ocaml?tab=readme-ov-file#overview so I'm going to stop hacking there :D

    Open ##2423050