Skip to main content

· 4 min read

KCL is a constraint-based record and functional language hosted by Cloud Native Computing Foundation (CNCF) that enhances the writing of complex configurations and polices, including those for cloud-native scenarios. With its advanced programming language technology and practices, KCL is dedicated to promoting better modularity, scalability, and stability for configurations. It enables simpler logic writing and offers ease of automation APIs and integration with homegrown systems.

This section will update the KCL language community's latest news, including features, website updates, and the latest community news, helping everyone better understand the KCL community!

KCL Website: https://kcl-lang.io

Overview

Thanks to to all contributors for their outstanding work over the past twenty days (2024.04.04 - 2024.04.17). Here is an overview of the key content.

🏄 Language Updates

  • The instances() method of Schema has added a new keyword parameter full_pkg for reading all instances corresponding to the Schema in the code.
schema Person:
name: str

alice = Person {name = "Alice"}
all_persons = Person.instances(True)
  • Added the template system module for manipulation of templates in KCL.
import template

content = template.execute("""\
<div class="entry">
{{#if author}}
<h1>{{firstName}} {{lastName}}</h1>
{{/if}}
</div>
""", {
author: True,
firstName: "Yehuda",
lastName: "Katz",
})

⛵️ Toolchain Updates

  • The OverrideFile API supports modifying/deleting non-schema type fields.
  • New ListVariable API for reading the values of variables in KCL files.

🔥 SDK Updates

  • The KCL Go SDK has been released in version 0.8.4.
  • The KCL Rust SDK has added the llvm feature, allowing to choose whether to use the LLVM, defaulting to off. When the LLVM feature is turned off, binary size can be reduced by 90%. Dependencies can be added in the following way:
cargo add --git https://github.com/kcl-lang/lib
  • __test__/test_data/schema.k
schema AppConfig:
replicas: int

app: AppConfig {
replicas: 2
}
  • execProgram
import { execProgram, ExecProgramArgs } from "kcl-lib";

function main() {
const result = execProgram(new ExecProgramArgs(["__test__/test_data/schema.k"]));
console.log(result.yamlResult); // 'app:\n replicas: 2'
}

main();
  • listVariables
import { listVariables, ListVariablesArgs } from "kcl-lib";

function main() {
const result = listVariables(
ListVariablesArgs("__test__/test_data/schema.k", []),
);
console.log(result.variables["app"].value); // 'AppConfig {replicas: 2}'
}

main();
  • loadPackage
import { loadPackage, LoadPackageArgs } from "kcl-lib";

function main() {
const result = loadPackage(
LoadPackageArgs(["__test__/test_data/schema.k"], [], true),
);
console.log(result.symbols);
}

main();

💻 IDE Updates

  • Added compilation unit caching to enhance IDE performance.

🌼 Integration Updates

  • Crossplane KCL Function supports reading Function Context parameters for passing parameters to different functions.
    • Support reading the function context across different functions.
    • Support reading the function details to set sensitive information.
    • Support setting the status field of XR to output user information.
    • Fixed errors related to concurrent requests when issuing clusters under multiple XR resources.
  • KCL has released a Nix package, allowing installation of the KCL command line tools with nix-shell or devbox shell.

Special Thanks

We'd like to thank all the community participants from the past two weeks.

The following are listed in no particular order:

  • Thanks to @bozaro for the contribution to the KCL Go SDK 🙌
  • Thanks to @jheyduk for the contribution to the Kubectl KCL plugin 🙌
  • Thanks to @shashank-iitbhu for the contribution to the quick fix feature for KCL IDE syntax 🙌
  • Thanks to @d4v1d03 for the contribution to the KCL official website FAQ documentation 🙌
  • Thanks to @octonawish-akcodes for the contribution to the automatic dependency update feature for KCL IDE based on kcl.mod 🙌
  • Thanks to @utnim2 for the contribution to the restart kcl-language-server command for KCL IDE 🙌
  • Thanks to @AkashKumar7902 for the contribution to the KCL package management tool MVS algorithm 🙌
  • Thanks to @steeling, @bozaro, @vtomilov, @sanzoghenzo, @folliehiyuki, @markphillips100, @wilsonwang371, @zargor, @aleeriz, @reckless-huang, @zhuxw, @jheyduk, @Vitaly Tomilov, @Sergey Ryabin, @Stephen C, @ytsarev and others for their valuable suggestions and feedback while using KCL recently. 🙌

Resources

❤️ See here to join us!

For more resources, please refer to

· 3 min read

KCL is a constraint-based record and functional language hosted by Cloud Native Computing Foundation (CNCF) that enhances the writing of complex configurations and polices, including those for cloud-native scenarios. With its advanced programming language technology and practices, KCL is dedicated to promoting better modularity, scalability, and stability for configurations. It enables simpler logic writing and offers ease of automation APIs and integration with homegrown systems.

This section will update the KCL language community's latest news, including features, website updates, and the latest community news, helping everyone better understand the KCL community!

KCL Website: https://kcl-lang.io

Overview

Thanks to to all contributors for their outstanding work over the past twenty days (2024.03.06 - 2024.03.20). Here is an overview of the key content:

Certainly! Here's the translation for the provided content:

🏄 Language Updates Release of versions 0.8.3 and 0.8.4 for KCL

The mainly updates:

  • Added file system built-in methods file.abs to compute the absolute file path and file.exists to determine if a file exists.

🔧 Toolchain Updates

  • KCL package manager: Added support for oci URLs in the kcl.mod file.
  • KCL package manager: Removed updates of indirect dependencies in kcl.mod.
  • KCL package manager: Removed checksum verification for local dependencies.
  • KCL package manager: Fixed an issue where local dependency version numbers were missing.
  • KCL package manager: Fixed the issue of missing local dependencies.
  • KCL package manager: Fixed an internal bug that caused the creation of symbolic links to fail.

🔥 SDK Updates

  • Release of version 0.8.3 for the KCL Go SDK.
  • KCL Go SDK fixed a panic issue that occurred during the ParseFile process.
  • KCL Go SDK supports setting the kcl compiler automatic download through environment variables.

💻 IDE Update

  • Fixed format function of IDE for unsaved code.

Special Thanks

We'd like to thank all the community participants from the past two weeks.

the following are listed in no particular order:

  • Thanks to @bozaro for the contributions to the KCL Go SDK 🙌
  • Thanks to @reckless-huang for the contributions to the KCL Go SDK 🙌
  • Thanks to @vemoo for the contributions to the KCL IDE 🙌
  • Thanks to @wilsonwang371 for the contributions to the KCL docker image and KCL website 🙌
  • Thanks to @d4v1d03 for the contributions to the KCL website 🙌
  • Thanks to @liangyuanpeng for the contributions to KCL github action 🙌
  • Thanks to @octonawish-akcodes for the contributions to KCL IDE 🙌
  • Thanks to @AkashKumar7902 for the contributions to KCL package management tool 🙌
  • Thanks to @empath-nirvana for the contributions to crossplane function-kcl 🙌
  • Thanks to @reckless-huang, @steeling, @vfarcic, @wilsonwang371, and others for their valuable suggestions and feedback during the recent use of KCL 🙌

Resources

❤️ See here to join us!

For more resources, please refer to