CursorScript is a high-performance, interpreted programming language designed for rapid Game Development and logic experimentation. Built on Bun, it combines a clean, modern syntax with powerful native capabilities.
- π Native Windowing: Create windows, handle hardware-accelerated drawing, and capture input (keyboard/mouse) natively via
WindowLib. - β‘ Logical Gates: First-class support for
&&(AND),||(OR), and!(NOT) with short-circuiting. - π¦ Data Structures: Support for nested Objects and dynamic Arrays (
push,pop,shift,unshift,len). - π Control Flow: Powerful
if/elsebranches andwhileloops for complex simulation logic. - π‘οΈ Strict & Clean: Smart semicolon rulesβsemicolons are required only on
letandconstdeclarations. Expressions and blocks are clean. - π§© VS Code Integration: Seamless support with the CursorScript VS Code extension for syntax highlighting and snippets.
- Ξ» Lambda Functions: Higher-order functions with arrow syntax
(a, b) -> { a + b }. - π¦ Module System: Support for
importandexportto organize code into multiple files. - π Network Library: Built-in HTTP client for fetching data with async callback support.
curl -fsSL https://raw.githubusercontent.com/naveenpoddar/cursorscript/main/install.sh | bashirm https://raw.githubusercontent.com/naveenpoddar/cursorscript/main/install.ps1 | iexTo significantly improve your development experience, install the official CursorScript extension:
- For Cursor / Google Antigravity / Open Source IDEs: Open VSX Registry
- For Official Visual Studio Code: VS Code Marketplace
Features include syntax highlighting, intelligent snippets, and code formatting.
You need Bun installed.
git clone https://github.com/naveenpoddar/cursorscript.gitcd CursorPPbun install
For a full list of built-in libraries, global functions, and language features, please visit the API Documentation Reference.
Experience the full power of CursorScript by running our reference game:
cursorx ./test/test_snakegame.cursorCursorScript comes with a built-in package manager called CursorX to manage external modules and dependencies.
| Command | Description |
|---|---|
cursorx init |
Initialize a new project with a cursor.json file. |
cursorx install <github-url> |
Install a dependency from a GitHub repository. |
cursorx install |
Install all dependencies listed in cursor.json. |
cursorx remove <slug> |
Remove a dependency. |
To create a reusable CursorScript package:
-
Initialize your project:
cursorx init
This creates a
cursor.jsonfile in your root directory. -
Configure your package: Edit
cursor.jsonto define your package name and entry point:{ "name": "my-cool-package", "version": "1.0.0", "main": "src/index.cursor" } -
Export your code: In your
mainfile (e.g.,src/index.cursor), export the functions or variables you want to share:export fn sayHello(name) { print("Hello, " + name) } -
Publish to GitHub: Push your project to a public GitHub repository.
Other users can install your package by using its GitHub repository link:
cursorx install https://github.com/username/repo-nameExternal packages are installed in the .cursorx directory and can be imported directly using the name defined in their cursor.json:
import { sayHello } from "my-cool-package"
Window.create(600, 600, "Demo Window")
let player = { x: 10, y: 10 };
let speed = 5;
fn update() {
Window.clear("black")
// Logic Gates and Input
if (Window.getKeyDown("ArrowUp") && player.y > 0) {
player.y = player.y - speed
}
Window.setColor("green")
Window.drawRect(player.x, player.y, 20, 20)
}
Window.onUpdate(update)
Combine conditions naturally: if (score > 100 || time() > 1000) { ... }
let enemies = [];
push(enemies, { id: 1 });
print(len(enemies)); // 1
- REQUIRED: After variable declarations (
let x = 10;). - OPTIONAL/EXCLUDED: After function calls,
ifblocks, andwhileloops.
| Feature | Syntax |
|---|---|
| Feature | Syntax |
| :---------------- | :------------------------------------ |
| Variables | let x = 10; (Required ;) |
| Constants | const VELOCITY = 5; |
| Functions | fn add(a, b) { a + b } |
| If/Else | if (x > 0) { ... } else { ... } |
| While Loop | while (i < 10) { i = i + 1 } |
| Lambdas | (a, b) -> { a + b } |
| Modules | import { x } from "pkg" or ./file |
| Arrays | let arr = [1, 2, 3]; |
| Logic | &&, ||, ! |
| Member Access | obj.prop or arr[0] |
src/frontend/- High-speed Lexer and Recursive Descent Parser.src/runtime/- Scoped environment and short-circuiting evaluator.src/lib/- Native bridges (WindowLib,MathLib).test/- Reference implementations like Snake Game and logic tests.
Built with β€οΈ by the CursorScript team. Open an issue or PR to help make it even better.