v0.1.0 · Core language complete

Code that reads
like human speech.

Qingchu (清楚) is a programming language built around one principle: code should read like human speech and mathematical notation. Speech-like keywords, math syntax, typed bindings, and context markers — readable at a glance.

  • MIT licensed
  • Java 17+ interpreter
  • REPL included
hello.qc
!! A simple Qingchu program !!

let name = Bob
    name ts string

print Hello name_string .

math let price = 10 .
math let quantity = 5 .
math let total = price * quantity .
math print total .
Output Hello Bob
50
let
math
ts
One sentence, one statement — the vocabulary:
let ts print ask new if / else when define calculate math string
Features

What makes it readable

Every construct in Qingchu exists to make code clearer at a glance.

Shipped

Human notation, everywhere

Qingchu uses words and math symbols — not programmer punctuation. print, ask, when, define are speech-like keywords; >, +, *, = are plain math. A . ends a statement, like a sentence.

print Hello World .
speech-like indentation blocks
Shipped

Typed bindings

Every binding has a type, visible at the point of use. A binding is referenced as name_type — so name_string, count_number, flag_boolean. The type is part of the name.

let name = Bob name ts string
number string boolean
Shipped

Context markers

math and string drop the type suffix so code reads naturally. Inside math, total means total_number; inside string, name means name_string.

math let total = price * quantity . math print total .
math string
Shipped

Constants & reassignment

Mark a binding constant and it can't be reassigned. To change an existing binding, use new — an explicit, readable reassignment.

let pi = 3.14 pi ts constant number math new count = count + 1 .
constant new
Shipped

Speech-like control flow

Branch with if / else, loop with when — loops read like conditions ("when i < 3, print…"), and indentation opens and closes blocks.

math when i < 3 print Count: i . new i = i + 1 .
if / else when
Partial

Functions

Define functions with define … as … and return values with calculate. Parsing is complete; execution is on the roadmap.

define double(x) as x * 2 x ts number double ts number
define calculate
Why Qingchu

Clear at a glance

清楚 (qīngchu) means clear, distinct, easy to understand. That's the goal.

Readable by design

No cryptic punctuation. Statements end with a period, blocks are indented, and types travel with names — you can read Qingchu out loud.

Types you can see

name_string tells you exactly what's in the box. Constants are locked with constant, and reassignment is always explicit with new.

Errors that explain themselves

Every error says what went wrong, on which line, in which statement — in plain English, not stack-trace soup.

Get started

Run your first program in 3 steps

Requires Java 17 or higher. Compile the interpreter, then run a file — or open the REPL.

  1. 01

    Compile

    Build the Java sources from the repo:

    $ javac -encoding UTF-8 -d out src/main/java/qingchu/**/*.java
  2. 02

    Run a file

    Point the interpreter at any .qc program:

    $ java -cp out qingchu.Main run examples/hello.qc
  3. 03

    Or open the REPL

    Run with no arguments for an interactive session:

    $ java -cp out qingchu.Main
Vocabulary

The whole language fits on a card

Twelve keywords, three types, two context markers. Hover to explore.

let ts ats print ask new if else when define calculate const math string number string boolean !! comments !! \ escapes . terminator
Shipping in public

Status & roadmap

v0.1.0 — core language complete. Here's what works today and what's next.

  • v0.1.0 · shipped

    Core language complete

    let declarations with ts type blocks, math / string context markers, print output, ask input, new reassignment, if / else branching, when loops, the constant modifier, comments (!! and !!!), escapes, and readable errors with line numbers and statement context.

  • planned

    Function calling

    Parsing for define and calculate already works; execution is pending.

  • planned

    Lists and maps

    Collection types to round out the type system beyond number, string, and boolean.

  • planned

    code_* embedding modes

    Embed LaTeX, Python, Java, HTML, and CSS directly — plus LaTeX ↔ Unicode conversion.

  • planned

    Standard library

    Rounding helpers, string functions, and more — shipped with the interpreter.

Under the hood

A small, honest pipeline

Text → tokens → AST → run. Four packages, one Java entry point.

qingchu/ — project structure
qingchu/
├── src/main/java/qingchu/
│   ├── Main.java          — entry point
│   ├── lexer/             — text → tokens
│   ├── error/             — error types
│   ├── parse/             — tokens → AST
│   └── runtime/           — runs the AST
├── examples/              — sample .qc programs
├── docs/                  — website and documentation
└── README.md

Lexer → Parser → Interpreter

The lexer turns raw text into tokens (keywords, operators, terminators). The parser builds an AST from indentation-delimited statements. The runtime walks the tree with scopes, typed bindings, and values — reporting every failure as a readable one-line error.

Written in plain Java 17, no dependencies, tested with JUnit across the lexer, parser, and interpreter.

See it in action
Questions

Frequently asked

Why "Qingchu"?

清楚 (qīngchu) means clear, distinct, easy to understand. That's the goal: a language where the code is clear at a glance.

Why does the type appear in the variable name?

Because you almost never have to write it twice. Bindings are referenced as name_type (name_string, count_number, flag_boolean) so the type is visible at every point of use. When that gets noisy, the math and string context markers drop the suffix — inside math, total just means total_number.

How do I end a statement? How do I open a block?

A lone . ends a statement, like a full stop at the end of a sentence. Blocks are opened and closed by indentation — no braces, no end keyword. Use \ to escape characters like \., \_, or \\.

What do errors look like?

Specific and readable, always in the same shape: error <what went wrong> on line <N>(<which statement>) — for example error cannot reassign constant on line 12(new statement).

Can I use it yet?

Yes — clone the repo, compile with Java 17+, and run .qc files or the REPL. The core language (declarations, types, context markers, printing, input, branching, loops, constants, comments, escapes) is complete in v0.1.0. Function calling, lists/maps, and the standard library are planned.

Is it free? Who owns it?

Qingchu is open source under the MIT license. This project page is part of innovationearthprojects.org — head back there to reach the team and the rest of the project family.

Write your first sentence of code.

Clone it, compile it, and say print Hello World . — it takes 2 minutes.

Back to innovationearthprojects.org