LokaScript

Write interactive UI behaviors in your native language. 43 commands, 24 supported languages, and flexible bundle options from 1.9KB to 203KB.

43 commands 24 languages 1.9KB min bundle 8100+ tests

Try It - Live Interactive Demos

Toggle Class

on click toggle .active on me

Counter

on click increment :count then
put :count into me

Color Cycle

on pointerdown
  repeat until event pointerup
    set rand to Math.random() * 360
    transition *background-color
      to `hsl($rand 100% 90%)`
      over 250ms
  end

Write in Your Native Language

LokaScript supports 24 languages with natural grammar transformation. The same logic, expressed naturally in each language:

English (SVO)

on click toggle .active on me

Japanese (SOV)

クリック で 私 の .active を 切り替え

Spanish (SVO)

al hacer clic alternar .active en mi

Arabic (VSO)

عند النقر بدّل .active على نفسي

Learn about multilingual support →

Choose Your Bundle Size

Bundle Size Commands Best For
lokascript-lite.js 1.9 KB 8 Minimal interactions (toggle, add, remove)
lokascript-lite-plus.js 2.6 KB 14 More commands + i18n aliases
lokascript-hybrid-complete.js 7.3 KB 21 + blocks Most projects (if/else, repeat, fetch)
lokascript-hybrid-hx.js 9.5 KB 21 + htmx htmx attribute compatibility
lokascript-browser.js 203 KB 43 Full features + semantic parser

Quick Start

CDN (Simplest)

<script src="https://unpkg.com/@lokascript/core/dist/lokascript-browser.js"></script>

<button _="on click toggle .active on me">
  Click me
</button>

npm + Vite (Recommended)

npm install @lokascript/core @lokascript/vite-plugin
// vite.config.js
import { lokascript } from '@lokascript/vite-plugin';

export default {
  plugins: [lokascript()]
};

The Vite plugin automatically scans your code and generates a minimal bundle with only the commands you use.

Events First

Send, receive, filter, queue, and debounce events with ease. Chain events together for complex interactions.

Async Built-In

No promises, async/await, or callback hell. LokaScript transparently handles asynchronous behavior.

~85% Compatibility

Compatible with most _hyperscript code. Migrate existing projects with minimal changes.

Tree-Shakeable

Only include the commands you use. The Vite plugin generates optimal bundles automatically.

Semantic Parser

AI-friendly parsing that understands intent across all 24 languages with confidence scoring.

MCP Integration

22 tools for AI assistants: validation, translation, pattern search, and code generation.

Ready to Get Started?