Core Features
-
simple -
Originated from Python and Golang, incorporating functional language features -
Absorb language elements such as statements, expressions, conditions, loops, etc -
Type and data separation, Schema declaration configuration definition
-
-
stable -
Strongly immutable constraint -
Type derivation and type check at compile time -
Rule policy definition: attribute centered constraint expression, query results based on constraints -
Testable: the language has built-in assert assertion, print printing and testing tools
-
-
Scalable -
Configuration Merge: Configure dependency graph substitution at compile time -
Configuration attribute operators: meet the requirements of configuration override, merge, add and delete -
Configuration reuse: rich built-in data structure and syntax semantics, easily extending the same configuration to different scenarios
-
-
Engineering -
Schema single inheritance and declarative model reuse and assembly -
Automatic configuration of tools and API granularity "add, delete, change and query" -
Rich built-in functions and system libraries -
Dynamic import of top-level data -
Code organization: modules and packages -
Plug in system : Reuse common programming language ecology. -
OpenAPI model support : bidirectional conversion between Swagger and Schema, Kubernetes CRD conversion to Schema
-
-
High performance -
Cooperate with LLVM optimizer, support compiling to local code, WASM and other formats, and execute efficiently
-
Installation&Documentation
schema Fib: n1: int = n - 1 n2: int = n1 - 1 n: int value: int if n <= 1: value = 1 elif n == 2: value = 1 else: value = Fib {n: n1}.value + Fib {n: n2}.value fib8 = Fib {n: 8}.value
kcl ./samples/fib.k
fib8 : twenty-one