@itsbr0dyy/vanillascript
v0.1.5
Published
VanillaScript - A simpler, sweeter JavaScript
Maintainers
Readme
VanillaScript
A simpler, sweeter JavaScript
VanillaScript is a programming language that compiles to JavaScript, designed to be easier and more intuitive than JavaScript while maintaining full compatibility.
Features
- Simpler Syntax - No semicolons, cleaner function declarations
- Easy to Learn - Perfect for beginners
- Compiles to JS - Works anywhere JavaScript works
- Type Inference - Smart type checking without TypeScript complexity
- Modern Features - All the good parts, none of the confusing parts
Installation
npm install -g @itsbr0dyy/vanillascriptQuick Start
Create a file hello.van:
print "Hello, World!"
let name = "Alice"
print "Hello, " + name
func greet(person)
print "Nice to meet you, " + person
end
greet(name)Compile and run:
vanilla run hello.vanOr compile to JavaScript:
vanilla build hello.van -o hello.jsSyntax Examples
Variables
let x = 10
let name = "John"
let isActive = trueFunctions
func add(a, b)
return a + b
end
func greet(name)
print "Hello, " + name
endConditionals
if x > 10
print "x is large"
else
print "x is small"
endLoops
loop i from 0 to 10
print i
end
while x < 100
x = x + 1
endArrays
let numbers = [1, 2, 3, 4, 5]
let first = numbers[0]Objects
let person = {
name: "Alice",
age: 30
}
print person.nameProject Structure
vanillascript/
├── src/
│ ├── lexer/ # Tokenization
│ ├── parser/ # AST generation
│ ├── ast/ # AST node definitions
│ ├── codegen/ # Code generation
│ ├── semantic/ # Semantic analysis
│ ├── optimizer/ # Code optimization
│ ├── runtime/ # Runtime support
│ ├── stdlib/ # Standard library
│ ├── errors/ # Error handling
│ └── utils/ # Utilities
├── tests/ # Test suites
├── examples/ # Example programs
├── docs/ # Documentation
└── bin/ # CLI toolsDocumentation
License
MIT
