5 ms·
The KCL Programming Language
- peefy 4y agoKusion Configuration Language (KCL) is an open source constraint-based record and functional language. KCL improves the writing of a large number of complex configurations such as cloud native scenarios through mature programming language technology and practice, and is committed to building better modularity, scalability and stability around configuration, simpler logic writing, fast automation and good ecological extensionality.
- izhenyi 4y agoExcellent, that really helps the work for DevOps
- peefy 4y agoThank you for your liking.
- redrove 4y agoHow does it compare to Cue or Dhall?
- peefy 4y agoCompared with other languages, you can refer to the relevant documents on the KCL website: + https://kcl-lang.io/docs/user_docs/getting-started/intro https://kcl-lang.io/docs/user_docs/getting-started/intro + https://kcl-lang.io/blog/2022-declarative-config-overview https://kcl-lang.io/blog/2022-declarative-config-overview
- harshreality 4y agoWhat are the selling points of KCL compared to Dhall?
- peefy 4y agoI think the main selling points are the object-oriented model abstraction ability and automation ability. It is close to the writing method of conventional programming language and the automatic processing ability of Data. In Kubernetes and DevOps scenarios, automation is an important means to improve efficiency. https://kcl-lang.io/docs/user_docs/guides/automation https://kcl-lang.io/docs/user_docs/guides/automation
- emptysongglass 4y agoOr Nickel
- kottapar 4y agoFrom the example provided I can see that the KCL K8s sample had 18 lines whereas the generated YAML file had 21 lines. I'm sort of missing the point here as to how KCL is helping here.
- peefy 4y agoIn readme, we only show a simple k8s example. In fact, KCL can achieve a high information compression ratio through its code abstraction capabilities. For example: https://github.com/KusionStack/konfig/blob/main/appops/guestbook-frontend/prod/main.k https://github.com/KusionStack/konfig/blob/main/appops/guest... and https://github.com/KusionStack/konfig/blob/main/appops/guestbook-frontend/prod/ci-test/stdout.golden.yaml https://github.com/KusionStack/konfig/blob/main/appops/guest...
- peefy 4y agoThe core features of KCL are its modeling and constraint capabilities, and the basic functions of KCL revolve around the two core features. In addition, KCL follows the user-centric configuration concept to design its basic functions, which can be understood from two aspects: Domain model-centric configuration view: With the rich features of KCL language and KCL OpenAPI tools, we can directly integrate a wide range of well-designed models in the community into KCL (such as the K8s resource model). We can also design and implement our own KCL models or libraries according to different scenarios, forming a complete set of domain models for other configuration end users to use. End user-centric configuration view: With KCL's code encapsulation, abstraction and reuse capabilities, the model architecture can be further abstracted and simplified (for example, the K8s resource model is abstracted into an application-centered server model) to minimize the end user configuration input*, simplify the user's configuration interface, and facilitate manual or automatic API modification. No matter what configuration view is centered on, for configuration code, there are requirements for configuration data constraints, such as type constraints, required/optional constraints on configuration attributes, range constraints, and immutability constraints. This is also one of the core issues KCL is committed to solving.
- kazinator 4y agoClashes with Kyoto Common Lisp.
- peefy 4y agoCan you give Kyoto Common Lisp more reference information? I'm interested in it.
- lispm 4y agoKyoto Common Lisp was developed in the mid 80s in Japan as an independent new implementation. It's a Common Lisp to C compiler. KCL was the first in a family of implementations based on KCL: AKCL, GCL, Delphi CL, ECL, CLASP. The currently usable implementations of those are ECL, CLASP and possibly GCL. For KCL see: https://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/impl/kcl/0.html https://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/...
- peefy 4y ago[dead]
- chai2010 4y agoHow to publish my package, is there an example?
- peefy 4y agoHello, we are supporting the kpm tool for publishing and sharing KCL modules. To put it simply, we can install and use the modules related to kubernetes through the command: `kpm install kubernetes`. The detailed user stories are here: https://github.com/KusionStack/KCLVM/issues/338 https://github.com/KusionStack/KCLVM/issues/338
- NeutralForest 4y ago[Insert XCKD with adding a 15th standard when 14 already exist]
- peefy 4y agoThe KCL website is https://kcl-lang.io/ https://kcl-lang.io/
- tejtm 4y agotheir GitHub https://github.com/KusionStack/KCLVM https://github.com/KusionStack/KCLVM
- t0suj4 4y agoI see a problem there with the pythonic range() function. I suggest to create syntax that can express closed, partially closed and open intervals. And make it always requiring two arguments. As it is now, people have to know the quirks of python to understand what this schema wants to say. The meaning should be clear on first look.
- peefy 4y agoThank you for your suggestion. At first, we expected to make an SRE-friendly language and made enhancements in configuration and policy writing (try to be close to python and shell in use, and use some pythonic built-in functions such as range). However, this does bring additional learning costs to some users who are unfamiliar with python's usage. We will try to eliminate some of python's triks in the future to make the syntax and semantics of KCL clearer.
- jauco 4y agoAlso: comparison with other languages such as dhall or cue or jsonnet at https://kcl-lang.io/docs/user_docs/getting-started/intro/ https://kcl-lang.io/docs/user_docs/getting-started/intro/