Skip to content

Commit

Permalink
feat: add pkl comparision
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Feb 4, 2024
1 parent 3189cba commit c02bf1e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/user_docs/getting-started/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ Starlark is the language of Bazel, which is a dialect of Python. It does not hav
KCL can also be regarded as a variant of Python to some extent, but it greatly enhances the design related to static typing and configuration extensibility, and is a compiled language, which is essentially different from Starlark.
### vs. Pkl
Pkl is a configuration as code language that has programmable, extensible, and secure features.
There some similarities between KCL and Pkl here:
+ Language features: schema, validation, immutability, etc.
+ Multi language binding, KCL provides binding for Python, Go, and Java, etc. and Pkl providers others.
+ Multiple IDE plugin support: NeoVim, VS Code, etc.
Differently, KCL provides more relevant integration with cloud native tools and model code libraries.
### vs. Kustomize
The key feature of Kustomize is its ability to overlay files at a granular level. However, it faces challenges with multiple overlay chains as a specific attribute value may not be the final value, as it can be overridden by another value elsewhere. Retrieving the inheritance chain of Kustomize files can be less convenient than retrieving the inheritance chain of KCL code, particularly for complex scenarios where careful consideration of the specified configuration file overwrite order is necessary. Additionally, Kustomize does not address issues related to YAML configuration writing, constraint verification, model abstraction, and development, making it more suited for simpler configuration scenarios.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ Starlark 主要用作 Bazel 的配置语言并且是 Python 的一种方言。
KCL 一定程度上也可以看作 Python 的变种,但是它极大地增强了静态类型和配置扩展性相关的设计,并且是一个编译型语言,这与 Starlark 有着本质的不同。
### vs. Pkl
Pkl 是一门配置即代码语言,它具有可编程、可扩展和安全的特性。
KCL 和 Pkl 之间有一些相似之处:
+ 语言特征:Schema 定义、验证、不变性等。
+ 多语言绑定,KCL 为 Python、Go 和 Java 语言等提供了绑定,Pkl 也提供了诸如 Java, Swift 和 Kotlin 等语言绑定。
+ 支持多种 IDE 插件:NeoVim、VS Code等。
不同的是,KCL 提供了更多与云原生工具和模型代码库更多的集成。
### vs. Kustomize
Kustomize 的核心功能是其文件级覆盖功能。但是它存在多个覆盖链的问题,因为找到特定属性值的语句不能保证它是最终值,因为其他地方出现的另一个特定值可以覆盖它。对于复杂的场景,Kustomize 文件的继承链的检索通常不如 KCL 代码的继承链检索方便,需要仔细考虑指定的配置文件覆盖顺序。此外,Kustomize 无法解决 YAML 配置编写、约束验证、模型抽象和开发等问题,更适合于简单的配置场景。
Expand Down

0 comments on commit c02bf1e

Please sign in to comment.