Make it possible to /display/ an entire chain of operations producing a variable
tekacs opened this issue · 5 comments
Issue type:
➕ Feature request
Description
IntegratedDynamics doesn't let the user /write/ their own functions (as mentioned in #211), but for debugging purposes, whilst looking at labels is passable, it would be incredibly helpful to be able to see the entire chain of operations leading to a variable's construction.
This probably relates to the (mentioned in some issue that I can't find by @rubensworks, IIRC) suggestion that it should be possible to copy programs for example to put them here in Github Issues.
This possibly relates to #357, as being able to pretty-print variables may depend on reading them back into 'programmer form' from NBT.
What I'm hoping/asking for is something along the lines of the Haskell-esque form that we've all been writing in issues here, along the lines of:
someList = {#11 inventoryReader.items}
mappedList = map uname someList
predicate = and (contains mappedList x) (contains mappedList y)
where someList
and the like are labelled variable names,
or (from #211, meant for computers not humans - though breaking it up like above to be more human readable in a heuristic fashion would be nice)
conj(disj(dot(apply(flip(modulus), 3), apply(equals, 0)), dot(apply(flip(modulus), 3), apply(equals, 0))), negate(conj(dot(apply(flip(modulus), 3), apply(equals, 0)), dot(apply(flip(modulus), 3), apply(equals, 0)))))
which is also simpler with some syntax re-introduced (apply left explicit, to be easier for players), in a form like
(apply contains (map uname itemList)) . uname
Any thoughts?
In your inventory, it would be really difficult to make that work unless you materialize everything, since you as a player aren't attached to the network that has all of the intermediate step variables.
@josephcsible Yup, I was assuming it'd have to either be done in one of the existing blocks (display panel, materializer?, proxy?) or by adding a new one.
I guess that inside the variable store would be one place that this could be correctly displayed (and this would be my suggested option, since that's where I'd expect most debugging to centre around).
@tekacs Do you specifically mean stringifying a chain of operations? Or simply displaying it in a nice way ingame?
What I have in mind for the advanced LP, is that it has a canvas on which operators can be visually chained together (possibly enhanced with IDE-like keyboard controls). This would already allow you to visually observe the operator chains. Other than that, this graph-based visualization would also be exportable (and importable) via JSON (or something similar).
So until this advanced LP arrives, perhaps a quick way for exporting the complete chain behind a variable as a string would be indeed nice for debugging. Adding this behaviour to a network-attached part would indeed be the only way of doing this.
IMO it's not worth the effort to spend time on this as a standalone feature, but I'd rather invest the effort in working towards an advanced LP.
https://www.gradlibrary.net/ this library looks like it'd fit the bill