Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

My WebAssembly debugger lets you time-travel with your scroll wheel. WebAssembly (and Ghostty) are so fast that a step back just reruns from scratch.

119,645 Aufrufe • vor 1 Monat •via X (Twitter)

44 Kommentare

Profilbild von Patrick Smith
Patrick Smithvor 1 Monat

GitHub:

Profilbild von Adam Dymitruk
Adam Dymitrukvor 1 Monat

Everything needs event sourcing by default.

Profilbild von Santiago Pablo Ortiz
Santiago Pablo Ortizvor 1 Monat

This is awesome man

Profilbild von 👼🏿
👼🏿vor 1 Monat

so blinkenlights @jartine made but without its aesthetics?

Profilbild von Aarav Dayal
Aarav Dayalvor 1 Monat

What is the optimization? Keeping the diff of the memory for each instruction stepping? Because how will you unexecute an instruction usually?

Profilbild von Patrick Smith
Patrick Smithvor 1 Monat

The optimization is to make it fast enough that I just replay everything to “unexecute”.

Profilbild von Aarav Dayal
Aarav Dayalvor 1 Monat

No I mean how do you capture all of it such that it does not take gigabytes of memory to record a program's execution?

Profilbild von Patrick Smith
Patrick Smithvor 1 Monat

What do you need gigabytes for? There’s an interpreter. A step forward executes the next instruction. A step back executes all the instructions from the beginning up to the previous step. The speed is what allows that to feel instant. There’s no capturing and no caching.

Profilbild von Aarav Dayal
Aarav Dayalvor 1 Monat

"A step back executes all the instructions from the beginning up to the previous step." Oh so this is the tradeoff. Thank you lmao. This is what I wanted to know.

Profilbild von RandomYang
RandomYangvor 1 Monat

It’s fascinating that program execution accumulates state, so stepping back means replaying from the start up to step n-1.

Profilbild von TG
TGvor 1 Monat

I have wanted this, so very many times. Also video like controls would be good with speed options to debug in real time. Play, Stop, SlowMo, Step.

Profilbild von Patrick Smith
Patrick Smithvor 1 Monat

I’ve created a free Discord community for everything QIP, the wasm component system behind this:

Profilbild von ibuki
ibukivor 1 Monat

Wasmは純粋な計算だけだから再実行って手段が実現できるのか

Profilbild von LinuxVersion
LinuxVersionvor 1 Monat

I assume you will make snapshots periodically to simulate forward from instead of time traveling from the start for long running programs (and diff the snapshots to only store changes)

Profilbild von Patrick Smith
Patrick Smithvor 1 Monat

No snapshots in this demo. I expect for larger wasm components I’ll have to add some snapshotting but I’ll measure exactly where that line is.

Profilbild von ricochet
ricochetvor 1 Monat

love this!

Profilbild von Preyforge
Preyforgevor 1 Monat

time-travel debugging is such a good use of the interface. i keep runs interruptible so the human can take the mouse when the path gets weird; observability should make that handoff easier, not ceremonial.

Profilbild von Shang Yuzu
Shang Yuzuvor 1 Monat

j’ai pas lu la notice.

Profilbild von Multiple Systems
Multiple Systemsvor 1 Monat

why is it important how fast ghostty is?

Profilbild von Francois Laberge
Francois Labergevor 1 Monat

I was surprised how well for shortish recordings of another app just replaying up to playhead sufficed. Wasn't even in webassembly. This looks great.

Profilbild von Mykhailo Kulak 🇺🇦
Mykhailo Kulak 🇺🇦vor 1 Monat

This is cool!

Profilbild von mfpaintr
mfpaintrvor 1 Monat

Cool, but why a terminal? Debugging is about visualizing what is happening. A GUI can provide a much better experience.

Profilbild von deus
deusvor 1 Monat

cool

Profilbild von Nilo Stolte, PhD 🍁⚙️
Nilo Stolte, PhD 🍁⚙️vor 1 Monat

This is petty cool! My question isn't directly related to WebAssembly, but to Ghostty. How is your overall experience with Ghostty going so far? How long you've been using it?

Profilbild von Patrick Smith
Patrick Smithvor 1 Monat

Ghostty is really nice! I previously just used the built-in macOS Terminal so I want something simple. It’s the split panes and modern rendering that I really appreciate.

Profilbild von Nilo Stolte, PhD 🍁⚙️
Nilo Stolte, PhD 🍁⚙️vor 1 Monat

I've seen your demo for qip, a chronometer that uses canvas and fonts to render the numbers. I'm curious about the language that you used for this piece. I suppose you didn't write WebAssembly directly.

Profilbild von Patrick Smith
Patrick Smithvor 1 Monat

Yes that example is in Zig. I’m using the Codex coding agent, first I’ve made an Inter font lib, then iteratively made this example. I’m sure the code could have many improvements, but it’s pretty vanilla imperative code.

Profilbild von Nilo Stolte, PhD 🍁⚙️
Nilo Stolte, PhD 🍁⚙️vor 1 Monat

I checked how you rendered the "glyphs" and I saw it's bitmap. I thought your were dealing with real vector glyphs. Also the program is quite long. Check my vector clock in Java. It's simpler:

Profilbild von Hi O'laverly
Hi O'laverlyvor 1 Monat

Oh, nice. I'm going to have to take a look at that.

Profilbild von Jarno
Jarnovor 1 Monat

Debugging by rewinding time instead of adding print statements. Perfect.

Profilbild von allOS.dev - Creating Cross-Platform Apps
allOS.dev - Creating Cross-Platform Appsvor 1 Monat

So cool! Following!

Profilbild von hardikxk
hardikxkvor 1 Monat

Btw does also it work for WAT files or just anything that compiles to wasm?

Profilbild von Patrick Smith
Patrick Smithvor 1 Monat

Is wat files something you’d be authoring? I’d suggest using wat2wasm

Profilbild von hardikxk
hardikxkvor 1 Monat

Had been exploring wat as of late with wat2wasm but yes it is a pain to write wat files over simply using JS or c++ even

Profilbild von ø
øvor 1 Monat

This is the way...

Profilbild von William Selby
William Selbyvor 1 Monat

Okay this is so sick? Is it on Github?

Profilbild von Patrick Smith
Patrick Smithvor 1 Monat

Thanks! Yes it is:

Profilbild von sshpie
sshpievor 1 Monat

That's cool

Profilbild von Dylanger Daly
Dylanger Dalyvor 1 Monat

Yummy

Profilbild von Yeab - engg / core was in Palo Alto🌴
Yeab - engg / core was in Palo Alto🌴vor 1 Monat

cool

Profilbild von Nawid
Nawidvor 1 Monat

Fantastic

Profilbild von keshen
keshenvor 1 Monat

what if your program did a side effect

Profilbild von kiby3x
kiby3xvor 1 Monat

how does that work calling JS functions that aren't pure?

Profilbild von Valentyn Kit 🦀 | Rust · Solana
Valentyn Kit 🦀 | Rust · Solanavor 1 Monat

"reruns from scratch" being fast enough to feel like a rewind is the whole trick.

Ähnliche Videos