How we built a VS Code Extension with Rust, WebAssembly, and TypeScript
In this technical retrospective (2022), @thunderbong shares practical architectural lessons learned from running, scaling, or migrating production software under lean constraints.
Core Principles for Independent Builders:
Defaulting to simpler architectures (such as monolithic frameworks, SQLite, or managed VPS) prevents early engineering bankruptcy.
Evaluating true compute and egress costs reveals that high cloud bills can often be slashed by 80%+ through judicious re-platforming.
Code you write at 2 AM as a solo engineer must be easy to debug six months later without complex microservice dependencies.
Community Debate Themes:
HN engineers debated the tradeoffs between cloud convenience and raw server economics, database indexing strategies, and resisting premature architectural complexity.
CATEGORY Frugal Engineering →
HISTORICAL ERA Pandemic Bubble (2020–2022)
COMMUNITY SCORE 167 points
TOTAL DISCUSSIONS 19 comments
I have written several VSCode extensions using Rust so this was quite interesting.
This is how I currently do it, but I agree it is not ideal. Wasm is a nicer solution.
I definitely agree. Async is way over-used in Rust land. That said, it wasn't that hard to use tower-lsp. It's pretty well designed.
Does this mean that it's more difficult to use the LSP from anything except VSCode?
I think the solution I would go for is probably to compile my language server with Wasmtime, bundle Wasmtime for every platform I support and then just run it through that. Then I don't have to cross-compile my Rust code, but it's still a fully featured language server on its own.
This article is super insightful, I believe more and more extensions will be taking this approach.
At Wasmer we are planning to do the something similar for the VS Code WASM extension [1]. Right now it uses wabt.js (wabt compiled to Wasm + js bindings with Emscripten), but there are some more interesting ways to approach automatic bindings via Interface Types... here are some prototypes! [2]
[1] https://marketplace.visualstudio.com/items?itemName=dtsvet.vscode-wasm ↗
[2] https://github.com/wapm-packages/wabt/ ↗
For anybody interested in more examples, you can take a look at the Prisma VS Code extension. It was originally written 100% in TypeScript, but as most of our tooling is in Rust, we have started to move pieces over to Rust via wasm: https://www.prisma.io/blog/vscode-extension-prisma-rust-webassembly ↗
That is interesting. Is it that much complexity when using async Rust?
Great article and thank you for sharing it!
They are mentioning that LSP will open a door to port the functionality to IntelliJ. There's no native support for LSP in IntelliJ as far as I am aware. Wondering how did they plan the port to IntelliJ when the time comes?