Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I drop into the Perl 6 REPL inside a program?

Tags:

debugging

raku

Is there a way that I can single step through part (or all) of a Perl 6 program? I expected that there would be a -d, but of course there is not:

% perl6 -d test.p6

I thought perhaps eval-ing the file, but that does the whole thing at once:

% perl 6
> EVALFILE 'test.p6'

As I expected, that just runs the entire file.

I suspect someone hasn't implemented this sort of thing. Is there some way I can hook into the runtime to insert actions between statements and so on? In Perl 5 land, that would be the DB class.

Aside from that, does Perl 6 work with any general debuggers? If I were using the JVM backend, would it even make sense to use a Java tool (or is it gibberish by that point)?

like image 728
brian d foy Avatar asked Oct 17 '22 08:10

brian d foy


1 Answers

I started working on this problem as one of the features of LREP. I haven't worked on it for a while, so not sure how well it still works. Since the last time I worked on LREP, we've done a lot of cleanup on the internal REPL–I hope to modify LREP to work more cleanly and add in debugger features.

like image 67
awwaiid Avatar answered Nov 15 '22 08:11

awwaiid