Hi Juliana, Thanks for your help on the matter!
After reading your explanation about tail recursion I understand the concept much better. I still need to find a way to implement the problematic code in a tail-recursive fashion. But, I'm not convinced that it will solve the problem. Specially since issuing the `apply-to-record-type` over an operating system record yields a short computation time: --8<---------------cut here---------------start------------->8--- scheme@(pastor utils gpu-specification)> ,time (begin ; Avoid printing the output (apply-to-record-type (lambda (pkg) pkg) (@ (guix packages) <package>) (@ (base-system) %base-gnome-system)) #f) $15 = #f ;; 0.007433s real time, 0.007428s run time. 0.000000s spent in GC. --8<---------------cut here---------------end--------------->8--- I'm not able to use the profiler to display how deep the recursion grows. In any case, I believe it should grow equally for the following invocations: --8<---------------cut here---------------start------------->8--- λ guix system build transformed-sheepbook.scm /gnu/store/kpk9la4h9xwp6n7vabd5lfs6kbhb2f2d-system λ guix system vm transformed-sheepbook.scm Killed --8<---------------cut here---------------end--------------->8--- Since the second one hoards the RAM, I'm guessing that the commands operate differently over the resulting operating system record. I'm not able to dig further since the `guix repl` does not support tracing, and using a pure Guile REPL errors out whenever I try to use trace points for this procedure: --8<---------------cut here---------------start------------->8--- scheme@(pastor utils gpu-specification)> ,tracepoint apply-to-record-type scheme@(pastor utils gpu-specification)> ((@ (guix scripts system) guix-system) "vm" "/home/pastor/.config/guix/systems/transformed-sheepbook.scm") ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure port-column: Wrong type argument in position 1: #<closed: string 7fa2d32dd000> --8<---------------cut here---------------end--------------->8--- Interestingly, the traces work when using the `build` command instead of the `vm` command: --8<---------------cut here---------------start------------->8--- scheme@(pastor utils gpu-specification)> ((@ (guix scripts system) guix-system) "build" "/home/pastor/.config/guix/systems/transformed-sheepbook.scm") Trap 0: (apply-to-record-type #<procedure 7fa2aed6e868 at transformed-sheep…> …) Trap 0: | (apply-to-record-type #<procedure 7fa2aed6e868 at transformed-sh…> …) ... /gnu/store/6xxzsp3grp53x9w49wh513i8sjyal3zg-system --8<---------------cut here---------------end--------------->8--- I think I've hit a road block. Does any fellow Guix hacker knows a way to debug `guix system` commands or why the `vm` subcommand does not make the same computation over the record as the `build` subcommand does? Thanks again for your time. Regards, Sergio. PS: I appreciate the book recommendations!