v0.1 draft · built on GraalVM Truffle

A model that can't say “I don't know” will make something up.

DVLang is a programming language where not knowing is a first-class result. Every value is either known, with its grounds, or abstained, with a reason. The compiler won't let either side of that go unhandled, whether the code was written by a person or a model.

  • Abstaining is a typed return value
  • Unhandled abstention is a compile error
  • Small, regular syntax
capital.dvchecked
abstained
Atlantis
Japan
Tokyo
Kenya
Nairobi
Atlantis
no record
01 / The problem

The RLHF “Golden Retriever” problem

Large language models are next-token predictors. In fine-tuning (RLHF), human raters reward helpfulness and penalize uncooperative answers. Over millions of cycles the model learns a dangerous heuristic: “Refusing a prompt is bad. Providing an answer is good.” DVLang moves the answer to that problem out of the model's training and into the language.

Three ideas

Not knowing is a value

Functions return known results or reasoned abstentions. Both are typed, both are checked.

Every claim has a source

Known values can carry their grounds, so a reader can trace an answer back to where it came from.

Small, regular syntax

Few keywords and one idiom per task. Easier for people to review, and fewer ways for a model to drift.

02 / The lang-chain hell

Stop begging the LLM to follow your orders.

Today, rules live in prose: capital letters, repeated warnings, output parsers and retry loops. In DVLang the rules are types. The compiler enforces them, and a model has nothing to talk its way around.

agent.py · pleadingprose
prompt = """You are a helpful assistant.
ALWAYS respond in valid JSON.
NEVER invent order IDs.
If you are not sure, say "unknown".
PLEASE follow the schema EXACTLY."""
for attempt in range(5):
    out = llm.invoke(prompt + user_input)
    try:
        data = parser.parse(out)
        break
    except OutputParserException:
        prompt += "\nInvalid JSON. Try again."
agent.dv · declaredtypes
// The schema is the type.
fn lookup(id: OrderId) -> Order? validate strict {
  know orders[id] as o => o
  else => abstain "unknown order {id}"
}
// Not sure is a value, not a failure.
// Invalid output never reaches the caller.
// No retries. No capital letters.

instructions → types

Shape, allowed values and required fields are declared once, in the signature.

refusal → return value

abstain is a typed outcome, so “I don't know” is something the caller handles.

validation → opt-in

Add validate to any function that needs it. Results are checked before they leave.

Teach the machine to say no.

The language is a v0.1 draft. The interpreter is not released yet; this site documents the design as it stands.