{"id":24878,"library":"0x-lang","title":"0x Lang","description":"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.","status":"active","version":"0.1.29","language":"javascript","source_language":"en","source_url":"https://github.com/user/0x-lang","tags":["javascript","0x","compiler","ai","react","vue","svelte","react-native","express","typescript"],"install":[{"cmd":"npm install 0x-lang","lang":"bash","label":"npm"},{"cmd":"yarn add 0x-lang","lang":"bash","label":"yarn"},{"cmd":"pnpm add 0x-lang","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"compiler output targets TypeScript; types required for generated code","package":"typescript","optional":true}],"imports":[{"note":"The package is primarily a CLI tool. Install globally for '0x' command, or use npx 0x-lang for one-off runs.","wrong":"npm install 0x-lang (local install requires npx or global)","symbol":"0x CLI","correct":"npm install -g 0x-lang"},{"note":"Programmatic API is ESM-only starting v0.1.0; CJS require works only for default export.","wrong":"const { compile } = require('0x-lang')","symbol":"default export (programmatic use)","correct":"import compile from '0x-lang'"},{"note":"Use 'dev' subcommand for watch/recompile mode.","wrong":"0x watch counter.ai (no such command)","symbol":"build command (watch mode)","correct":"0x dev counter.ai --target react"}],"quickstart":{"code":"npm install -g 0x-lang\ncat > hello.ai << 'EOF'\npage Hello:\n  state name: str = \"World\"\n  layout col gap=16 padding=24 center:\n    text \"Hello, {name}!\" size=3xl bold\n    input name placeholder=\"Your name\"\nEOF\n0x build hello.ai --target react","lang":"typescript","description":"Installs the 0x-lang CLI globally, creates a minimal 0x source file with a stateful page component, and compiles it to a React component."},"warnings":[{"fix":"Upgrade to >=0.1.0 and use `0x build` (defaults to source files). For JSON output, pipe through a custom formatter.","message":"Version 0.1.0 changed output format from JSON to source files. Older versions' `0x build --format json` no longer works.","severity":"breaking","affected_versions":"<0.1.0"},{"fix":"Update Node.js to 18+ using nvm or your package manager.","message":"Requires Node.js >=18; fails silently on Node 16 with obscure errors.","severity":"breaking","affected_versions":"<18"},{"fix":"Replace `--format` with `--target` in CLI commands. Example: `0x build app.ai --target react`.","message":"The `--format` flag (`--format react`, `--format vue`) is deprecated as of v0.1.0. Use `--target react` instead.","severity":"deprecated","affected_versions":">=0.1.0,<0.2.0"},{"fix":"Ensure your project uses React 18+. If stuck on React 17, compile with `--target react-17`? No such option — fork or avoid.","message":"Generated React components use React 18's createRoot; not compatible with React 17 automatically.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `npm install -g 0x-lang` or use `npx 0x-lang build ...`.","cause":"Package installed locally but not globally.","error":"Error: Cannot find module '0x-lang'"},{"fix":"Use `import compile from '0x-lang'` (ESM) or `const compile = require('0x-lang').default` (CJS).","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.","error":"TypeError: compile is not a function"},{"fix":"Upgrade to >=0.1.0 or use `--format` if on older version: `0x build app.ai --format react`.","cause":"Using older version <0.1.0 that used --format instead.","error":"error: unknown option `--target'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}