Building a language while learning at the same time. JScript transpiles to JavaScript.
- Address pain points in JavaScript
- Use features that JavaScript will never have
- Maintain JavaScript ecosystem interop
- Parsing, checking, and generating
- ✓ | Basic expressions
- ✓ | Let, fn, assign statements
- ✓ | Arrays with destructuring
- ✓ | Syntax for ranges
- ✓ | If statements & expressions
- ✗ | Loops
- ✗ | Structs
- ✗ | Enums
- ✗ | Pattern matching
- ✗ | Impl statements
- ✗ | Parser rewrite
- ✗ | Good error messages
- ✗ | Decide on a macro system
- ✗ | Lowering and optimizations
- ✗ | Figure out CLI, standard library, & package manager details
Code will look a lot like rust with a garbage collector.
fn fib(n: num): num {
match n {
0 => 1,
1 => 1,
_ => fib(n-1) + fib(n-2),
}
}