Dimensionality of program code (was: Exceptional coding style)

Era Scarecrow rtcvb32 at yahoo.com
Thu Jan 17 15:48:12 PST 2013


On Thursday, 17 January 2013 at 23:35:37 UTC, H. S. Teoh wrote:

> It's easy to represent in 2D or 3D a *simulation* of program 
> execution (I.e., a particular instance of execution), but how 
> do you represent concurrent program *logic*?
>
> For example, consider this: you have a program in which up to 5 
> threads may be running at the same time, and they access a 
> number of shared variables.  In order to fully capture the 
> semantics of the program (w.r.t. to concurrency), you'd have to 
> somehow depict *all possible interleavings* of the 5 threads, 
> including parallel executions. How would such a thing be 
> depicted in 2D or 3D?
>
> Furthermore, if you're going to be mapping degrees of freedom 
> in state space (which is essentially what you're doing if you 
> want to capture the interactions between simultaneous 
> cooperating components) into Euclidean space, then 3D is, in 
> general, going to be far too few dimensions to fully represent 
> the program. Non-trivial concurrent programs have far too many 
> degrees of freedom to capture in a mere handful of dimensions. 
> You'll need to be able to display (*and* visualize) spaces of 
> arbitrary dimensionality (anywhere from 4D to, say, 237D, or 
> 10423D for large projects) to be able to work with such a 
> programming model.

  I can only think that each thread would be a window (or 3d box), 
and have no immediate connections. Then you enable specific 
references of what you're interested in (sorta like the sorting 
vs container model where they are separated, make x sorters + y 
containers, not x*y combinations).

  If they get re-ordered based on what's selected/available then 
it would have to find the best fit to represent the connections 
between data, depending on how many blocks there are (VS table 
layout? Or similar to circuit boards) which then gives you a semi 
2d/3d view.

  If instead it say connects using wires showing certain 
connectivity (with id tags or something) then you just specify 
what variables, structures, or specific threads that are directly 
related (use one as a parent which then spreads out) and it hides 
the unneeded information until requested.

  But that's just how I see it with a debugger. Although I can 
dream it, I don't know if I could write it. Might get some game 
programmers to make the GUI interface.

  Hmmm programming and using a controller to navigate the views 
from the compiler/debugger...


More information about the Digitalmars-d mailing list