About this project

kanso (簡素) is a programming language built around the idea that a source file should contain only decisions. Anything a style guide, linter or code review would normally enforce by convention is instead enforced by the compiler: non-canonical spacing, indentation or blank-line placement is a syntax error, names use snake_case, declarations and record fields are alphabetically ordered, and overloads sit adjacent with the most specific first. Because every program has exactly one canonical rendering, no formatter exists. Semantics emphasised by the README include purity and effects as descriptions: print and the >> sequencing operator produce a description of work that the runtime executes, and the check command with --plan shows that description instead of running it. Failure is a value rather than an exception: err reason and none propagate until an overload dispatches on them, so division by zero and out-of-range indexing return values instead of crashing. Dispatch works on literals, concrete types and generics, most-specific first. The language supports single-constructor record types with typed fields, positional construction and destructuring in both positional and keyed-subset forms; flat juxtaposition application with no commas anywhere; arbitrary-precision integers; string interpolation; lists with 1-based indexing; a dot pipe whose piped value becomes the first argument; and lambdas. Additional compile-time checks reject unused bindings, unused expressions, rebinding before use, and shadowing of declared functions, types or builtins. Indexing with xs[i] or m[k] is strict, while at xs i expresses expected absence. Modules are directories: a module spans any number of files sharing one namespace, names prefixed with underscore are module-private, and an unused private declaration is an error. The README stresses that the error corpus in tests/golden matters as much as the success corpus. A v0 section lists acknowledged approximations and open points: the endpoint rule is checked at runtime rather than compile time; generic parameters never bind err or none; canonical declaration order is an interpretation; the pipe target parses as one application and a non-callable target fails at runtime; the if form is provisional; the native int is int64 and overflows trap as a defect in compiled binaries, unlike the interpreter's bigint. Not yet implemented are typesets, record update, build regions, processes, effect polymorphism and an LSP. Editor support is a single TextMate bundle usable in JetBrains IDEs and VS Code for .kso files. Development uses cargo test, covering unit tests and a golden-file corpus; the project is MIT licensed. Documentation, the specification and the compiler notes are published on a GitHub Pages site.