Pete Vilter
@petevilter.me
110 followers 200 following 32 posts
Working on grid interconnection at Pearl Street Technologies. Prev databases and things at RelationalAI, Bubble, Cockroach. https://petevilter.me
Posts Media Videos Starter Packs
petevilter.me
Added wind and solar generators, which respond to wind and sun availability curves. As you edit those curves, the dispatch updates. (Need to work on the color coding to make the correspondences more clear)
petevilter.me
Here's a power grid simulator (mostly vibecoded), showing two generators being dispatched to satisfy load changing over time. The cheaper generator (blue region) is dispatched first; the more expensive one (pink region) only when needed.
petevilter.me
Nice. Are those datalog-based?
petevilter.me
React and TypeScript, with a REST API to a NodeJS backend where DuckDB is running.

My initial prompt to Claude was something like "I want to explore DuckDB data in a UI that looks like DataDog, with React and TypeScript" etc
petevilter.me
and of course the classics, 'filter to this value' and 'sort asc/desc'.

I lose my mind when table UIs don't have 'filter to this value' 😂
petevilter.me
you can also filter by clicking on the histograms, inspired by Datadog's log search UI
petevilter.me
Used Claude Code to vibecode a UI for @duckdb.org in a few days. Here it is navigating foreign keys
petevilter.me
are tarriffs going to send prices back up?
petevilter.me
Datadog up next?
petevilter.me
@peet.io I see you added support for taking profiles for JS a while ago: github.com/microsoft/vs... very cool!

Think there's a chance of getting this upstreamed to the main debug adapter protocol so other languages can implement it?
petevilter.me
whoops, that lock implementation had a bug — forgot to set holder back to null, messing up next acquire. now fixed gist.github.com/vilterp/bf02...
petevilter.me
If we make the client grab a lock around reading & writing the new balance, it's impossible to get a double spend:

the first client to acquire the lock wins; the next sees that there's not enough in the account.
petevilter.me
Distributed systems should feel like physical puzzles we can manipulate!

As an example, I modeled a bank in my simulator.

Without a lock, there's a race condition: if the two clients' gets and puts of the balance are interleaved, the same money can be withdrawn twice.
petevilter.me
I think the closest experience to what I'm looking for is Apple's Instruments or even the Chrome/Safari devtools, but a standardized protocol could really help the ecosystem flourish.

Tools like py-spy and memray have built fancy UIs for profile inspection, but each language/tool shouldn't have to.
petevilter.me
Could also be interesting to attach to running servers in the cloud or continuous profiling services.
petevilter.me
And VSCode would be free to visualize the data however it sees fit, e.g. in the debugger UI or by annotating source lines with a heatmap.
petevilter.me
As with LSP and DAP, each language runtime would be free to do it its own way.
petevilter.me
Different profile types, like CPU, memory allocation, contention, and blocking could be supported.
petevilter.me
Under the hood, this could look like VSCode saying to the process "profile yourself please" over the debugger protocol, and getting a stream of stack frames in response, each tagged with a thread ID.

Perhaps it could use the OTel profiling standard as inspiration: github.com/open-telemet...
github.com
petevilter.me
I wish @vscode.dev had richer & more standardized support for profiling; maybe a "Profiler Adapter Protocol" along the lines of the Debug Adapter Protocol and LSP.

When running a multithreaded program under the debugger, I want to see live CPU usage for each thread, and click to get a flame graph.