v1.0.0 · transpiles to JavaScript
Code that
reads like English.
CodeScript is a lightweight, readable language that compiles straight to clean JavaScript. It swaps confusing syntax for plain-English keywords, so beginners can focus on learning logic instead of fighting the language.
Why CodeScript
Every keyword says what it does.
JavaScript's syntax carries a lot of history. CodeScript keeps the language's power and removes the jargon, one keyword at a time.
console.log is confusingsay insteadlet, const, var are unclearmake and fixedfunction keyword is verbosedothis is confusingmetry/catch/finally is intimidatingattempt/oops/donenew keyword feels magicalcreatenull and undefined are unclearempty and unknownQuick start
Install, write, run.
Requires Node.js 18 or higher. Three commands and you're compiling.
Install the CLI
npm install -g @jishaanyazmi/code-script
Write your first file
say("Hello, World!")
Run it
codescript hello.code # Output Hello, World!
CLI reference
Commands you'll actually use.
codescript <file.code>Compile and run a filecodescript build <file.code>Compile only — outputs a .js filecodescript watch <file.code>Watch for changes and recompile automaticallycodescript initScaffold a new CodeScript projectcodescript --versionShow the installed versioncodescript --helpShow usage informationUnder the hood
One file, seven stages.
Every .code file passes through the same pipeline before it reaches Node.js.
Playground
Try it without installing anything.
Pick a preset or start typing. Presets show the exact output from the docs; your own edits run through a simplified live preview.
The live preview handles the keyword table and common patterns; the real compiler in the CLI is the source of truth for anything more complex.
Keyword reference
Every keyword, side by side with JavaScript.
| Keyword | JavaScript | Description | Category |
|---|---|---|---|
make | let | Declares a mutable variable | Variables |
fixed | const | Declares an immutable constant — must be initialized | Variables |
keep | var | Legacy variable — function scoped, avoid in new code | Variables |
do | function | Declares a reusable function | Functions |
give | return | Returns a value from a function | Functions |
later | async | Marks a function as asynchronous | Functions |
wait | await | Waits for an async operation to complete | Functions |
say | console.log | Prints a value to the console | Output |
check | if | Executes a block when the condition is true | Conditions |
otherwise | else | Executes when the check condition is false | Conditions |
pick | switch | Selects one path from multiple options | Conditions |
when | case | Defines a single case inside a pick block | Conditions |
anyway | default | The fallback case inside a pick block | Conditions |
repeat | for | Repeats a block a set number of times | Loops |
until | while | Repeats while a condition is true | Loops |
stop | break | Exits the nearest loop immediately | Loops |
skip | continue | Skips the current iteration and continues | Loops |
type | class | Declares a class | Classes & OOP |
from | extends | Inherits from a parent class | Classes & OOP |
create | new | Creates a new instance of a class | Classes & OOP |
me | this | Refers to the current object instance | Classes & OOP |
parent | super | Calls the parent class constructor or method | Classes & OOP |
shared | static | Declares a static method or property | Classes & OOP |
mine | private | Marks a member as private | Classes & OOP |
everyone | public | Marks a member as public | Classes & OOP |
family | protected | Marks a member as protected | Classes & OOP |
attempt | try | Wraps code that might throw an error | Error handling |
oops | catch | Handles the error if one is thrown | Error handling |
panic | throw | Throws an error and stops execution | Error handling |
done | finally | Always runs after attempt/oops, error or not | Error handling |
grab | import | Imports code from another .code file | Modules |
share | export | Exports variables, functions, or classes | Modules |
yes | true | Boolean true value | Boolean & null |
no | false | Boolean false value | Boolean & null |
empty | null | Represents an intentionally absent value | Boolean & null |
unknown | undefined | Represents an uninitialized value | Boolean & null |
kind | typeof | Returns the type of a value as a string | Utility |
is | instanceof | Checks if an object is an instance of a class | Utility |
remove | delete | Deletes a property from an object | Utility |
No keywords match your search.
Full example
Variables to classes, in one file.
A single program touching every part of the language, and the JavaScript it produces.
// Variables
make name = "Zishan"
fixed PI = 3.14
// Function
do greet(person){
say("Hello " + person)
give person
}
greet(name)
// Condition
check(PI > 3){
say("PI is greater than 3")
}otherwise{
say("PI is small")
}
// Loop
repeat(make i = 1; i < 4; i++){
say(i)
}
// Array
make fruits = ["Apple", "Banana", "Orange"]
say(fruits[0])
// Object
make user = { name: "Alex", age: 20 }
say(user.name)
// Class
type Animal{
do constructor(name){
me.name = name
}
do speak(){
say("I am " + me.name)
}
}
type Dog from Animal{
do constructor(name){
parent(name)
}
}
make dog = create Dog("Rex")
dog.speak()
// Error Handling
attempt{
panic "something went wrong"
}oops(err){
say(err)
}done{
say("finished")
}
Hello Zishan PI is greater than 3 1 2 3 Apple Alex I am Rex something went wrong finished
Developer experience
Errors that tell you what to do next.
Every compiler error includes the file, line, column, and a suggested fix — no stack-trace archaeology required.
File: hello.code Line: 12 Column: 8 Message: Expected '}' but found ')' Suggestion: Close the previous block before ending the function.
Under the hood
One package per compiler stage.
codescript/ ├── packages/ │ ├── cli/ CLI — command line interface │ ├── compiler/ Compiler orchestrator │ ├── lexer/ Lexer — source to tokens │ ├── tokenizer/ Token type definitions │ ├── parser/ Parser — tokens to AST │ ├── ast/ AST node definitions │ ├── semantic/ Semantic analyzer │ ├── optimizer/ AST optimizer │ ├── generator/ JavaScript code generator │ ├── resolver/ Module resolver │ ├── stdlib/ Standard library │ └── shared/ Shared utilities ├── examples/ Example .code programs ├── tests/ Automated tests ├── docs/ Language documentation └── README.md