0x Lang
raw JSON → 0.1.29 verified Fri May 01 auth: no javascript
0x (v0.1.29) is an experimental AI-first programming language and compiler that transpiles a concise DSL into full-stack production code for React, Vue 3, Svelte 5, Express, React Native, and Terraform. It significantly reduces boilerplate — a component written in 18 lines of 0x typically generates ~96 lines of TypeScript React. The compiler is distributed as a CLI tool via npm, supports watch mode and project scaffolding, and ships with TypeScript types. Active development, monthly releases. Differentiators: multi-target compilation from a single source, built-in DSL for UI, state, and backend logic, and LSP/IDE support.
Common errors
error Error: Cannot find module '0x-lang' ↓
cause Package installed locally but not globally.
fix
Run
npm install -g 0x-lang or use npx 0x-lang build .... error TypeError: compile is not a function ↓
cause Using require('0x-lang') which returns the default export as an object with compile property? Actually default export is a function. Wrong import style.
fix
Use
import compile from '0x-lang' (ESM) or const compile = require('0x-lang').default (CJS). error error: unknown option `--target' ↓
cause Using older version <0.1.0 that used --format instead.
fix
Upgrade to >=0.1.0 or use
--format if on older version: 0x build app.ai --format react. Warnings
breaking Version 0.1.0 changed output format from JSON to source files. Older versions' `0x build --format json` no longer works. ↓
fix Upgrade to >=0.1.0 and use `0x build` (defaults to source files). For JSON output, pipe through a custom formatter.
breaking Requires Node.js >=18; fails silently on Node 16 with obscure errors. ↓
fix Update Node.js to 18+ using nvm or your package manager.
deprecated The `--format` flag (`--format react`, `--format vue`) is deprecated as of v0.1.0. Use `--target react` instead. ↓
fix Replace `--format` with `--target` in CLI commands. Example: `0x build app.ai --target react`.
gotcha Generated React components use React 18's createRoot; not compatible with React 17 automatically. ↓
fix Ensure your project uses React 18+. If stuck on React 17, compile with `--target react-17`? No such option — fork or avoid.
Install
npm install 0x-lang yarn add 0x-lang pnpm add 0x-lang Imports
- 0x CLI wrong
npm install 0x-lang (local install requires npx or global)correctnpm install -g 0x-lang - default export (programmatic use) wrong
const { compile } = require('0x-lang')correctimport compile from '0x-lang' - build command (watch mode) wrong
0x watch counter.ai (no such command)correct0x dev counter.ai --target react
Quickstart
npm install -g 0x-lang
cat > hello.ai << 'EOF'
page Hello:
state name: str = "World"
layout col gap=16 padding=24 center:
text "Hello, {name}!" size=3xl bold
input name placeholder="Your name"
EOF
0x build hello.ai --target react