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.

Node.js 18+ runtime MIT license 34 plain-English keywords
animal.code
CodeScript

          
JavaScript output

          

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.

ProblemCodeScript solution
console.log is confusing
Use say instead
let, const, var are unclear
Use make and fixed
function keyword is verbose
Use do
this is confusing
Use me
try/catch/finally is intimidating
Use attempt/oops/done
new keyword feels magical
Use create
null and undefined are unclear
Use empty and unknown

Quick start

Install, write, run.

Requires Node.js 18 or higher. Three commands and you're compiling.

1

Install the CLI

terminal
npm install -g @jishaanyazmi/code-script
2

Write your first file

hello.code
say("Hello, World!")
3

Run it

terminal
codescript hello.code

# Output
Hello, World!

CLI reference

Commands you'll actually use.

codescript <file.code>Compile and run a file
codescript build <file.code>Compile only — outputs a .js file
codescript watch <file.code>Watch for changes and recompile automatically
codescript initScaffold a new CodeScript project
codescript --versionShow the installed version
codescript --helpShow usage information

Under the hood

One file, seven stages.

Every .code file passes through the same pipeline before it reaches Node.js.

Lexer
Converts characters into tokens
Parser
Converts tokens into an AST
AST
Abstract syntax tree — the program's structure
Semantic analyzer
Validates scope, types, and rules
Optimizer
Constant folding, dead code removal
JS generator
Emits clean, readable JavaScript
Node.js
Executes the generated output

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.

Reference output
Edit CodeScript
Output

          

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.

KeywordJavaScriptDescriptionCategory
makeletDeclares a mutable variableVariables
fixedconstDeclares an immutable constant — must be initializedVariables
keepvarLegacy variable — function scoped, avoid in new codeVariables
dofunctionDeclares a reusable functionFunctions
givereturnReturns a value from a functionFunctions
laterasyncMarks a function as asynchronousFunctions
waitawaitWaits for an async operation to completeFunctions
sayconsole.logPrints a value to the consoleOutput
checkifExecutes a block when the condition is trueConditions
otherwiseelseExecutes when the check condition is falseConditions
pickswitchSelects one path from multiple optionsConditions
whencaseDefines a single case inside a pick blockConditions
anywaydefaultThe fallback case inside a pick blockConditions
repeatforRepeats a block a set number of timesLoops
untilwhileRepeats while a condition is trueLoops
stopbreakExits the nearest loop immediatelyLoops
skipcontinueSkips the current iteration and continuesLoops
typeclassDeclares a classClasses & OOP
fromextendsInherits from a parent classClasses & OOP
createnewCreates a new instance of a classClasses & OOP
methisRefers to the current object instanceClasses & OOP
parentsuperCalls the parent class constructor or methodClasses & OOP
sharedstaticDeclares a static method or propertyClasses & OOP
mineprivateMarks a member as privateClasses & OOP
everyonepublicMarks a member as publicClasses & OOP
familyprotectedMarks a member as protectedClasses & OOP
attempttryWraps code that might throw an errorError handling
oopscatchHandles the error if one is thrownError handling
panicthrowThrows an error and stops executionError handling
donefinallyAlways runs after attempt/oops, error or notError handling
grabimportImports code from another .code fileModules
shareexportExports variables, functions, or classesModules
yestrueBoolean true valueBoolean & null
nofalseBoolean false valueBoolean & null
emptynullRepresents an intentionally absent valueBoolean & null
unknownundefinedRepresents an uninitialized valueBoolean & null
kindtypeofReturns the type of a value as a stringUtility
isinstanceofChecks if an object is an instance of a classUtility
removedeleteDeletes a property from an objectUtility

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.

complete.code
// 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")
}
Output
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.

SyntaxError
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.