Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News LiveRun – Taking REPL One Step Sideways

LiveRun – Taking REPL One Step Sideways

Leia em Português

This item in japanese

REPL or Read-Eval-Print-Loop is an interesting way to write programs. Instead of doing it all at once, then running the results, you write it in fragments. Each fragment builds on the one before, with the environment never being reset like you would with a typical write-build-run cycle. For most .NET programmers, the only true REPL style coding you usually find is SQL.

Of course there is Edit-and-Continue in Visual Studio, but that is severely limited and there are numerous ways to "foul" the run and trigger the need for a full rebuild/restart. While you cannot just tack-on a REPL in .NET, there are still options for REPL-like functionality. Lucian Wischik shows this with his LiveRun add-in.

LiveRun will will pick up all the code in the current text window, compile it to a temporary location, then run it. After waiting two second, it will repeat the process. This is all done without interfering with the developer's train of thought.

So what is this good for? Well, primarily for writing demos in front of a live audience. Instead of constantly stopping to run the program, the audience can see effect of the changes in almost real time.

Lucian Wischik offers the full source for LiveRun on his blog.

Rate this Article