Live Programming
Whenver I'm prototyping something new, I tend to create these three files, program.c, build.bat, and watch.bat
program.c contains the actual program that I'm prototyping.
build.bat contains the command that builds and runs program.c. For a simple C program it can be something like
clang test.c && a.exe
watch.bat is the heart of this setup. It uses watchexec to compile and run the program whenever it changes. It usually looks like
watchexec -c -r -w program.c build.batWith this setup, whenever program.c changes, watchexec clears the console; shuts down the running program; recompiles it; then runs it again.
Here is how the setup looks like in action