mcslib
is structural programming language coded using javascript, compiles into minecraft datapack.
About language guide, see guide.md (in progress)
About language reference, see reference.md (in progress)
See https://github.com/storycraft/mcslib-template
- Expression template literal lexer and parser
- Number type
- String type
- Builtin types and methods(static dispatch)
- Reference types
- Function, object, array types
- Closure and coroutine
- IR lowering
- Command template literal parser
- Execute commands using variable value
- Store command result into variable
- IR optimization (in progress)
- Loop optimization
- Branch prediction
- Constant folding
- Codegen optimization (in progress)
- Optimized memory placement
- Dead code elimination (partial)
Compile example datapack using
npm start --example=build
Run datapack with intrinsics_datapack
Demonstration of string concatenation
Source code in examples/draw-star.ts
Demonstration of running particle command using variable value
Source code in examples/cube-particle.ts
Demonstration of running command using command output
Source code in examples/poll.ts
Demonstration of running builtin methods
Source code in examples/methods.ts
mcslib and project resources are licensed under MIT license