i had added recursion support for functions but then decided to remove it again and keep nudl stackless. you also can't forward declare functions.

this is mostly so (a) we keep parity with what shaders support (which are stackless) (b) users don't try to solve problems with functions that tables and cases are better suited for, and then run into stack overflows and parallelization issues later.

#devlog #nudl

as always, generated binaries will use the library search path `.` `./lib` `../lib`, so they're suitable for a systemwide install, but can also be put into a self-contained image, like a game distribution.

#devlog #nudl

been reluctant to add libarcmem to nudl because it requires generated binaries to depend on a shared library (static linking not advised, as the resource can really only be linked once into the process), but

a) it saves me a ton of compiler work

b) it has features i need as a user

c) it can fully replace a borrow checker

d) nudl's data oriented design does not require a highly optimized heap

so i think it's worth it to fight for this one and aim for libarcmem institution.

#devlog #nudl

and it works. at least the test case is implemented.

#devlog #nudl

next challenge: cases which use functions which access tables should be ordered as if they had accessed the tables themselves.

seems clear, but there is a simple way to "launder" table access: indirect function pointers.

therefore, table r/w dependencies need to become part of the function type signature.

i had planned a similar qualifier in scopes for globals, but never ended up adding it.

#devlog #nudl

codegen restructured. very simple test is working.

unlike with Scopes, simplefunc here is not a template - types will only be inferred for a single instance.

#devlog #nudl

did some of the basic work of supporting C functions yesterday evening, and learned that the codegen structure needs to be significantly adjusted:

toplevel tables need to become globals so fns can access them. toplevel fns can be in the C namespace. fns in nested folds, which have access to parent vars, become Nested Functions (a GNU C extension). cases that depend on them also need to be in the same fold function, so they can't be toplevel cases.

#devlog #nudl

spent all day refactoring C function call logic because the existing system doesn't support dynamic function pointers. i'm by now almost done, just fixing type inference bugs...

...and i'm done.

tomorrow to complete the *actual* work i meant to do, which is to be able to declare and implement C functions.

#devlog #nudl

new LR's Devlog¹ entry for 15.5.2026 https://git.sr.ht/~duangle/texts/tree/master/item/rubberducking2.md

¹ formerly known as the "ad-hoc devlog"

#devlog #sxpp #nudl #tukan #nowhere #duangle

long train rides are great for writing docs.

just completed basic docs for table types. this also covers operators, library forms and faking tables with inlines or scopes.

https://git.sr.ht/~duangle/nudl/tree/master/item/doc/table_types.md

#devlog #nudl