So I was curious as to whether or not there were limits to the levels, or the type-name size for Perl6, and I wrote this script.
252 levels and 4299 characters in, I hit the shell limit.
I know how this can be fixed. Instead of writing one script per level, I need to write two.
If you're interested, here's the broken code. I'll keep this updated as progress allows:
use v6.c;
my @a = ('A'...'Z', 'a'...'z').flat;
my @names;
my $libdir = 'T';
mkdir $libdir unless $libdir.IO.d;
loop {
my ($name, $use-line) = ( (@a.pick xx 15).join );
my $fio-p = $libdir.IO;
$fio-p .= add($_) for @names;
( my $fio-d = $fio-p ) .= add($name);
mkdir $fio-d.absolute;
my $mod = "{ @names.join('::') }{ '::' if @names }{ $name }";
$use-line = "use { @names.join('::') };" if @names;
$fio-p .= add($name ~ '.pm6');
$fio-p.spurt: qq:to/FILE/;
{ $use-line // '' }
class { $mod } { "is { @names.join('::') } " if @names } \{ \}
FILE
# Now, attempt to use $name via external calal to perl6
$*ERR.say: "Testing $mod --- { @names.elems } / { $mod.chars }...";
my $proc = run
<perl6 --stagestats -I>, $libdir, '-e',
"use $mod";
last if $proc.exitcode;
@names.push: $name;
}