anchor.diff:    var env = new FileEnvironment(file);
   
     if (opts["compile"] != null) {
  -    var name = opts["compile"];
  -    CompilerTarget target;
  -
  -    if (name == "ast") {
  -      target = new AstCompilerTarget();
  -    } else if (name == "js") {
  -      target = new JsCompilerTarget();
  -    } else if (name == "badger") {
  -      target = new BadgerCompilerTarget();
  -    } else if (name == "tiny-ast") {
  -      target = new TinyAstCompilerTarget();
  -    } else if (name == "snapshot") {
  -      target = new SnapshotCompilerTarget(env);
  -    } else if (name == "dart") {
  -      target = new DartCompilerTarget();
  +    if (externalCompilers.any((it) => it.name == opts["compile"])) {
  +      var c = externalCompilers.firstWhere((it) => it.name == opts["compile"]);
  +      var f = file;
  +      if (c.provideAst) {
  +        tmpDir = await Directory.systemTemp.createTemp("badger");
  +        f = new File("${tmpDir.path}/ast.json");
  +        await f.writeAsString(JSON.encode(await env.generateJSON()));
  +      }
  +
  +      var cmd = c.command.split(" ");
  +
  +      cmd.addAll(opts["compiler-opt"].map((it) => "-O${it}"));
  +      cmd.add(f.path);
  +
  +      var cm = cmd[0];
  +      var args = cmd.skip(1).toList();
  +      try {
  +        var proc = await Process.start(cm, args);
  +        proc.stdout.listen((x) => stdout.add(x));
  +        proc.stderr.listen((x) => stderr.add(x));
  +        stdin.pipe(proc.stdin);
  +        var code = await proc.exitCode;
  +        await tmpDir.delete(recursive: true);
  +        exit(code);
  +      } catch (e) {
  +        await tmpDir.delete(recursive: true);
  +        rethrow;
  +      }
       } else {
  -      print("Unknown Compiler Target: ${name}");
  -      exit(1);
  +      var name = opts["compile"];
  +      CompilerTarget target;
  +
  +      if (name == "ast") {
  +        target = new AstCompilerTarget();
  +      } else if (name == "js") {
  +        target = new JsCompilerTarget();
  +      } else if (name == "badger") {
  +        target = new BadgerCompilerTarget();
  +      } else if (name == "tiny-ast") {
  +        target = new TinyAstCompilerTarget();
  +      } else if (name == "snapshot") {
  +        target = new SnapshotCompilerTarget(env);
  +      } else if (name == "dart") {
  +        target = new DartCompilerTarget();
  +      } else {
  +        print("Unknown Compiler Target: ${name}");
  +        exit(1);
  +      }
  +
  +      var o = opts["compiler-opt"];
  +      var optz = {};
  +
  +      for (var i in o) {
  +        var split = i.split("=");
  +
  +        if (split.length == 1) {
  +          optz[split[0]] = true;
  +        } else {
  +          var key = split[0];
  +          var value = split.skip(1).join("=");
  +
  +          if (value == "true" || value == "false") {
  +            optz[key] = value == "true";
  +            continue;
  +          }
  +
  +          try {
  +            value = num.parse(value);
  +
  +            optz[key] = value;
  +          } catch (e) {}
  +
  +          optz[key] = value;
  +        }
  +      }
  +
  +      target.options = optz;
  +
  +      target.options.putIfAbsent("isTestSuite", () => opts["test"]);
  +
  +      var program = await env.parse();
  +      print(await target.compile(program));
  +      exit(0);
       }
  -
  -    var o = opts["compiler-opt"];
  -    var optz = {};
  -
  -    for (var i in o) {
  -      var split = i.split("=");
  -
  -      if (split.length == 1) {
  -        optz[split[0]] = true;
  -      } else {
  -        var key = split[0];
  -        var value = split.skip(1).join("=");
  -
  -        if (value == "true" || value == "false") {
  -          optz[key] = value == "true";
  -          continue;
  -        }
  -
  -        try {
  -          value = num.parse(value);
  -
  -          optz[key] = value;
  -        } catch (e) {
  -        }
  -
  -        optz[key] = value;
  -      }
  -    }
  -
  -    target.options = optz;
  -
  -    target.options.putIfAbsent("isTestSuite", () => opts["test"]);
  -
  -    var program = await env.parse();
  -    print(await target.compile(program));
  -    exit(0);
     }
   
     await env.eval(context);
  
positive.code:     await tmpDir.delete(recursive: true);
    }
  }
  
negative.code: Directory tmpDir;
  
  main(List<String> args) async {
    await loadExternalCompilers();
  
    var argp = new ArgParser();
    argp.addFlag("test",
        negatable: false,
        abbr: "t",
        help: "Runs the script in a testing environment.");
  
    argp.addOption("compile",
        abbr: "c",
        allowed: ["tiny-ast", "ast", "js", "badger", "snapshot", "dart"]..addAll(externalCompilers.map((it) => it.name).toList()),
        help: "Compiles Badger Code");
  
    argp.addOption("compiler-opt",
        abbr: "O", help: "Specifies a Compiler Option", allowMultiple: true);
  
    var opts = argp.parse(args);
  
  