8 Matching Annotations
  1. Jul 2026
    1. I ported Kubernetes to the browser
      • Project Overview:
        • Named webernetes, it is a highly experimental, browser-based partial port of Kubernetes written in TypeScript, running entirely client-side without backend server components.
        • Developed at ngrok to provide a long-term, low-maintenance simulator for creating interactive and visual educational content about Kubernetes.
      • Architecture & Features:
        • Includes ports of core Kubernetes controllers (deployment, ReplicaSet, pod scheduler, and namespace) along with a partial port of the kubelet binary.
        • Features a simulated browser-based container network interface (CNI) for pod-to-pod communication over DNS/IP and a browser container runtime interface (CRI).
        • Avoids pulling massive images from registries like Docker Hub by utilizing a custom browser-based registry defined via a TypeScript API.
      • Why WebAssembly (Wasm) Was Not Used:
        • A simple "hello, world!" Go binary compiled to Wasm is ~540KiB gzipped, whereas the entire webernetes project is much lighter at ~140KiB gzipped.
        • Compiling the real Kubernetes codebase to Wasm failed due to compile-time errors from missing system-level APIs in the browser.
      • Development & LLM Challenges:
        • Around 90% of the code was translated line-for-line from the original Kubernetes Go source using LLMs, though the author had to strictly review every line.
        • LLMs consistently introduced errors such as cutting corners (e.g., replacing complex caches with a simple JavaScript Map), adding unrequested helper functions, and omitting cases in table tests.
      • Testing & Behavioral Parity:
        • To ensure lexical similarity translated to correct execution, hundreds of differential tests were written.
        • These tests validate behavioral parity by running the exact same client code against both webernetes and a real k3s cluster using the official kubernetes-client/javascript library.
  2. Jun 2026
    1. MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments.

      大多数人认为 MicroPython 仅适用于资源受限的微控制器环境,不适合复杂的沙盒实现。但作者认为 MicroPython 的精简特性和受限环境优化恰恰使其成为 WebAssembly 沙盒的理想选择,这一观点挑战了人们对 MicroPython 应用范围的普遍认知,展示了其在服务器端沙盒环境中的潜力。

    2. The great thing about working with WebAssembly is that if the C turns out to be fatally flawed the worst that can happen is the WebAssembly execution will fail with an exception.

      大多数系统程序员认为 C 代码中的错误可能导致严重的安全漏洞或系统崩溃。但作者认为在 WebAssembly 环境中,即使 C 代码存在致命缺陷,最坏情况也只是执行失败并抛出异常,这挑战了人们对 C 代码风险的传统认知,暗示 WebAssembly 提供了一种更安全的执行环境。

    3. Pyodide offers an outstanding package for running Python using WebAssembly in the browser, but using Pyodide in server-side Python isn't supported.

      大多数人认为 Pyodide 是在 WebAssembly 中运行 Python 的唯一或最佳选择,因为它在浏览器环境中表现出色。但作者明确指出 Pyodide 不支持服务器端 Python 使用,这挑战了人们对 Pyodide 适用范围的普遍认知,暗示需要寻找替代方案如 MicroPython 来实现服务器端的 WebAssembly Python 沙盒。

    4. WebAssembly is a _much better_ candidate. It was designed from the start to support all of the characteristics I care about and has been tested in browsers for nearly a decade.

      大多数人认为 JavaScript 引擎是沙盒环境的最佳选择,因为它们专门为执行不受信任的代码而设计。但作者认为 WebAssembly 是更好的选择,因为它从一开始就考虑了安全特性,并在浏览器环境中经过了近十年的测试。这与主流认知相悖,因为大多数开发者仍然倾向于使用 JavaScript 引擎来实现沙盒环境。

  3. Jan 2022
  4. Mar 2021
  5. Oct 2018