Skip to content

NarraLeaf/NarraLang

Repository files navigation

NarraLeaf Logo

NarraLang

A modern, expressive scripting DSL for narrative-driven experiences.

NarraLang is a scripting language designed for NarraLeaf Engine.

It provides a highly flexible scripting solution for authoring NarraLeaf stories through its clear and easy-to-understand syntax, strong logical structure, and multiple compatibility options.


Key Features

  • Easy to learn - The basic syntax is similar to JavaScript, but it retains only the essential concepts while discarding confusing features
  • Strong Logical Structure - The built-in syntax is robust enough to serve as a programming language, enabling the construction of complex game logic
  • Tool Chain - The VSC extension and linting toolchain currently under development will be used to help build professional and maintainable script projects

Examples

character John "John"
image John "john.png" pos [5, 10] scale 1.0

scene Morning {
  John: "Hello, my friend."
  John: "It's a new day. Let's do our best!"

  John char "john-happy.png"

  John: "Let's start with <b>the basic syntax</b>!"
}

Documentation

In progress...

Tools

NLC (@narralang/nlc)

Node compiler (phase 1): validates .nls and emits a TypeScript module exporting the parsed AST. CLI: yarn workspace @narralang/nlc exec node dist/cli.cjs <input.nls> [output.ts] after yarn build.

NarraLint

In progress...

Integration

In progress...

Localization

In progress...

License

MIT © NarraLeaf Project

Contributing

We're just getting started! Feel free to:

  • Report issues
  • Suggest new syntax sugar
  • Help implement multi-language support
  • Contribute tests or documentation

About

NarraLeaf Scripting Language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors