i've wanted a proper notebook for C# for a long time now. Polyglot Notebooks is fine but I kept wishing for 2 things. cells that re-run when something they depend on change, and a file i could just open in any editor and actually read
so I built it lol. its called Reverb, open source (MIT) and the VS Code extension is out today
what is it
a notebook is just a normal .cs file. you separate cells with // %% comments like this:
csharp
// %%
var sales = LoadSales("data/sales.csv");
// %%
var byRegion = sales.GroupBy(s => s.Region)
.Select(g => new { Region = g.Key, Revenue = g.Sum(s => s.Amount) });
Display(byRegion);
edit the first cell and second one re-runs on its own, kinda like a spreadsheet. It uses Roslyn to analyse your code and figure out what depends on what so you dont have to wire anything
also because its just a .NET 10 file based app this works too with only the SDK:
dotnet run sales-explorer.cs
no Reverb install needed. I have CI checking this on every build because i didnt want it to be one of those claims that quitely stops being true after some time
in VS Code
notebooks open as native VS Code notebooks (normal cells, run buttons, outputs) but with the reactive engine underneath. you also get
- charts, tables and interactive widgets like sliders in the output
- dependency view so you can see which cell feed which
- quick fixes for common issues
- packages view for nuget references
- lazy mode - it marks dependents stale instead of re running them, good for the expensive cells
it talks to the reverb tool over stdin/stdout so it dont open any network port. and if the folder is not trusted it wont start a kernel or restore packages
try it
where its rough
its still young (0.2.x). only vs code for now, havent done open VSX/VSCodium yet. I tested on windows, macOS and linux but im sure you guys will find stuff i didn't. bug reports and "this is confusing" feedback is honestly the most useful thing you can give me
would love to hear what you'd want from a C# notebook :)