← Kobo home

THE LANGUAGE

Readable by design.
Ready for .NET.

A guide to the Kobo language: consistent declarations, expressive constructs, and the full reach of the .NET ecosystem.

PREVIEW 0.1.8·LANGUAGE GUIDE
Download the full reference

Kobo is an AI-conscious, general-purpose programming language built for the .NET ecosystem. Designed for both human developers and AI code generation, it emphasizes syntactic consistency, expressive programming constructs, and reduced complexity. This is a practical reference to the language as it exists today — Kobo is still in preview, and the syntax may evolve.

01 / FOUNDATIONS

Program structure

Files can contain imports, a module declaration, types, functions, and extension blocks. Braces delimit blocks; identifiers are case-sensitive. Ordinary single-line statements generally do not need a semicolon.

IMPORTS AND MODULES
import System
import System/Collections/Generic

module Example/Inventory

[public] class:Item
{
    [public] property:string Name
}
  • Imports bring .NET namespaces into scope; they do not install packages.
  • Modules declare namespaces with forward slashes, as in Company/Commerce/Orders.
  • Member access uses dots: item.Name or Console.WriteLine.
  • Declaration colons touch both sides: write class:Item, not class: Item.

02 / VALUES

Types & variables

Built-in types include the familiar numeric types, bool, char, string, and object. Arrays, collections, dates, tasks, and other .NET types are available through imports.

DECLARATIONS
var:int count = 3
var message = "Welcome to Kobo"
var:string? nickname = null
var displayName = nickname ?? "Guest"
const:int MaximumAttempts = 5

var:int[] scores = [10, 20, 30]
var:List<string> names = ["Ada", "Grace"]
  • var:Type declares an explicit type; local var infers a type from its initializer.
  • Variables need an initial value. Constants use const and constant expressions.
  • ? marks nullable types, ?. performs conditional access, and ?? supplies a fallback.
  • Collection expressions use square brackets. Import System/Collections/Generic for List<T>.
UNION VARIABLES
var:union(int,string) result = 42
var:union(int,string) description = "Complete"

Union types are supported in variable declarations. The compiler generates a shared namespace-level type for each case list; standalone union declarations are not supported.

03 / ABSTRACTIONS

Functions & classes

Functions put the return type after function:. Parameters use Type name, and modifiers appear in square brackets. Classes, structs, records, interfaces, properties, indexers, inheritance, and generics are available.

FUNCTIONS AND GENERICS
[public, static] function:int Add(int left, int right)
{
    return left + right
}

[public] class:Box<T>
{
    [public] property:T Value { get; set; }
}

A function without a return value uses void. Generic constraints use familiar .NET conventions. A class can inherit from a base type or implement interfaces with is:

INHERITANCE
[public] class:Dog is Animal, ISpeaker
{
}

Global functions declared in the same module share a generated Global class.

04 / FLOW

Control flow & expressions

Kobo has familiar arithmetic, comparison, logical, conditional, and null-handling operators. Use if, else, switch, foreach, while, and for with brace-delimited blocks.

CONDITIONALS AND LOOPS
if score >= 90
{
    Console.WriteLine("Excellent")
}
else if score >= 60
{
    Console.WriteLine("Passed")
}

foreach name in names
{
    Console.WriteLine(name)
}

Equality alternatives can share a left-hand expression: if status == 200 || 201 || 204 compares status to each alternative. Use parentheses when mixing conjunctions and disjunctions.

05 / FUNCTIONS AS VALUES

Lambdas & delegates

Delegate types use (parameter-types)->return-type. A final delegate parameter can be called with a trailing lambda block.

A SMALL LAMBDA
var:(int)->int doubleValue = value => value * 2
var answer = doubleValue(21)

var:(string)->void write = message =>
{
    Console.WriteLine(message)
}

06 / DATA

LINQ queries

Kobo uses a select-first query form. Queries support filtering, equality joins, grouping, ordering, and projections. Multiline query statements require an explicit trailing semicolon.

FILTER, ORDER, PROJECT
var names = select person from people
            where person.Age > 30
            orderby person.Name
            project person.Name;

From-first from ... in ... queries are not supported. Use project { ... } to create an anonymous object projection.

07 / TOOLING

Build Kobo

Install the compiler with the .NET 11 SDK, then build a file or directory. A static Main produces an executable; without one, the output is a library.

CLI
dotnet tool install --global thinkmine.kobo.lang --prerelease
kobo build hello.kobo --output-directory ./build --name Hello
dotnet ./build/Hello.dll

Build all files in a folder with kobo build ./src; add --recursive to include subfolders. To compile Kobo source in an existing C# project, add thinkmine.kobo.lang.buildtools and use your normal dotnet build.

READY TO WRITE?

Take the next step.

Get started

This is a quick web reference. Download the full language guide for detailed examples, async functions, exceptions, extensions, and complete build instructions.

An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.