when i set out to find better program semantics, one of the background requirements was "make it canonicalizable", and then i totally forgot about it and just went by instinct.

now i realize nudl programs fit the requirement: the program is formulated as a non-recursive dataflow DAG, with all mutations happening on weak backedges. and, because there is a mechanism to encapsulate mutations as storage operations, each iteration of the program can be made pure.

how this is good:

#devlog #nudl

* two DAGs are structurally identical if and only if their canonical forms match. this enables fast hashing, cache lookups, and deduplication.

* structural diffs become tractable. you can detect which nodes/edges changed between two versions of the program.

* unambiguous serialization: diffing then makes it possible to restore most of the state under schema change.

#devlog #nudl

@lritter Nice! Very vague memories of wondering about "canonicalisability" maybe allowing for greater sophistication in editing / navigating a language.

Sadly not recalling much more than that atm, but I think part of it was the idea of the language always being some of the way through the compilation process – tokenisation, at least – while we're writing it.

@miblo ah. this particular application would be a bit difficult here since the program allows relating data completely out of order - that's a major feature, in fact.

however, once parsed, the compiler offers many avenues for parallelization, primarily because the language itself was designed for concurrency.

(it's a side effect of specialization - if your specialized code is easy to parallelize, then any interpreter pass (including typechecking) can be, too)

@lritter Ah right! It's coming back to me a bit, pretty sure I'd've wanted it to allow out-of-order declarations, and I'm recalling this weird notion of having the ordering itself be canonicalised – based on order of access / execution, dependency on prior computations – whose "rendered position in the file" is represented as an offset from the canonical position according to where the programmer wrote it.

Dunno, maybe that couldn't've worked after all…