Use the immutable release package when building an application. Clone the repository only when developing the compiler or testing an unreleased change.
- Node.js 22.14.0+ - For the supported lix/package tooling path and npm scripts
- Elixir 1.14+ - For Phoenix/Ecto ecosystem and generated code testing
- Git - Required for compiler contributors and some dependency sources
- Neko runtime on Linux - Required by the
haxelibexecutable bundled with Haxe 4 toolchains installed through lix. On Ubuntu/Debian, install it withsudo apt-get install neko.
# Verify prerequisites
node --version # Should be 22.14.0 or higher
elixir --version # Should be 1.14.0 or higher
git --version # Any recent versionCreate or enter your application workspace, then install the latest Reflaxe-built package through Lix:
npm install --save-dev lix
npx lix scope create
REFLAXE_ELIXIR_TAG="$(curl -fsSL https://api.github.com/repos/fullofcaffeine/reflaxe.elixir/releases/latest | sed -n 's/.*"tag_name":[[:space:]]*"\([^"]*\)".*/\1/p' | head -n 1)"
REFLAXE_ELIXIR_VERSION="${REFLAXE_ELIXIR_TAG#v}"
PACKAGE="reflaxe.elixir-${REFLAXE_ELIXIR_VERSION}.zip"
RELEASE_URL="https://github.com/fullofcaffeine/reflaxe.elixir/releases/download/${REFLAXE_ELIXIR_TAG}"For a reproducible or security-sensitive installation, verify the versioned ZIP before asking Lix to install the same immutable asset:
curl -fL -o "$PACKAGE" "$RELEASE_URL/$PACKAGE"
curl -fL -o "$PACKAGE.sha256" "$RELEASE_URL/$PACKAGE.sha256"
if command -v sha256sum >/dev/null 2>&1; then
sha256sum --check "$PACKAGE.sha256"
else
shasum -a 256 --check "$PACKAGE.sha256"
fiThe command must report OK. Each package embeds its exact version, release tag, and source commit;
maintainers additionally verify GitHub's hosted digest and signed immutable-release attestation. See
Releasing.
After the optional verification step, install the same immutable asset:
npx lix install "https://www.github.com/fullofcaffeine/reflaxe.elixir/releases/download/${REFLAXE_ELIXIR_TAG}/${PACKAGE}"
npx lix downloadThe www.github.com host is intentional: it keeps the release ZIP on Lix's generic
immutable-archive path instead of treating the URL as a source repository dependency.
Publishing on haxelib.org is not required. If a project intentionally uses Haxelib's local package repository, download and verify the same GitHub Release ZIP as shown above, then install that file:
haxelib install "$PACKAGE"This installs the prepared package from disk. It does not contact haxelib.org for
reflaxe.elixir.
Haxelib's git command and Lix's github: source scheme can fetch this repository, but neither is
a supported one-step application install for Reflaxe.Elixir.
The default branch is the compiler's development workspace. Its Haxe sources live in several roots,
while a normal Haxelib consumer receives one package classpath containing prepared .cross.hx
files. Haxelib and Lix do not run a library-provided post-install build that creates that layout.
The repository's extraParams.hxml supplies compiler options when Haxe runs; it is not an install
hook and cannot safely replace the packaging step.
For an unreleased compiler revision, use the explicit source-checkout setup. It records all required source roots in the consuming project. For ordinary applications, use the immutable GitHub Release ZIP.
Reflaxe.Elixir uses Lix as the project dependency manager instead of asking users to install the compiler globally from the Haxelib registry. The primary application install is a versioned, Reflaxe-built ZIP from GitHub Releases:
versioned GitHub Release ZIP
↓ npx lix install <immutable URL>
haxe_libraries/reflaxe.elixir.hxml
↓ npx lix download
project-local, reproducible compiler input
This is a better fit for this project because:
haxe_libraries/*.hxmlis committed, so dependency changes are ordinary reviewed Git changes;- a project can pin a release archive; source-checkout testing can separately pin an exact Git commit with the required development HXML setup;
- different projects can use different Haxe/compiler/library versions on the same machine;
npx lix downloadreconstructs the checked-in dependency state and reuses Lix's local cache;- unreleased fixes can be tested from an exact pushed Git SHA through the documented source-checkout setup, without publishing an unrelated registry release.
For example, PhoenixHX browser builds pin Genes to one fetchable commit:
# @install: lix --silent download "gh://github.com/fullofcaffeine/genes-ts#<exact-sha>" into genes-ts/<version>/github/<exact-sha>Lix is not a new library format and does not make Haxelib incompatible. It can consume Haxelib packages, GitHub/GitLab repositories, and immutable HTTP archives. Reflaxe.Elixir's GitHub release asset is deliberately a built Haxelib-style package because that is the correct flattened compiler layout. We continue to test installation through the Haxelib-compatible package format, but GitHub Releases plus Lix are the recommended distribution path for this project. Some third-party dependencies may still come from Haxelib.org through Lix; applications do not need to install Reflaxe.Elixir itself from the Haxelib server.
See the Lix project documentation for its scoped dependency model and supported source schemes, and Source Checkout vs Release Package Layout for why this compiler needs a built release artifact rather than a raw source archive.
Continue with the Quickstart, Phoenix New App, or Gradual Adoption guide.
git clone https://github.com/fullofcaffeine/reflaxe.elixir.git
cd reflaxe.elixir# Install all Node.js dependencies (including lix)
npm installThis automatically installs:
- lix - Modern Haxe package manager
- Local project dependencies for build orchestration
# Check lix is available
npx lix --version
# Check Haxe is available
haxe --version
# If `haxe` is not on your PATH, use the project-local shim (provided by `lix` + `.haxerc`):
./node_modules/.bin/haxe --versionExpected Output:
Haxe Compiler 4.3.7
# Download the pinned toolchain + libraries (per `.haxerc` + `haxe_libraries/*.hxml`)
npx lix downloadThis ensures the compiler/test/example dependencies are available (for example tink_macro, tink_parse, and other tink_* libs).
# Install Phoenix, Ecto, and other Elixir dependencies
mix deps.get# Run comprehensive test suite
npm testThis should complete without failures.
Reflaxe.Elixir has a source mapping design (to map generated .ex back to .hx), but it is
currently experimental and not fully wired end‑to‑end in the AST pipeline.
See docs/04-api-reference/SOURCE_MAPPING.md for the current status and next steps.
❌ Traditional Haxe Installation Problems:
- Global Haxe versions cause "works on my machine" issues
- Different projects need different Haxe versions
- Library version conflicts between projects
- Manual dependency management
✅ lix Package Manager Benefits:
- Project-specific Haxe versions defined in
.haxerc - Locked dependency versions in
haxe_libraries/ - Exact GitHub commits/releases plus pinned Haxelib sources when appropriate
- Zero global conflicts between projects
{
"version": "4.3.7",
"resolveLibs": "scoped"
}Pins the Haxe compiler version and enables scoped library resolution for lix.
Pins Haxe library versions and classpaths for reproducible builds (managed by lix).
{
"scripts": {
"test": "npm test",
"test:quick": "npm run test:quick",
"test:examples": "npm run test:examples"
}
}This repo uses lix to manage the Haxe toolchain (via .haxerc) and Haxe libraries (via haxe_libraries/*.hxml).
Use either a normal haxe install on your PATH or the lix-provided shim at ./node_modules/.bin/haxe.
# ✅ Correct
haxe build.hxml
haxe --version
# ✅ Also correct (lix shim)
./node_modules/.bin/haxe build.hxml
./node_modules/.bin/haxe --version# Compile a simple example
cd examples/01-simple-modules
haxe BasicModule.hxml
# Run full tests
npm testReflaxe.Elixir’s source mapping design (mapping generated .ex back to .hx) is currently
experimental and not yet fully wired end‑to‑end in the AST pipeline.
See docs/04-api-reference/SOURCE_MAPPING.md for the current status and next steps.
# 1. Start file watcher
mix haxe.watch
# 2. Make changes to Haxe files
vim src_haxe/MyModule.hx
# Files automatically recompile
# 3. Debug compile errors
mix haxe.errors --format json# 1. Make changes to compiler
vim src/reflaxe/elixir/ElixirCompiler.hx
# 2. Test Haxe compiler changes
npm run test:quick
# 3. Test generated Elixir code integration
npm run test:mix
# 4. Full validation
npm testreflaxe.elixir/
├── .haxerc # Haxe version specification
├── package.json # npm dependencies and scripts
├── mix.exs # Elixir dependencies and config
├── haxe_libraries/ # lix-managed Haxe dependencies
├── src/reflaxe/elixir/ # Compiler source code
├── std/ # Phoenix/Elixir type definitions
├── test/ # Snapshot tests for compiler
├── examples/ # Working example applications
│ ├── todo-app/ # Main Phoenix LiveView example
│ └── simple-modules/ # Basic compilation examples
└── docs/ # Complete documentation (you are here!)
Solution: Install Haxe and/or add it to your PATH.
# Preferred
haxe --version
# Project-local shim (provided by `lix` + `.haxerc`)
./node_modules/.bin/haxe --versionSolution: Run lix download to install dependencies
npx lix downloadSolution: Verify all prerequisites and run setup in order
# Complete setup sequence
npm install
npx lix download
mix deps.get
npm testSolution: This is a self-referential library issue. See Troubleshooting Guide for detailed solutions.
Solution: Path resolution issue with test setup. This occurs when test configurations reference incorrect paths. Verify you're in the correct directory and all paths in .hxml files are accurate.
Solution: Ensure you're in the project root directory
# Check you're in the right directory
ls .haxerc # Should exist
pwd # Should end with /reflaxe.elixirSolution: Source mapping is currently experimental; .ex.map files are not emitted by default builds yet.
See docs/04-api-reference/SOURCE_MAPPING.md.
Solution: Source mapping is currently experimental; if you’re working on it, start from
docs/04-api-reference/SOURCE_MAPPING.md and add integration coverage under test/snapshot/core/source_map_validation/.
# Verify each component
node --version # Node.js
npx lix --version # lix package manager
haxe --version # Haxe (project toolchain)
mix --version # Elixir/Mix# Re-download the toolchain + libraries (lix cache)
npx lix download
# If your lix cache is corrupted, remove it and retry:
# rm -rf ~/haxe
# Clean reinstall Elixir dependencies
mix deps.clean --all
mix deps.get
# Verify with tests
npm testreflaxe.elixir/
├── .haxerc # Haxe version specification
├── package.json # npm dependencies and scripts
├── mix.exs # Elixir dependencies and config
├── haxe_libraries/ # lix-managed Haxe deps (pinned via *.hxml)
├── src/reflaxe/elixir/ # Haxe→Elixir compiler source
├── std/ # Elixir extern definitions
├── test/ # Haxe compiler tests
├── examples/ # Working examples
└── node_modules/ # npm dependencies (including lix)
Reflaxe.Elixir uses a dual-ecosystem architecture:
- Purpose: Develop and test the compiler itself
- Tools: lix (Haxe toolchain) + snapshot test runner under
test/ - Command:
npm run test:quick
- Purpose: Test and run generated code
- Tools: Phoenix, Ecto, ExUnit, and the Elixir/OTP runtime. See the OTP Support Contract for the exact compiler-supported subset.
- Command:
npm run test:mix
- Purpose: Validate end-to-end workflow
- Command:
npm test(runs both ecosystems)
This setup ensures that both the compiler development and generated code quality are thoroughly validated.
After successful installation:
- Quickstart Tutorial - Build your first Haxe→Elixir project in 5 minutes
- Source and Package Layout - Understand consumer and compiler-checkout layout conventions
- Development Workflow - Learn day-to-day development practices
- Phoenix Integration - Build Phoenix applications with Haxe
- User Guide - Complete application development documentation
- Troubleshooting Guide - Comprehensive problem-solving reference
- API Reference - Technical reference for annotations and APIs
- Compiler Development - For contributors to the compiler itself
Ready to code? Continue to Quickstart Tutorial for your first Haxe→Elixir project.