LecturaInvestigaciónRadar
Marco de inversión
Iniciar sesión / Registrarse
← Volver a la lectura
NoticiasTema · 跨端开发规则复用Material4 min de lecturaEditorial de DisconfirmAI

Independent Developer Tw93: In the AI Era, What Is Truly Reusable Across Platforms Is Not Code, But Rules

Shao Shu Pai author Tw93 discovered while developing the Windows version of Mole that less than 20% of its over 100,000 lines of Swift code could be reused outside macOS frameworks, leading him to rewrite it almost entirely from scratch using C# and WinUI 3. He proposes a key judgment: AI has significantly lowered the efficiency costs of native development for each platform; the cross-platform synchronization layer worth maintaining is no longer code abstraction, but design tokens, copywriting, and rules established after encountering pitfalls.

2026-11-04 20:25 GMT+8

Tw93 is an author at Shao Shu Pai (sspai), having developed several desktop tools including Mole, Kaku, Pake, and MiaoYan. In November 2026, he published a long-form article detailing his entire process of developing Windows software on a Mac. His core conclusion is that in today's era where AI writing code is no longer a bottleneck, what truly needs to be reused in cross-platform development is not code, but rules.

This judgment stems from a specific engineering fact. The Mac version of Mole was written in Swift and SwiftUI, comprising over 100,000 lines of code. Tw93 initially intended to reuse as much of this code as possible for the Windows version. However, after analyzing it with AI, he found that less than 20% of the code could function independently of macOS system frameworks like AppKit and SwiftUI. The remaining logic heavily relied on macOS-unique path rules such as ~/Library, making it largely unusable. Consequently, the Windows version was written almost entirely from scratch.

Since the code itself could not be reused, how did he maintain consistency between the two platforms? Tw93's approach was to shift the synchronization layer upward to design rules and decision records. He took the design tokens—colors, font sizes, spacing, and corner radii—written in Swift for the Mac version and used a script to directly generate them as XAML resources for Windows. Copywriting in 11 languages was converted from the Mac's multi-language file format to the Windows format. Even the runner animation in the menu bar was synchronized using the same script. On the functional level, he maintained a SYNC.md file as a reconciliation ledger. For every new feature added or security issue fixed in the Mac version, the Windows side clearly marked which items were implemented, which were intentionally different, which were inapplicable, and why those judgments were made. Each synchronization also recorded the corresponding Mac commit to prevent the two versions from diverging if the AI went off track.

He summarized this experience into a judgment: As times change, so-called code abstraction becomes less important, whereas rule abstraction becomes more critical. Design, copywriting, and various rules established after encountering pitfalls constitute the 'capability abstraction layer' that AI is truly adept at. Underlying code can be written separately for each platform without forcing a compatibility layer to smooth things out, which would only add complexity. Instead, what can be reused are the designs, copywriting, and rules.

The feasibility of this method relies on the premise that AI has drastically reduced the efficiency costs of native development. Tw93's workflow kept all code and AI context on the Mac, using Claude Code for coding. Windows was used solely for compilation and verification, running via Parallels Desktop virtual machine, with the repository mounted as a shared folder. For scenarios where the VM could not accurately test (such as high-DPI screens, battery usage, and SmartScreen blocking), he verified them on a physical ThinkPad X1 Carbon. This machine was set to never sleep, allowing the agent to run regression tests 24 hours a day. Ultimately, he wrote over 80,000 lines of Windows code and created more than 4,000 tests in one month.

He also adjusted the architecture to support this: Mole for Windows is divided into four layers. The bottom Core layer depends only on .NET and does not touch any Windows interfaces; cleanup rules and path security checks are placed here, using a simulated memory file system based on Windows path rules for testing, allowing it to run well on the Mac. Above that is the Platform layer, which houses registry access, file systems, and Win32 calls; with EnableWindowsTargeting turned on, this layer can also compile on the Mac. Next is the ViewModel layer, which corresponds one-to-one with the Mac version. Only the top WinUI interface layer must be compiled on Windows. The lower the layer, the less it touches Windows, and the more code can be verified on the Mac.

However, it should be noted that Tw93 declared a direct conflict of interest with the products mentioned in the article at the beginning. His conclusions naturally lean toward validating his choice of native development. Furthermore, the premise of writing 80,000 lines of code in a month is that he is proficient in both platforms, has years of client-side development experience, and deeply uses AI coding tools. For teams lacking these conditions, or for scenarios where business logic is highly shared (such as Kotlin Multiplatform solutions), cross-platform frameworks remain a more pragmatic choice. His judgment is more applicable to independent developers or small teams pursuing the best experience on each platform with AI assistance.

Fuentes

  • sspai.com少数派 - 高品质数字消费指南↗
Tema

跨端开发规则复用

【背景】在 AI 辅助编程大幅降低原生开发成本的当下,跨端开发的“复用”定义正在发生根本性转移:从共享底层代码逻辑转向共享上层设计规则与规范。

3 pasos1 piezasActualizado 2026-11-05 10:10

Cómo llegó hasta aquí

  1. 2026-11-05Tw93 发布文章《你不知道的客户端开发》,披露 Mole Windows 版开发细节:因 Swift 代码复用率低于 20%,改用 C#/WinUI 3 重写,并通过脚本同步设计 Token 和文案实现一致性。sspai.com ↗
  2. 2025-10-01W3C 设计令牌规范达到 v1.0 版本,加速了“代码即真相源”的设计系统转型,使得 GitHub、Shopify 等团队能够更严格地以代码库为准同步多端表现。github.com ↗
  3. 2024-01-01Brad Frost 提出 AI 在设计系统中的六大用例,包括组件代码生成和跨框架翻译,指出 AI 虽能提升效率,但输出仍需人工审查,且设计令牌是控制 AI 生成质量的关键锚点。github.com ↗

Lo que aún está pendiente

  • 在缺乏统一行业标准的情况下,如何确保不同团队间“规则文件”(如 SYNC.md 或 JSON Token)的兼容性与可迁移性?
  • 当 AI 生成的代码出现“幻觉”导致逻辑错误时,现有的自动化测试体系能否有效拦截这些“垃圾手榴弹”(Slop Grenades)而不依赖大量人工复核?
  • 对于中小型团队,完全放弃跨端框架而采用“规范驱动+各端原生”的模式,其长期维护成本是否真的大于使用 Electron 或 Flutter 等传统方案?
Leer el tema completo →
Continuar investigando →
Iniciar sesión / Registrarse
LecturaInvestigaciónRadarMarco de inversión