kcl-lang / kcl-lang.io

Source of the KCL Website. https://kcl-lang.io
https://kcl-lang.github.io
Apache License 2.0
12 stars 32 forks source link

adding more comparison and more aspects to https://kcl-lang.io/docs/user_docs/getting-started/intro/#how-to-choose #274

Open dzmitry-lahoda opened 4 months ago

dzmitry-lahoda commented 4 months ago

General Question

Peefy commented 4 months ago

Good suggestions. 👍

It is necessary to supplement these contents in the introduction.

Peefy commented 4 months ago

A simple answer:

  1. In KCL, the option function and any type are provided to accept values obtained from outside the KCL program thanks to KCL's runtime type checking, validation, and conversion capabilities. Thus we can interact with the language to complete the processing of unknown values in conjunction with external engines (e.g., KusionStack https://github.com/KusionStack/kusion) or KCL plugins, just like Terraform and HCL. file.tf extends the power of file.hcl.
  2. KCL itself provides many integrations with other languages, formats, and cloud native tools. For example, we can use the kcl vet tool to validate terraform plan files and use the import tool to generate KCL schema from the terraform provider schema, Kubernetes CRD, etc. For cloud native tools, KCL provides almost all the integration of tools you know, thanks to the KRM KCL specification.
  3. Turing decidable, lazy, strict, recursion, side effects of KCL mentioned in the document are right https://github.com/tweag/nickel/blob/master/RATIONALE.md#comparison-with-other-configuration-languages . However, I would like to add that KCL is not strictly evaluated, and its inertia evaluation is based on the schema. For large-scale configurations, KCL also provides incremental compilation and caching to speed up evaluation, and partial runtime maintenance evaluation is not sufficient.
  4. KCL offer multiple merge strategies and operators to override deep dependencies. Of course, there are also idempotence merge for attributes. Besides, we can even use these low level features to implement patch libraries like kustomize/kubectl: https://github.com/kcl-lang/modules/tree/main/strategic_merge_patch which I haven't seen in other languages yet.
  5. I like the vast library of Nix, but I don't use it much. It would be great if you could add relevant comparisons. 😄

Afterwards, I will summarize and organize the PR, and welcome your discussion and review

dzmitry-lahoda commented 4 months ago

@Peefy thank you. read thought links to get more clarity.

as for Nix. There is NOT Flake Nix with --impure and with --import-from-derivation is very different from pure(hermetic) Flake Nix without import-from-derivation (second one is """"compile time typed"""" kind of). I will concentrate on flake pure nix with import-from-derivation on vs off in comments.