Kongue_

The small language behind every Kreato Linux project: kpkg runfiles, Jumpstart decfiles and more. Learn it in fifteen short lessons, right in your browser.

playground.kg
# edit me, then press Run
name: "Kreato Linux"

func greet {
    print "hello from $name, $1"
}

main {
    greet "tinkerer"
    greet "builder"
}
Lessons

“Write programs to work together.” — Doug McIlroy on UNIX Philosophy

For more up-to-date info, we recommend looking at kongue(5)

What is Kongue?

Kongue is the language of all Kreato Linux projects. It is a tree-walking interpreted DSL (Domain-Specific Language). It is inspired by YAML and sh among many other languages.

It started as a concept in early 2025, when kpkg started feeling the limits of the old sh-backed runFile format.

Kongue is designed to be simple and modular. It is used by Kreato Linux projects including kpkg and Jumpstart. Projects embed the interpreter and decide which functions, commands, and macros they provide. For example, kpkg’s runFile 3 format is based on Kongue but adds its own package lifecycle and build context.

Features of Kongue

Kongue currently supports:

  • String, boolean, list, and object-style values
  • Variable interpolation with $name and ${name}
  • Objects and property access
  • If/else statements and regular-expression matching
  • For loops with break and continue
  • Custom functions and local variables
  • Virtual or host-backed file operations, depending on the embedding project
  • Hooks for command execution and project-specific macros

The language is still growing. Planned work includes while loops, math support, a generic standard library, and import/include support.

Why Kongue?

The older solutions were either too dependent on the external environment (sh) or did not provide enough structure (ini). Embedding Lua or Nimscript was costly and required hacks and external libraries. Kongue keeps the syntax small while allowing each project to provide the behavior it needs.

Browser limitations

The examples in these lessons run as JavaScript in your browser. They can print values and write to a virtual filesystem, but they cannot spawn processes, access your filesystem, or read your environment. Any exec command reports this limitation instead of running.

The browser runner also uses a Web Worker. This keeps a long-running example from freezing the page. The worker is stopped after a short timeout.

How the lessons work

This course starts with standalone Kongue. We will begin with values and output, then build up to conditions, loops, functions, files, and objects. At the end, we will look at how a project embeds Kongue and changes its behavior through hooks.

The code examples are interactive. Press Run to execute an example, or press Edit to change it first. The output appears below each block.

  1. 01 Your first Kongue program
  2. 02 Comments and output
  3. 03 Strings and variables
  4. 04 Lists
  5. 05 String manipulation
  6. 06 Objects
  7. 07 Conditions
  8. 08 For loops
  9. 09 continue and break
  10. 10 Custom functions
  11. 11 Local and global variables
  12. 12 Writing virtual files
  13. 13 Why exec is different in the browser
  14. 14 Entry points and embedding
  15. 15 A complete small script