anchor.diff:          diagnosticHandler: resilientDiagnosticHandler,
           outputProvider: outputProvider);
   
  -    if (!await compiler.compile(originalInput)) {
  -      print("Compilation failed");
  +    bool success = await compiler.compile(originalInput);
  +    sw.stop();
  +    if (success) {
  +      controller.add(
  +          new CompilerEvent(
  +              IncrementalKind.FULL, compiler, outputProvider.output, sw));
       } else {
  -      print('// Compiled JavaScript:');
  -      print(outputProvider['.js']);
  +      controller.add(
  +          new CompilerEvent(
  +              IncrementalKind.ERROR, compiler, outputProvider.output, sw));
       }
   
  -    int updateCount = 0;
       while (await watcher.hasChanges()) {
         try {
           Map<Uri, Uri> changes = watcher.readChanges();
   
  -        Stopwatch sw = new Stopwatch()..start();
  +        sw = new Stopwatch()..start();
           await compiler.compileUpdates(changes);
  +        sw.stop();
   
  -        String updates = '${compiler.allUpdates()}';
  +        controller.add(
  +            new CompilerEvent(
  +                IncrementalKind.INCREMENTAL, compiler, outputProvider.output,
  +                sw));
   
  -        sw.stop();
  -        print('// Patch after ${++updateCount} updates,');
  -        print('// computed in ${sw.elapsedMicroseconds/1000000} seconds:');
  -        print(updates);
  -      } on IncrementalCompilationFailed catch (error) {
  -        print("Incremental compilation failed due to:\n${error.reason}");
  +      } on IncrementalCompilationFailed catch (error, trace) {
  +        controller.addError(error, trace);
           break;
         }
       }
  
positive.code:   }
  
    while (true) {
      IncrementalCompiler compiler = new IncrementalCompiler(
          libraryRoot: libraryRoot,
          packageRoot: packageRoot,
  
negative.code:     }
    }
  }
  
  enum IncrementalKind {
    FULL,
    INCREMENTAL,
    ERROR,
  }
  
  class CompilerEvent {
    final IncrementalKind kind;
  
    final IncrementalCompiler compiler;
  
    final Map<String, String> _output;
  
    final Stopwatch stopwatch;
  
    CompilerEvent(this.kind, this.compiler, this._output, this.stopwatch);
  
    String operator[](String key) => _output[key];
  }
  