|
|
|
|
|
by alexkern
1598 days ago
|
|
Hey HN, Dynaboard founder here. Sharing a bit more about how we built Dynaboard, since I think this audience will appreciate it. More will be shared in future blogs :) Multiplayer: We used the YJS project (https://github.com/yjs/yjs) as the baseline for our multiplayer system. We created a thin harness around the client and ended up implementing our own server-side architecture to handle relaying between the various WebSocket servers. More on how we do this soon. WebAssembly: Rather than running your custom code in an iframe, we run it inside a wasm-based sandbox, a compiled version of the QuickJS VM (yes, it's JS-in-JS). This approach gives you synchronous access to most of the DOM APIs without sacrificing safety. We do some fancy ES6 Proxy management to implement the FRP-like data binding system inside the VM. In production, the browser runs the project's precompiled bytecode. In the future, we plan to support other languages with a similar architecture (Python via Pyodide, Rust, Go, etc.). Code editing: We use Monaco, the same editor that VS Code uses. We've had to create a handful of custom extensions, including a few custom language servers, to get it to be aware of the VM environment. I'm a vim-er so we will definitely have a vim mode. |
|
[1] https://dynaboard.com/images/screenshots/DynaHacker_News.png