Skip to content

Instantly share code, notes, and snippets.

@snarkyboojum
Created April 20, 2010 14:47
Show Gist options
  • Save snarkyboojum/372557 to your computer and use it in GitHub Desktop.
Save snarkyboojum/372557 to your computer and use it in GitHub Desktop.
#!/usr/bin/alpha
use v6;
use Tardis;
use Yapsi;
my $program;
if @*ARGS == 2 && @*ARGS[0] eq '-e' {
$program = @*ARGS[1];
}
elsif @*ARGS == 1 {
$program = slurp @*ARGS[0];
}
else {
die "Usage: `$*PROGRAM_NAME <file>` or `$*PROGRAM_NAME -e '<program>'`";
}
my Yapsi::Compiler $c .= new;
my Tardis::Debugger $d .= new;
try {
say "# Compiling '-e'...";
my @sic = $c.compile($program);
@sic.join("\n").say;
say "# Running...";
# TODO: waiting for masak++ Yapsi runtime hooks
$d.run(program => @sic);
}
say $! if $!;
my $current-tick = 0;
my @ticks = $d.ticks;
say "# Finished. Ticks: 0..", @ticks.end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment