http://qs321.pair.com?node_id=11134390


in reply to Re^2: a look at Sub::Genius with the debugger, and use v in 2021
in thread a look at Sub::Genius with the debugger, and use v in 2021

Aldebaran, thanks for the kind words and welcome. I'll reply to a few things to get a handle on what direction you're heading.
The truth is that I don't get what goes wrong here, but I think I've framed where it happens. The scoping is hard for me to get my head around, but is it not the implementation of an AST?

The AST is only relevant when it comes to the construction of the DFA that is ultimately used to produce a single valid line of execution. Sub::Genius just takes what FLAT is able to generate as a string derived from the PRE (by way of an equivalent DFA). Are you trying to figure out how to go from the PRE to the DFA? An AST is involved in the conversion from the PRE to the PFA, but after that it is not involved at all.

Thank you for the pointer to the work of the Borweins, I am not a math guy but do enjoy reading about the subject and interesting people around it. Numerical errors notwithstanding, here are some suggestions that I think can help: Here's an example of running stubby to list all possible valid subroutine execution orderings:
$ stubby list -p "begin ( sub1 & sub2 & sub3 ) end" begin sub1 sub3 sub2 end begin sub1 sub2 sub3 end begin sub2 sub1 sub3 end begin sub2 sub3 sub1 end begin sub3 sub1 sub2 end begin sub3 sub2 sub1 end
Regarding perl's memory model, you may program all subroutines assuming that they can access: My contention is that using the right plan and correct use of the "memory" space, any implicitly shared memory algorithm may be implemented correctly. This remains to be seen, but that's my gut feeling. Note - everything is run sequentially in the perl runtime - thought, there is nothing stopping you from using fork; but that just gets us back to the realities of perl being fundamentally a uniprocess.
Hope that helps! Feel free to send me links to some stuff you've played with here - obviously, PM is not ideal for really swapping code. :-)