Introduction

hica is an expression-oriented programming language designed to feel approachable without giving up type safety or performance.

It is implemented in Koka and inherits Koka’s algebraic effect system and Perceus memory management.

Why hica?

Most programming languages force you to choose: easy to learn or safe and fast. hica gives you both.

hica stands for Hindley-milner Inference Compiler with Algebraic effects

How It Works

hica compiles through a multi-stage pipeline:

.hc source → Lex → Parse → Desugar → Type Check → Emit Koka (.kk) → Koka Compiler → C/JS/WASM

The compiler itself is written in Koka and uses algebraic effects to manage compiler state and diagnostics.

Because the final target is Koka, hica programs inherit the full Koka runtime: its standard library, Perceus memory management, and the ability to compile to C (native), JavaScript (browser/Node), or WASM.

What You Get for Free

By targeting Koka, hica doesn’t need to reinvent:

A Quick Example

// filter keeps matching elements, map transforms each, fold reduces to a single value
fun main() {
  let nums = [1, 2, 3, 4, 5]
    |> filter((x) => x % 2 == 0)
    |> map((x) => x * 10)
    |> fold(0, (sum, x) => sum + x)

  println(nums)
}

Technical Stack

Component Approach
Implementation Koka 3.x
Parsing Recursive descent with Pratt expression parsing
Type system Hindley-Milner with unification
Name resolution Declaration-aware marshalling (hc_ prefix)
CLI argument parsing klap (clap-inspired, in-tree)
Memory management Perceus (inherited from Koka target)
Backend target Koka (.kk) -> C / JS / WASM via Koka

Inspirations

Next Steps