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.

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.
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.
npm install 0x-lang
yarn add 0x-lang
pnpm add 0x-lang

Installs the 0x-lang CLI globally, creates a minimal 0x source file with a stateful page component, and compiles it to a React component.

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