AppendixExamples

Examples Overview

The checked-in examples and what each one proves about the current Kira implementation.

Every example in examples/ is there to prove something about the current toolchain.

Backend Matrix

ExampleProven backendsWhat it demonstrates
hellovm, llvm, hybridsmall runnable entrypoint and VM-side struct printing
arithmeticvm, llvm, hybridsmall multi-function arithmetic subset
imports_demovm, llvm, hybridimports and local helper calls
report_pipelinevm, llvm, hybridordinary runnable subset plus richer struct declarations
geometry_storyvm, llvm, hybridsimilar subset with frontend-only struct/class surface alongside runnable top section
status_boardvm, llvm, hybridsame pattern for small app-shaped data
callbacksllvm, hybridnative callback interop
callbacks_chainllvm, hybridmultiple callback-driven native calls
sokol_trianglellvm, hybridmanifest-driven autobinding plus a real triangle proof
sokol_runtime_entryllvm, hybridsimilar Sokol flow with a slightly different state layout
hybrid_roundtriphybridruntime/native/runtime call flow
complex_language_showcasefrontend/check-focusedconstructs, lifecycle hooks, builder/content, namespaced annotations
ui_libraryfrontend/check-focusedconstruct-driven library-style surface

How To Use The Examples

If you want:

  • the smallest runnable example, start with examples/hello/
  • a real native callback path, open Callbacks
  • a mixed runtime/native example, open Hybrid Roundtrip
  • the strongest FFI/autobinding proof, open Sokol Triangle

The current hello example also shows the built-in Foundation package and the default VM path printing a named struct value.

Examples vs Tests

The examples folder is app- and workflow-oriented.

The tests/ corpus is more explicit about expectations:

  • tests/pass/run/ for successful execution cases
  • tests/pass/check/ for frontend/check-only cases
  • tests/fail/ for expected diagnostics

When you are unsure whether a feature is just an example shape or a tested backend contract, check the corpus.

On this page