News for hackers. Stuff that matters.
Re:Unison Programming Language by ajuc on Sunday June 27, 2021 @02:07PM (#27653735)
Nope, according to https://twitter.com/unisonweb/status/1173942969726054401

when you change a function implementation the system has to walk the callers graph backwards starting from all the places where the function was called updating all the implementations with the new hash, then callers of these with the new implementation and so on up to main (or whatever it's called).

I had a chance to implement something like this in a system that used jbpm 3 graph language (basically process X version 1 called process Y version 1 and I updated process Y to version 2). It's nontrivial especially with recursion, I'm wondering how they are dealing with that.

Re:Unison Programming Language by lamontcg on Sunday June 27, 2021 @03:01PM (#27654229)
A git-like datastore for your AST+callgraph.
Re:Unison Programming Language by ajuc on Sunday June 27, 2021 @03:11PM (#27654313)
Let's say you have definitions like that:

    f: Nat -> Nat
    g: Nat -> Nat
    h: Nat -> Nat
    h x = g (x * 2)
    g x = f (x * 3)
    f x = x < 0 ? 1 : h (x / 4)
And now you change f to be

    f x = x < 1 ? 1 : h (x / 4)
How do you do that? There's a cycle in the callgraph. In fact - how do you calculate a hash of a function that calls itself if you need its hash to calculate its hash :)

EDIT: nevermind, recursion is a special case handled differently.