Created
April 20, 2010 14:47
-
-
Save snarkyboojum/372557 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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