HN
Today

Show HN: Loreline, narrative language transpiled via Haxe: C++/C#/JS/Java/Py/Lua

Loreline is presented as a novel narrative scripting language crafted to bridge the gap between creative writing and robust software engineering. It leverages Haxe to transpile its interpreter and runtime to multiple platforms, including C++, C#, and JavaScript, ensuring wide compatibility across game engines and web applications. This technical deep dive appeals to HN's interest in innovative language design and cross-platform development solutions.

5
Score
1
Comments
#13
Highest Rank
5h
on Front Page
First Seen
Mar 31, 3:00 PM
Last Seen
Mar 31, 7:00 PM
Rank Over Time
1613192326

The Lowdown

Loreline is an ambitious narrative scripting language engineered to simplify the creation of interactive stories by focusing on writer-friendly syntax while handling underlying complexity. Its dual nature combines intuitive narrative design with sophisticated software engineering, allowing writers to express complex branching, variations, and state without explicit delimiters.

Key technical aspects of Loreline include:

  • Haxe-powered Transpilation: The entire interpreter, parser, and runtime are written once in Haxe, then transpiled to C++, C#, JavaScript, Python, Lua, Java, and GDScript, enabling broad compatibility and native performance across various game engines and platforms.
  • Processing Pipeline: It transforms source text through a Lexer (identifying narrative vs. instructions), a Parser (generating an Abstract Syntax Tree with stable 64-bit IDs for saves), and an Interpreter (walking the AST and interacting with host applications).
  • Continuation-Passing Execution: The interpreter pauses at dialogue or choice points, allowing the host application to control execution flow and resume via callbacks, a model well-suited for game loops and event systems.
  • Native Integration: A thin wrapper layer ensures the Haxe-transpiled code feels natural and idiomatic in each target language, abstracting away Haxe from the end-user.
  • Rigorous Testing: Hundreds of automated tests cover every language feature across all target languages, ensuring robustness, preventing regressions, and guaranteeing consistent behavior.

Loreline's design emphasizes developer convenience and broad compatibility, abstracting away the intricacies of cross-platform development to allow creators to focus on the narrative. Its architecture, particularly the Haxe-driven transpilation and robust testing, positions it as a highly maintainable and adaptable tool for interactive storytelling.