hara
Language tooling, runtime integration, and polyglot system libraries.
hara groups the language-oriented parts of foundation: hara.lang for authoring and emission, hara.model for target specs, hara.runtime for execution, hara.typed for typed xtalk, and examples for generated projects.
0.1 First steps
hara.lang lets you write code once in Clojure data and emit it to many targets. The smallest useful program installs a runtime, defines a function, and emits it.
install a JS runtime and emit a function
^{:refer hara.lang/emit-as :added "4.0"}
(l/emit-as :js '[(defn greet [name]
(return (+ "Hello, " name)))
(greet "hara")])
=> "function greet(name){\n return \"Hello, \" + name;\n}\n\ngreet(\"hara\")"
The same form can be emitted to Lua by changing the language keyword. The grammar and template take care of syntax, statement terminators, and string operators.
emit the same logic to Lua
^{:refer hara.lang/emit-as :added "4.0"}
(l/emit-as :lua '[(defn greet [name]
(return (cat "Hello, " name)))
(greet "hara")])
=> "local function greet(name)\n return 'Hello, ' .. name\nend\n\ngreet(\"hara\")"
Subcategories
The Hara section covers the compiler, target models, runtimes, typed analysis, shared emitters, seed generation, and examples.
hara.lang
Book-based authoring, grammar-driven emission, scripts, modules, and language libraries.
hara.model
Target specifications for JavaScript, Lua, Python, Go, Dart, SQL, Solidity, xtalk, and annex languages.
hara.runtime
Runtime clients and execution adapters for browsers, databases, containers, editors, and native tools.
hara.typed
Typed xtalk analysis and target declaration emission.
hara.common
Shared grammar, emit, preprocess, rewrite, and utility behavior.
hara.seedgen
Seed generation and xtalk test scaffolding.
Generated projects
Play projects and walkthroughs from src-build.