REPLs
Introduction
My latent ADHD is manifesting as an intolerance for the slowness of the .NET inner loop, specially when reality is more like:
- Write some C# (fun)
- Build (not fun, MSBuild is 🐢)
- Run (kinda fun, but in reality this means getting your program to the right state which is repetitive and loses novelty after the first run)
- Debug (Bash your head onto your keyboard until you understand what’s wrong)
- Enlightenment 🔥
- Go to 1
To soothe myself, I will explore ways to improve it. I will even leave .NET to see what greener pastures are out there.
In my ideal world, programming does involve a REPL. I want to be able to:
- Start my long running program that waits for I/O (requests, clicks, key strokes, etc…)
- Redefine functions in the running program so that the program state in memory isn’t lost.
- Not have the program restart when a change is maded (at least most of the time, some changes do require a restart)
Most hot reload systems have an element of resarting the whole process, which defeats the purpose of it all.
Webpack Hot Module Reload
https://webpack.js.org/concepts/hot-module-replacement/
This is pretty good, though the way I have it set up will result in a page reload instead of a diff being applied when I edit my TypeScript React.
It does work for CSS, which makes editing stylesheets quite fun.
I do not know if its possible to make this not reload the page when code is changed.
C# Hot Reload
The list of edits that cause a program restart is quite large: https://github.com/dotnet/roslyn/blob/main/docs/wiki/EnC-Supported-Edits.md