A beginner-friendly programming language that compiles to JavaScript
NoobScript is designed to make programming accessible to complete beginners by using simple, readable syntax that resembles natural language.
"Teach programming concepts, not syntax."
NoobScript removes the complexity of brackets, semicolons, and confusing symbols, allowing beginners to focus on learning programming concepts like variables, loops, functions, and classes.
✨ Simple Syntax - No curly braces, semicolons, or complex punctuation 📝 Readable Code - Keywords that feel like natural language 🎯 Beginner-Friendly - Clear error messages ⚡ Fast - Compiles directly to modern JavaScript 🌐 Universal - Runs anywhere JavaScript runs (Node.js, browsers, Bun, Deno) 🎨 Rich Features - Objects, booleans, null, break/continue, while loops, and more!
Install globally from npm:
npm install -g noobscriptOr clone from source:
git clone https://github.com/manojuppala/noobscript.git
cd noobscript
npm installCreate a file hello.noob:
print "Hello World"
Run it:
noob run hello.noobOr build it to JavaScript:
noob build hello.noob
# Creates hello.js
node hello.jsRun any of the included examples:
noob run examples/fizzbuzz.noob
noob run examples/calculator.noob
noob run examples/complete-showcase.noobThe simplest program prints text:
print "Hello, World!"
Store values in variables (no declaration needed):
name = "Alice"
age = 25
score = 95.5
print name
print "Age: " + age
Values that never change:
constant PI = 3.14159
constant MAX_USERS = 100
print PI
Use if and otherwise for conditions:
age = 20
if age >= 18
print "You can vote!"
otherwise
print "Too young to vote"
end
You can also use natural language:
score = 95
if score is greater than 90
print "Excellent!"
end
Repeat a fixed number of times:
repeat 5 times
print "Hello!"
end
Loop through a range:
for i from 1 to 10
print i
end
Loop through items:
fruits = ["apple", "banana", "orange"]
for fruit in fruits
print fruit
end
While loops:
count = 5
while count > 0
print count
count = count - 1
end
Define reusable code:
function greet(name)
print "Hello, " + name
end
greet("Alice")
greet("Bob")
Functions can return values:
function add(a, b)
return a + b
end
sum = add(10, 20)
print sum # 30
Arrays:
numbers = [1, 2, 3, 4, 5]
print numbers[0] # First element
for num in numbers
print num
end
Objects:
person = {
name: "Alice",
age: 30,
city: "New York"
}
print person.name
print person.age
Object-oriented programming:
class Animal
function speak()
print "Some sound"
end
end
class Dog extends Animal
function speak()
print "Woof!"
end
end
Numbers:
age = 25
price = 19.99
negative = -10
Strings:
name = "Alice"
greeting = 'Hello World'
combined = "Hello " + "World"
Booleans:
isActive = true
isComplete = false
Null and Undefined:
value = null
notSet = undefined
Arrays:
numbers = [1, 2, 3, 4, 5]
mixed = [1, "hello", true, null]
Objects:
person = {
name: "Alice",
age: 30,
active: true
}
Variables:
name = "Alice"
age = 25
Constants:
constant PI = 3.14159
constant MAX_SIZE = 100
Type Annotations (Optional):
name: text = "Alice"
age: number = 25
score: number = 95.5
Arithmetic:
sum = 10 + 5
difference = 10 - 5
product = 10 * 5
quotient = 10 / 5
remainder = 10 % 3
power = 2 ** 3 # Exponentiation (v1.1.0)
Increment/Decrement (v1.1.0):
counter = 5
counter++ # Increment (now 6)
counter-- # Decrement (now 5)
Comparison:
10 > 5 # Greater than
10 < 20 # Less than
10 >= 10 # Greater than or equal
10 <= 10 # Less than or equal
10 == 10 # Equal to
10 != 5 # Not equal to
Logical:
true and false # Logical AND
true or false # Logical OR
Natural Language:
if age is greater than 18
if score is less than 50
print "Hello World"
print name
print 42
print "Score: " + score
# This is a single-line comment
print "Hello" # Comment after code
Basic If/Otherwise:
if age > 18
print "Adult"
otherwise
print "Child"
end
ElseIf Chains (v1.1.0):
if score >= 90
print "Grade: A"
elseif score >= 80
print "Grade: B"
elseif score >= 70
print "Grade: C"
otherwise
print "Grade: F"
end
Repeat Loop (Fixed iterations):
repeat 5 times
print i # i is the counter (0-4)
end
Range Loop (For):
for number from 1 to 10
print number
end
for i from 0 to 100
print i
end
Collection Loop (For-in):
fruits = ["apple", "banana", "orange"]
for fruit in fruits
print fruit
end
While Loop:
count = 5
while count > 0
print count
count = count - 1
end
Loop Control:
# Break - exit loop early
for i from 1 to 10
if i == 5
break
end
print i
end
# Continue - skip to next iteration
for num from 1 to 10
if num % 2 == 0
continue
end
print num # Only odd numbers
end
function greet(name)
print "Hello " + name
end
function add(a, b)
return a + b
end
greet("World")
result = add(5, 3)
print result
numbers = [1, 2, 3, 4, 5]
fruits = ["apple", "banana", "orange"]
print numbers[0]
person = {
name: "Alice",
age: 25,
city: "New York"
}
print person.name # Alice
print person.age # 25
isActive = true
isComplete = false
value = null
notSet = undefined
if isActive
print "System active"
end
# Break - exit loop early
for i from 1 to 10
if i == 5
break
end
print i
end
# Continue - skip to next iteration
for num from 1 to 10
if num % 2 == 0
continue
end
print num # Only odd numbers
end
count = 5
while count > 0
print count
count = count - 1
end
print "Done!"
Basic Class:
class Animal
function speak()
print "Some sound"
end
end
Inheritance:
class Dog extends Animal
function speak()
print "Woof!"
end
end
class Cat extends Animal
function speak()
print "Meow!"
end
end
status = "success"
match status
case "loading"
print "Please wait..."
case "success"
print "Operation completed!"
case "error"
print "Something went wrong"
default
print "Unknown status"
end
try
# Code that might throw an error
result = riskyOperation()
catch error
print "Error occurred:"
print error
end
async function fetchData()
data = await getData()
return data
end
async function processData()
result = await fetchData()
print result
end
Nested Objects:
user = {
id: 1,
profile: {
name: "Alice",
email: "alice@example.com"
},
settings: {
darkMode: true,
notifications: false
}
}
print user.profile.name
print user.settings.darkMode
Nested Conditionals:
score = 85
if score >= 90
print "Grade: A"
otherwise
if score >= 80
print "Grade: B"
otherwise
if score >= 70
print "Grade: C"
otherwise
print "Grade: F"
end
end
end
Build (Compile to JavaScript):
noob build <file>
# Example: noob build hello.noob
# Creates hello.jsRun (Compile and Execute):
noob run <file>
# Example: noob run examples/fizzbuzz.noobHelp:
noob helpThe examples/ directory contains 22+ working examples demonstrating all features:
Basic Examples:
hello.noob- Hello Worldvariables.noob- Variables and constantsconditionals.noob- If/otherwise statementsloops.noob- All loop typesfunctions.noob- Function declarationsarrays.noob- Array operationsobjects.noob- Object literalsbooleans.noob- Boolean, null, undefined
Advanced Examples:
classes.noob- Object-oriented programmingmatch.noob- Pattern matchingtypes.noob- Type annotationswhile-loop.noob- While loopsbreak-continue.noob- Loop control
New Features (v1.1.0):
power-operator.noob- Exponentiation with**increment-decrement.noob-++and--operatorselseif.noob- Multiple condition chainsmodulo.noob- Remainder operations with%advanced-loops.noob- Combining new featuresnew-features.noob- All new features demo
Practical Examples:
calculator.noob- Simple calculatorfizzbuzz.noob- Classic FizzBuzzcomplete-showcase.noob- All features demo
Run any example:
noob run examples/power-operator.noob
noob run examples/elseif.noob
noob run examples/fizzbuzz.noobnoobscript/
├── src/ # Compiler source code
│ ├── lexer/ # Tokenization
│ ├── parser/ # AST generation
│ └── generator/ # Code generation
├── bin/ # CLI executable
│ └── noob.js # Command-line interface
├── examples/ # Example programs
├── test.js # Test suite
└── README.md
NoobScript uses a three-stage compiler pipeline:
- Lexer - Tokenizes source code into meaningful units (keywords, identifiers, operators, etc.)
- Parser - Builds an Abstract Syntax Tree (AST) using recursive descent parsing
- Generator - Converts the AST into clean, readable JavaScript code
Example transformation:
NoobScript:
for i from 1 to 5
print i
end
Compiles to JavaScript:
for (let i = 1; i <= 5; i++) {
console.log(i);
}Run the test suites to verify all features:
node test.js # Core features
node test-advanced.js # Advanced features (async, try/catch, match)
node test-new-features.js # New features (objects, booleans, null)All tests should pass with ✓ marks.
-
Variable Reassignment in Nested Scopes: Reassigning variables inside loops/blocks may create new variables instead of updating existing ones. This is being addressed in future releases.
-
No Type Checking: Type annotations are parsed but not enforced at compile time.
-
Limited Error Messages: Error reporting is basic; more helpful suggestions coming soon.
Completed ✅:
- Core compiler (lexer, parser, generator)
- CLI tool (build, run)
- All basic features (variables, loops, functions, classes)
- Advanced features (async/await, pattern matching, try/catch)
- Objects, booleans, null, undefined
- Break/continue statements
- While loops
- 16 working examples
- Comprehensive documentation
Future Plans 🚀:
- Module system (import/export)
- Language server (LSP)
- VS Code extension with syntax highlighting
- Web playground (try NoobScript in browser)
- Formatter & linter
- Better error messages with suggestions
- Source maps for debugging
- Variable scope improvements
For AI Assistants:
- See
claude.mdfor comprehensive technical documentation - Contains architecture details, compiler components, and contribution guidelines
For Users:
- Start with
examples/hello.noob - Work through examples in order: variables → conditionals → loops → functions → classes
- Try modifying examples to experiment
- Check
complete-showcase.noobto see all features at once
Contributions are welcome! Feel free to:
- Report bugs - Open an issue with details
- Suggest features - Propose new beginner-friendly features
- Submit pull requests - Improve code, docs, or examples
- Add examples - Create new example programs
- Improve documentation - Help make learning easier
Guidelines:
- Keep syntax simple and beginner-friendly
- Add tests for new features
- Update documentation
- Follow existing code patterns
NoobScript follows these core principles:
- Concepts Over Syntax - Focus on teaching programming fundamentals
- Clarity Over Brevity - Readable code is better than short code
- Natural Language - Use words that beginners understand
- Progressive Complexity - Start simple, add complexity gradually
- JavaScript Interoperability - Easy transition to JavaScript later
"If a beginner can understand it without learning programming punctuation first, NoobScript is doing its job correctly."
Q: Who is NoobScript for? A: Absolute beginners who want to learn programming concepts without getting overwhelmed by syntax.
Q: Can I use NoobScript for real projects? A: NoobScript compiles to JavaScript, so it runs anywhere JS runs. However, it's primarily designed for learning.
Q: How do I transition from NoobScript to JavaScript?
A: Check the compiled .js files to see how NoobScript code translates to JavaScript. The compilation is very direct and readable.
Q: Does NoobScript support all JavaScript features? A: Not yet. It supports core programming concepts. Advanced JavaScript features may be added in future versions.
Q: Can I mix NoobScript and JavaScript? A: The compiled JavaScript can be used with any JavaScript code. You can import the compiled modules into JS projects.
- Built with JavaScript (ES6+)
- Uses recursive descent parsing
- Inspired by beginner-friendly languages like Python and Ruby
- Compiles to modern JavaScript (ESM)
MIT
Made with ❤️ for beginners learning to code
Start your programming journey with NoobScript! 🚀