Skip to content

wangnaihe/w3cos

W3C OS

CI Build ISO License Rust

An AI-native operating system built on W3C standards. TypeScript + DOM compiled to native binaries. No browser. No V8.

W3C OS Demo

app.ts  β†’  w3cos build  β†’  native binary (2.4 MB)

What is this?

W3C OS is a Linux-based operating system where:

  • Applications use standard W3C DOM + CSS (the same APIs as the Web)
  • TypeScript is compiled to native machine code via Rust/LLVM (not interpreted)
  • AI agents can read and operate every UI element directly through the DOM β€” no screenshot guessing
  • The system boots from a minimal Linux kernel directly into the W3C OS Shell

Write Web-standard code. Get native performance. Give AI full visibility.

Quick Start

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Clone and build
git clone https://github.com/wangnaihe/w3cos.git
cd w3cos
cargo build --release

# Compile a TypeScript app to a native binary
./target/release/w3cos build examples/showcase/app.tsx -o showcase --release
./showcase    # Opens a native window β€” no browser involved

Example

TSX Syntax (recommended)

// app.tsx β€” a native application written in TSX
import { Column, Text, Button } from "@w3cos/std"

export default
<Column style={{ gap: 20, padding: 48, alignItems: "center", background: "#0f0f1a" }}>
  <Text style={{ fontSize: 42, color: "#e94560" }}>W3C OS</Text>
  <Text style={{ fontSize: 20, color: "#a0a0b0" }}>Native binary from TSX.</Text>
  <Button style={{ background: "#e94560", borderRadius: 8 }}>Get Started</Button>
</Column>

Function Syntax

// app.ts β€” alternative function-call syntax
import { Column, Text, Button } from "@w3cos/std"

export default Column({
  style: { gap: 20, padding: 48, alignItems: "center", background: "#0f0f1a" },
  children: [
    Text("W3C OS", { style: { fontSize: 42, color: "#e94560" } }),
    Text("Native binary from TypeScript.", { style: { fontSize: 20, color: "#a0a0b0" } }),
    Button("Get Started", { style: { background: "#e94560", borderRadius: 8 } }),
  ]
})
$ w3cos build app.tsx -o myapp --release
⚑ Transpiling TS β†’ Rust... done
πŸ”¨ Compiling native binary... done
βœ… Output: ./myapp (2.4 MB)

Why?

Electron React Native Flutter W3C OS
Binary Size 90+ MB 30+ MB 15+ MB 2.4 MB
RAM Usage 200+ MB 100+ MB 80+ MB ~15 MB
Startup 2-5 sec 1-3 sec 0.5-2 sec < 100ms
Language JS (V8 JIT) JS (Hermes) Dart (AOT) TS (native AOT)
Runtime Chromium Bridge + Native Dart VM None
DOM API βœ… (browser only) ❌ ❌ βœ… (system-wide)
AI reads UI Screenshot Screenshot Screenshot DOM tree (< 1ms)
Standard Proprietary Proprietary Proprietary W3C
Installable OS ❌ ❌ ❌ βœ…

AI-Native: Why This Matters

Traditional operating systems are opaque to AI β€” an AI agent must take screenshots and guess what's on screen (slow, expensive, fragile).

W3C OS applications are built with the DOM. AI agents read the DOM tree directly:

Traditional OS:  AI sees pixels β†’ vision model β†’ guess UI β†’ click coordinates (1-3 sec, $$$)
W3C OS:          AI reads DOM  β†’ structured tree β†’ precise action (< 1ms, free)

Three access levels for AI agents:

  • Layer 1 β€” DOM Access: Read/write any element, trigger events. 100% precise. < 1ms.
  • Layer 2 β€” Accessibility Tree: ARIA-compliant summary. Minimal tokens for LLMs.
  • Layer 3 β€” Annotated Screenshot: For Claude Computer Use / UI-TARS compatibility.

Install as an OS

W3C OS can boot as a standalone operating system β€” directly into the W3C OS Shell.

Build the bootable ISO

# Prerequisites (Linux): build-essential, ncurses-dev, wget, python3
# On macOS, the script will automatically use Docker for cross-compilation.

./system/scripts/build-iso.sh    # Output: w3cos.iso (~50-100 MB)

Run

# Option 1: QEMU virtual machine
qemu-system-x86_64 -cdrom w3cos.iso -m 2G -vga virtio

# Option 2: Flash to USB and boot real hardware
sudo dd if=w3cos.iso of=/dev/sdX bs=4M status=progress

# Option 3: Docker (compile apps, no GUI)
docker build -t w3cos . && docker run w3cos --help

# Option 4: GitHub Codespaces (one-click dev environment)
# Click "Open in Codespaces" on the GitHub repo page

See system/INSTALL.md for the full installation guide.

How It Works

TypeScript (W3C DOM + CSS)            ← You write this
        ↓  w3cos-compiler
Rust source code (auto-generated)     ← AST transform
        ↓  rustc + LLVM
Native ELF/Mach-O binary              ← Machine code
        ↓  Linux kernel
Runs directly on hardware             ← No runtime

Technology Stack

Layer Technology What it does
CSS Layout Taffy 0.9 Flexbox, Grid, Block, position
Text Layout Parley Line-breaking, shaping, bidi
2D Rendering tiny-skia β†’ Vello (Phase 2) Vector graphics
Windowing winit Cross-platform native windows
OS Base Linux kernel (Debian Minimal / Buildroot) Drivers, processes, filesystem

CSS Support

Feature Status
Flexbox / Grid βœ… Full
Block layout βœ…
position: relative / absolute βœ…
position: fixed / sticky πŸ”œ
overflow: hidden / scroll βœ…
z-index βœ…
Units: px, %, rem, em, vw, vh βœ…
border-radius, opacity βœ…
box-shadow βœ…
transform: translate / scale / rotate βœ…
transition (easing functions) βœ…
display: inline / inline-block πŸ”œ
Mouse events (hover, click) βœ…

Project Structure

w3cos/
β”œβ”€β”€ crates/
β”‚   β”œβ”€β”€ w3cos-std/         # Type definitions (Style, Component, Color)
β”‚   β”œβ”€β”€ w3cos-dom/         # W3C DOM API (Document, Element, Events)
β”‚   β”œβ”€β”€ w3cos-a11y/        # Accessibility tree (ARIA, for AI + screen readers)
β”‚   β”œβ”€β”€ w3cos-ai-bridge/   # AI agent interface (3-layer access + permissions)
β”‚   β”œβ”€β”€ w3cos-compiler/    # TS β†’ Rust transpiler
β”‚   β”œβ”€β”€ w3cos-runtime/     # Layout + Rendering + Window + Events
β”‚   └── w3cos-cli/         # CLI: w3cos build / w3cos run
β”œβ”€β”€ system/
β”‚   β”œβ”€β”€ buildroot/         # Bootable ISO config
β”‚   β”œβ”€β”€ rootfs_overlay/    # System init scripts
β”‚   β”œβ”€β”€ scripts/           # build-iso.sh, run-qemu.sh
β”‚   └── INSTALL.md         # Installation guide
β”œβ”€β”€ examples/              # 4 example applications
β”œβ”€β”€ .openclaw/             # OpenClaw + Lobster AI workflow configs
β”œβ”€β”€ .devcontainer/         # One-click dev environment
β”œβ”€β”€ Dockerfile             # Container build
β”œβ”€β”€ ARCHITECTURE.md        # Full architecture document
β”œβ”€β”€ AI_DEVELOPMENT.md      # AI-driven development model
β”œβ”€β”€ ROADMAP.md             # Phased development plan
└── CONTRIBUTING.md        # How to contribute (AI + humans)

AI-Driven Development

W3C OS is built by AI agents, directed by humans.

Humans file Issues  β†’  Management AI triages  β†’  Contributor AI codes  β†’  Human approves
  • Humans: File Issues, review PRs, make architecture decisions, sponsor tokens
  • AI (Management): Triage issues, review PRs, run CI, manage releases
  • AI (Contributor): Pick up ai-ready issues, implement features, write tests, submit PRs

AI tokens are funded by community sponsors. Every dollar goes to AI compute.

See AI_DEVELOPMENT.md for the full model, and CONTRIBUTING.md to get involved.

Sponsor

AI agents need tokens. Your sponsorship keeps development moving.

Sponsor

Tier Amount Impact
Byte $5/mo ~1 AI-implemented issue/month
Kilobyte $25/mo ~5 AI-implemented issues/month
Megabyte $100/mo ~20 AI-implemented issues/month
Gigabyte $500/mo Sustained AI development capacity

100% goes to AI compute. No human salaries. Fully transparent.

License

Apache 2.0 β€” open, neutral, not controlled by any single corporation.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors