Welcome to the Zard Language
Zard is an experimental statically-typed programming language focused on deterministic memory management, predictable behavior, and a clean syntax designed for systems programming.
The language design and compiler are actively developed as part of the Zard project. The current compiler frontend is implemented in Java, where the source code is parsed and transformed into an Abstract Syntax Tree (AST).
From this representation, the compiler generates LLVM IR, allowing the creation of optimized native binaries through the LLVM toolchain.
Goals
Zard is designed as a learning and experimentation platform for building a modern systems language. The main goals of the project are:
- Create a language with deterministic memory behavior.
- Avoid uncontrolled reference sharing between objects.
- Encourage clear ownership of data rather than implicit aliasing.
- Maintain a simple and readable syntax.
- Generate efficient native code through the LLVM toolchain.
Memory Philosophy
One of the central ideas behind Zard is that memory ownership should be explicit and predictable. Instead of allowing references to be freely shared across the program, the language encourages a model where objects have a clear owner and their lifetime can be determined by the compiler.
This approach aims to reduce common problems such as memory leaks, dangling references, and unpredictable object lifetimes while still allowing low-level control when necessary.
Design Principles
- Statically Typed: Types are known at compile time.
- Deterministic Memory: Object lifetimes are predictable and controlled.
- Simple Syntax: The language avoids unnecessary punctuation and complex constructs.
- Native Compilation: Code is compiled to LLVM IR and then to native binaries.
- Clear Data Ownership: Data structures aim to minimize uncontrolled reference sharing.
Core Features
Zard currently focuses on a small but expressive set of language constructs.
- Variables and Expressions with static typing.
- Control Flow including
ifandwhile. - Structs for defining custom data types.
- Lists as dynamic collections provided by the runtime.
- Functions with typed parameters and return values.
Runtime
Some core structures, such as dynamic lists, are implemented in a small runtime written in C. This keeps the runtime simple while allowing the language to interact naturally with low-level memory operations.
Over time, the project may explore deeper interoperability with languages such as C and Rust, but this is currently a long-term objective rather than a stable feature.
Project Scope
Zard is primarily aimed at exploring the design of a modern systems programming language. The focus is on understanding how language features, memory management strategies, and compiler design interact in practice.
The language prioritizes clarity and predictability over feature count, keeping the core model simple while allowing experimentation with compiler techniques and runtime design.
Zard is a language for exploring how far simplicity and deterministic memory models can go in systems programming.