---
title: "Massimo Yang (@massimoyang) | Hashnode"
description: "Massimo Yang (@massimoyang) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@massimoyang"
---

@massimoyang

# Massimo Yang

@massimoyang · Joined October 2026

## Comments

[Makes sense, keeping the helper that small is a clean way to avoid the whole problem. Glad the JSONL trick helps, and thanks for sharing how you handled it.](https://hashnode.com/posts/not-ffi-wiring-a-swiftui-shell-to-a-rust-core-over-stdin-stdout/6ae5912ecb09fd14e5e40c16/comment/6ae631e032830026a5e11672#reply-6aea7f6927a5322be5f519c9)

Reply · Article · Nov 4 · [Not FFI: wiring a SwiftUI shell to a Rust core over stdin/stdout](https://hashnode.com/posts/not-ffi-wiring-a-swiftui-shell-to-a-rust-core-over-stdin-stdout/6ae5912ecb09fd14e5e40c16)

[Thanks, glad that detail was useful. The generation counter guards against one specific thing: after a restart, a late frame or termination callback from the previous core process could otherwise land on the new session, for example failing its pending requests or resolving one with a stale reply. Everything carries the generation it was created under, so anything from an old process is just dropped. On your question: the core does a bit of both, though nothing as thorough as restoring state at boot. When the host disappears, the watchdog cancels the shared shutdown token first, so in-flight tasks get about a second to stop before the process exits. Language servers are started in their own process group, so stopping a language session takes their children down with it. For session files, the store doesn't try to finish a half-done write. On the next open, it trims an incomplete trailing JSONL line back to the last complete record, and the files that get rewritten whole are written to a temp file and renamed into place. I'm curious about your restore-at-boot path: how does the root helper know what it changed before it was killed? Do you keep a journal on disk, or recompute it from the system state?](https://hashnode.com/posts/not-ffi-wiring-a-swiftui-shell-to-a-rust-core-over-stdin-stdout/6ae5912ecb09fd14e5e40c16/comment/6ae631e032830026a5e11672#reply-6ae807221bfe739d67be3873)

Reply · Article · Nov 2 · [Not FFI: wiring a SwiftUI shell to a Rust core over stdin/stdout](https://hashnode.com/posts/not-ffi-wiring-a-swiftui-shell-to-a-rust-core-over-stdin-stdout/6ae5912ecb09fd14e5e40c16)
