Legacy Implementation: jazz-hs
Relevant source files
The following files were used as context for generating this wiki page:
jazz-hs represents the historical reference implementation of the Jazz programming language. It serves as a read-only repository of early design decisions and implementation evidence for the language's core features. In the current project governance, jazz-hs is used strictly for historical reference and verification of implemented subset behavior, while all active development has shifted to jazz-next/.
Sources: README.md:19-25, AGENTS.md:4-6, jazz-next/README.md:5-7
Project Status and Governance
As the project evolved, jazz-hs was designated as a legacy component. It is no longer normative for current language behavior. Developers and AI agents are instructed to treat the directory as read-only.
| Attribute | Status |
|---|---|
| Permissions | Read-Only |
| Role | Historical Reference / Evidence |
| Active Alternative | jazz-next/ |
| Authority | Non-normative (Secondary to docs/spec/*) |
Sources: AGENTS.md:4-6, README.md:21-25
Architecture and Build System
jazz-hs is built using the Haskell toolstack. It utilizes the stack build tool and a package.yaml file to define dependencies and project metadata.
Dependency Management
The implementation relies on several key Haskell libraries for parsing, diagnostic reporting, and low-level code generation. Notably, it includes local copies of LLVM-related dependencies.
| Dependency | Purpose |
|---|---|
megaparsec | Parser combinator library for language syntax. |
diagnose | Error reporting and diagnostic rendering. |
qbe | Backend for the QBE compiler infrastructure. |
llvm-hs | (Local) LLVM bindings for code generation. |
haskeline | Terminal interface for the CLI. |
Sources: jazz-hs/package.yaml:23-53, jazz-hs/stack.yaml:48-55
Build and Execution Flow
The project defines a primary library and an executable named jazz-exe. A shell script, run.sh, facilitates the execution of the compiler by piping its output to node if the generated code is intended for a JavaScript runtime environment.
The run.sh script automates this process:
COMPRES=$(stack exec jazz-exe $1)
if [ $? -eq 0 ]
then
echo "Generated code:\n$COMPRES\n\nRunning...\n\n"
node -e $COMPRES
fi
Sources: jazz-hs/package.yaml:69-80, jazz-hs/run.sh:2-8
Historical Implementation Scope
Based on the legacy codebase and project documentation, jazz-hs provided the baseline for several core language features.
- Purity Enforcement: Early implementation of stub purity enforcement for direct
!callee calls. - Syntax: Implementation of dot-terminated source forms and brace-bodied module declarations.
- Backend Exploration: Evidence of both LLVM (via
llvm-hs) and QBE (viaqbe) as potential compilation targets. - Functional Paradigms: Support for currying, partial application, and immutable bindings.
Sources: README.md:11-17, jazz-hs/package.yaml:51, jazz-hs/stack.yaml:55
Comparison with Current Development
The transition from jazz-hs to jazz-next involved a shift in focus toward a more refined compiler architecture. While jazz-hs included exploration of LLVM, jazz-next focuses on a structured pipeline involving a dedicated analyzer-facing AST and sophisticated warning configurations.
Sources: README.md:21-25, jazz-next/README.md:1-12
Conclusion
jazz-hs serves as the foundational "historical reference" for the Jazz language. While it has been superseded by jazz-next/ for all active development, it remains a critical resource for understanding the project's origins, including its initial experiments with LLVM backends and functional syntax.
Sources: README.md:21-23, AGENTS.md:4-6