Language toolingRuntimesModelsPolyglot

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.

Compiler

hara.lang

Book-based authoring, grammar-driven emission, scripts, modules, and language libraries.

Learn more
Language Models

hara.model

Target specifications for JavaScript, Lua, Python, Go, Dart, SQL, Solidity, xtalk, and annex languages.

Learn more
Runtimes

hara.runtime

Runtime clients and execution adapters for browsers, databases, containers, editors, and native tools.

Learn more
Typing

hara.typed

Typed xtalk analysis and target declaration emission.

Learn more
Shared Emitters

hara.common

Shared grammar, emit, preprocess, rewrite, and utility behavior.

Learn more
Generation

hara.seedgen

Seed generation and xtalk test scaffolding.

Learn more
Examples

Generated projects

Play projects and walkthroughs from src-build.

Learn more