Skip to content
Halyard
Project
Source code on Codeberg (opens in new tab)

Search

Menu

Frequently Asked Questions

General

What is Halyard?

Halyard is a programming language designed for data science, statistical workflows, and scalable computation. It features:

  • Strong static typing with inference
  • Immutability by default
  • Pattern matching
  • A register-based bytecode VM
  • Clean, readable syntax inspired by Elm and ML

Why create another programming language?

Halyard aims to bring type safety and data contracts to data science workflows. It emphasizes:

  • Catching errors at compile time rather than runtime
  • Clear, actionable error messages with "did you mean?" suggestions
  • Excellent tooling out of the box (LSP, formatter, REPL)
  • A Polars-backed DataFrame library with compile-time type checking

What can I build with Halyard?

Halyard is designed for:

  • Data processing and analysis pipelines
  • Statistical workflows and reporting
  • ETL and data transformation
  • Scripts and automation
  • Command-line tools

Is Halyard production-ready?

Halyard is currently in alpha (v0.0.6). It's suitable for experimentation and small projects, but the language and APIs may change. We recommend waiting for 1.0 for production use.

Language

How does Halyard help with data quality?

Halyard's type system catches data errors at compile time:

  • Typed variables prevent passing the wrong data type to a function
  • Pattern matching forces you to handle all cases (e.g. Just/Nothing for missing values)
  • Result types make error handling explicit — no silent failures
  • DataFrame contracts ensure column types are validated

Does Halyard have null?

No. Halyard uses Maybe for optional values:

halyard
enum Maybe a = Just a | Nothing

This forces explicit handling of missing values — no null pointer exceptions.

How does error handling work?

Halyard uses Result for operations that can fail:

halyard
enum Result a e = Ok a | Err e

No exceptions for expected errors. Every function that can fail returns a Result, making error paths visible in the type signature.

Is Halyard strict or lazy?

Halyard uses strict (eager) evaluation. Values are computed immediately when bound. This makes performance predictable and debugging straightforward.

Does Halyard have type classes or higher-kinded types?

No. Halyard uses a simpler approach: parametric polymorphism (generics) with type inference. You can define generic types like enum Maybe a = Just a | Nothing and the compiler infers concrete types at each usage site.

Tooling

What editors are supported?

Halyard provides editor support through a Language Server (LSP) and tree-sitter grammar:

  • Helix: Full support (tree-sitter + LSP) with built-in configuration
  • Neovim: Full support via nvim-treesitter and nvim-lspconfig

See the Editor Setup Guide for configuration instructions.

Is there a package manager?

A package manager is planned but not yet implemented. Halyard currently ships with a comprehensive standard library that covers most common needs including List, String, Math, Decimal, Date, Time, Duration, DateTime, IO, HTTP, JSON, DataFrame, Distribution, Table, ValueLabelSet, Result, and Maybe.

How do I format code?

bash
halyard fmt

Formatting is opinionated and consistent. Format-on-save is available in Helix and Neovim via the LSP.

How do I run tests?

A built-in testing framework is planned but not yet implemented. See the Testing page for the intended design.

Performance

How fast is Halyard?

Halyard compiles to bytecode that runs on a register-based VM. For data-intensive workloads, the Polars-backed DataFrame library provides native-speed operations with automatic SIMD and parallel execution.

How is memory managed?

Halyard uses garbage collection with a mark-sweep strategy optimised for functional programming patterns (many short-lived allocations). The GC threshold is tunable.

Can Halyard handle large datasets?

Yes. The DataFrame library is backed by Polars and supports lazy evaluation of query plans, predicate pushdown, and projection optimisation. DataFrames can read CSV, JSON, and Parquet files (including from remote URLs), and security controls limit row counts and sandbox file access.

Interop

Can Halyard call external code?

FFI (Foreign Function Interface) is on the roadmap but not yet implemented. Planned targets include Rust, Python, R, and Julia interop.

Is there JavaScript/WASM support?

WASM compilation is on the roadmap but not yet implemented.

Community

How can I contribute?

See the Contributing Guide. We welcome:

  • Bug reports
  • Documentation improvements
  • Feature proposals
  • Code contributions

Where can I get help?

Is Halyard open source?

Yes, Halyard is open source under the AGPL-3.0 license. The source code is on Codeberg.

Comparison

Guarantees compares each of Halyard's guarantees with the tools Python, R, Julia, SQL/dbt and Stata offer for the same purpose, and with where those tools fall short.

How does Halyard compare to Python for data science?

Halyard catches errors at compile time that Python only finds at runtime. The type system ensures column names, data types, and function signatures are correct before your pipeline runs. The DataFrame library matches Polars performance while adding type-checked column operations.

How does Halyard compare to R?

Both target statistical workflows, but Halyard adds:

  • Compile-time type checking (no runtime "object of type 'closure' is not subsettable" errors)
  • A modern module system
  • Consistent syntax without R's historical quirks
  • First-class support for Polars DataFrames alongside Date, Time, Decimal, and Distribution types

How does Halyard compare to Elm?

Both emphasize helpful error messages and simple syntax, but:

  • Halyard targets data science, not web frontends
  • Halyard has DataFrames, HTTP, file I/O, and a rich standard library
  • Halyard uses run for file-based code organisation instead of Elm's Cmd/Sub model