正在加载视频...

视频加载失败

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.

113,665 次观看 • 7 天前 •via X (Twitter)

44 条评论

Patrick Smith 的头像
Patrick Smith7 天前

GitHub:

Adam Dymitruk 的头像
Adam Dymitruk6 天前

Everything needs event sourcing by default.

Santiago Pablo Ortiz 的头像
Santiago Pablo Ortiz6 天前

This is awesome man

👼🏿 的头像
👼🏿7 天前

so blinkenlights @jartine made but without its aesthetics?

Aarav Dayal 的头像
Aarav Dayal6 天前

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

Patrick Smith 的头像
Patrick Smith6 天前

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

Aarav Dayal 的头像
Aarav Dayal6 天前

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?

Patrick Smith 的头像
Patrick Smith6 天前

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.

Aarav Dayal 的头像
Aarav Dayal5 天前

"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.

RandomYang 的头像
RandomYang6 天前

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

TG 的头像
TG7 天前

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.

Patrick Smith 的头像
Patrick Smith5 天前

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

ibuki 的头像
ibuki6 天前

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

LinuxVersion 的头像
LinuxVersion7 天前

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)

Patrick Smith 的头像
Patrick Smith7 天前

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.

ricochet 的头像
ricochet7 天前

love this!

Preyforge 的头像
Preyforge6 天前

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.

Shang Yuzu 的头像
Shang Yuzu7 天前

j’ai pas lu la notice.

Multiple Systems 的头像
Multiple Systems6 天前

why is it important how fast ghostty is?

Francois Laberge 的头像
Francois Laberge7 天前

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.

Mykhailo Kulak 🇺🇦 的头像
Mykhailo Kulak 🇺🇦6 天前

This is cool!

mfpaintr 的头像
mfpaintr6 天前

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

deus 的头像
deus7 天前

cool

Nilo Stolte, PhD 🍁⚙️ 的头像
Nilo Stolte, PhD 🍁⚙️6 天前

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?

Patrick Smith 的头像
Patrick Smith6 天前

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.

Nilo Stolte, PhD 🍁⚙️ 的头像
Nilo Stolte, PhD 🍁⚙️6 天前

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.

Patrick Smith 的头像
Patrick Smith6 天前

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.

Nilo Stolte, PhD 🍁⚙️ 的头像
Nilo Stolte, PhD 🍁⚙️6 天前

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:

Hi O'laverly 的头像
Hi O'laverly6 天前

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

Jarno 的头像
Jarno6 天前

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

allOS.dev - Creating Cross-Platform Apps 的头像
allOS.dev - Creating Cross-Platform Apps7 天前

So cool! Following!

hardikxk 的头像
hardikxk7 天前

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

Patrick Smith 的头像
Patrick Smith6 天前

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

hardikxk 的头像
hardikxk6 天前

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

ø 的头像
ø7 天前

This is the way...

William Selby 的头像
William Selby6 天前

Okay this is so sick? Is it on Github?

Patrick Smith 的头像
Patrick Smith6 天前

Thanks! Yes it is:

sshpie 的头像
sshpie6 天前

That's cool

Dylanger Daly 的头像
Dylanger Daly6 天前

Yummy

Yeab - engg / core was in Palo Alto🌴 的头像
Yeab - engg / core was in Palo Alto🌴7 天前

cool

Nawid 的头像
Nawid7 天前

Fantastic

keshen 的头像
keshen6 天前

what if your program did a side effect

kiby3x 的头像
kiby3x7 天前

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

Valentyn Kit 🦀 | Rust · Solana 的头像
Valentyn Kit 🦀 | Rust · Solana7 天前

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

相关视频