Introduction
The KCL team is pleased to announce that KCL v0.13.0 is now available! This release has brought three key updates to everyone
- A more expressive and consistent KCL language: ES6-style config entry shorthand, more flexible lambda expressions, friendlier multi-line strings and equality semantics.
- A more complete standard library and cross-language API: new
reduce,json.merge,file.readbase64andnet.is_IPv6functions, RFC 7396 JSON Merge Patch support, Source Map v3 output, and line-level test coverage. - A faster and more reliable toolchain and IDE: significant compilation and evaluation performance improvements, package-wide linting, dry-run formatting, and richer LSP features.
KCL is an open-source, constraint-based record and functional language hosted by Cloud Native Computing Foundation (CNCF). KCL improves the writing of numerous complex configurations, such as cloud-native scenarios, through its mature programming language technology and practice. It is dedicated to building better modularity, scalability, and stability around configurations, simpler logic writing, faster automation, and great built-in or API-driven integrations.
❤️ Special Thanks
We would like to extend our heartfelt thanks to all community contributors who participated in the iteration from version v0.12 to v0.13. The following list is in no particular order.
@Peefy, @zong-zhe, @liangyuanpeng, @johngmyers, @priyansh-saxena1, @jfharden, @aliazlan4, @vlada-dudr, @turner-hemmer, @Arpit529Srivastava, @DCchoudhury15, @jschoone, @ytsarev, @f4z3r, @rtainaan, @31puneet, @Viscous106, @56steve, @neo0007777
📚 Key Updates
🔧 Core Features
Language
- KCL supports ES6-style shorthand entries in config and schema instance literals. A bare identifier is equivalent to a
key = keyentry and can be mixed with ordinary entries, e.g.,{ name, age = 18 }is equivalent to{ name = name, age = 18 }. - Lambda expressions support braces around the argument list, which allows arguments to be written on multiple lines. When braces are used, a return type must be provided.
func = lambda {
x: int,
y: int = 5
} -> int {
x + y
}
- Multi-line (triple-quoted) strings are automatically dedented: the common leading whitespace of all non-empty lines is stripped, so embedded text can be indented naturally with the surrounding code.
s = """
foo
bar
""" # "foo\nbar\n"
- The
!=operator now supports lists, dicts and schemas in addition to primitive types, e.g.{} != {k = "v"}and[0] != [1]. - Quantifier expressions (
all/any/filter/map) support selector expressions as the iteration target, including safe navigation selectors, so nested collections can be iterated directly, e.g.all y in data?.items { y > 0 }. - The YAML output can opt into multi-line block-scalar strings via the new
multiline_stringencode option, and YAML block-scalar trailing newlines are preserved. - Fixed
math.floorto return an integer instead of a float. - Fixed string formatting to apply width, alignment and fill specifiers to string values, e.g.
"{:*^10}".format("hi")yields"****hi****". - Fixed a series of evaluator issues around lazy scope caching, schema attribute overrides, mixin replay, forward references and config entries shadowing enclosing schema attributes, making evaluation results more stable and predictable.
Toolchain
kcl lint ./...: the lint command now supports the./...pattern to lint all KCL packages under the current or a given directory, one package per directory, likego build ./....kcl fmt --dry-run: report the files that require formatting without modifying them, which is convenient for CI checks. The formatter also honors.editorconfigindentation settings, keeps inline trailing comments on the same line, and leaves the source unchanged when parsing fails.kcl testprovides line-level coverage: the test API collects per-file line coverage information for test runs.- Bundle a KCL program into a single file for easy distribution and execution.
- Performance: this release includes a large set of performance improvements — a faster hash map for compiler indexes, small-string optimization for config keys, monotonic AST indices instead of UUIDs, cached path canonicalization and package resolution during loading, memoized fully-qualified-name lookups with incremental updates, and skipping unused package compilation passes. Compilation and evaluation are observably faster on medium and large projects.
- Release artifacts now cover more platforms, including Linux glibc 2.17 and musl (Alpine Linux) builds.
IDE
- The KCL language server can run unit tests by clicking a CodeLens above each test function.
- The language server can auto-update dependencies through the
kcl modtoolchain and reacts tokcl.mod/kcl.yamlmodification events. - The language server walks up the directory tree to find the
kcl.mod/kcl.yaml/kcl.workworkspace root, respects.gitignorein the workspace file watcher, and speeds up import completion. - Fixed inherited attribute lookup on schema resolution, wrong import completions, and missing schema type recovery in the language server.
API
- Source Map v3 output:
kcl run --sourcemap <file>writes a Source Map v3 document alongside the generated YAML, so downstream tooling can resolve generated lines back to the originating.kfile, line and column. - Schema type API extensions: the
KclTypeschema type now carries index signature and function type information, and a__kcl_info_meta__marker is emitted for attributes decorated with@info(type="attr"). - New
GetSchemaTypeMappingUnderPathRPC: returns schema type mappings keyed by package name. Different fromGetSchemaTypeMapping, schemas imported from external dependency packages are keyed under their own package name instead of being flattened into__main__. - The C API honors the
error_formatoption on the error envelope, supporting machine-readable diagnostic output formats (pretty,short,arcanist,sarif). ExecProgramArgssupports running with onlyk_code_list, and unrequested format encoders are skipped when--formatis set.
📦️ Standard Libraries and Third-Party Libraries
Standard Libraries
- New builtin function
reducethat applies a reducer function cumulatively to the items of a list.
reduce(lambda acc: int, item: int -> int { acc * item }, [2, 3, 4]) # 24
- New
jsonmodule functionmergeimplementing RFC 7396 JSON Merge Patch. ANone/Undefinedvalue in the patch removes the key, dicts are merged recursively, and other values replace the original value.
import json
result = json.merge({a = 1, b = {c = 2}}, {b = {c = None, d = 3}})
# {"a": 1, "b": {"d": 3}}
- New
filemodule functionreadbase64that reads a file as raw bytes and returns the contents encoded as a base64 string, which is binary-safe for images and other non-UTF-8 files. - New
netmodule functionis_IPv6, andto_IP16was renamed toto_IP6with correct IPv4-mapped IPv6 conversion. datetime.nowaccepts an optionalticksargument to format an arbitrary epoch (seconds since the Unix epoch) instead of the current time, anddatetimedate validation is enhanced.- Fixed
net.to_IP4/to_IP6parsing issues and clarified the UUID version in thecryptomodule documentation.
Third-Party Libraries
- The
k8spackage received patch version updates across 1.14 - 1.31 and fixed apimachinery import aliases. external-secretswas upgraded to 2.9.0.- Crossplane providers were updated, including
crossplane_provider_keycloakv2.24.1,crossplane-provider-kubernetesv1.2.1,crossplane-provider-openstackv0.10.0 andcrossplane-provider-httpv1.0.14 with cluster/namespaced structures. git-promoterwas updated to 0.36.0.
☸️ Ecosystem Integration
- Upbound has been added to ADOPTERS.md.
- Added the KubeStellar Console guided install reference.
📖 Documentation Updates
- The language specification documents the config entry shorthand, the lambda argument braces, the multi-line string dedenting, the
!=semantics on lists, dicts and schemas, and the selector expression quantifier targets. - The system package reference documents the new
reduce,json.merge,file.readbase64,net.is_IPv6,net.to_IP6anddatetime.now(ticks)functions. - The multi-language API reference is synchronized with the v0.13.0 protobuf service definition, including
GetSchemaTypeMappingUnderPathand the test coverage messages, and the Go API reference is regenerated. - The CLI reference documents the new
--dry-runflag ofkcl fmt, the./...pattern ofkcl lint, and the refreshed flags and examples ofkcl runandkcl vet.
🌐 Other Resources
🔥 Check out the KCL Community and join us 🔥
For more resources, refer to:


