@@ -21,7 +21,7 @@ The KCL team is pleased to announce that **KCL v0.9.0 is now available**! This r
21
21
22
22
** We would like to extend our heartfelt thanks to all 120 community contributors who participated in the iteration from version v0.8 to v0.9 over the past 120 days. The following list is in no particular order.**
23
23
24
- *@Shashank Mittal, @MattHodge, @officialasishkumar, @Gmin2, @Akash Kumar, @sfshumaker, @sanzoghenzo, @MOHAMED FAWAS, @bradkwadsworth-mw, @excalq, @Daksh-10, @metacoma, @Wes McNamee, @Stéphane Este-Gracias, @octonawish-akcodes, @zong-zhe, @shashank-iitbhu, @NAVRockClimber, @AkashKumar7902, @Petrosz007, @patrycju, @Korada Vishal, @selfuryon, @tvandinther, @vtomilov, @Peefy, @taylormonacelli, @Tertium, @Stefano Borrelli, @Bishal, @kukacz, @borgius, @steeling, @jheyduk, @HStéphane Este-Gracias, @userxiaosi, @folliehiyuki, @kubernegit, @nizq, @Alexander Fuchs, @ihor-hrytskiv, @Mohamed Asif, @reedjosh, @Wck-iipi, @evensolberg, @aldoborrero@ron18219, @rodrigoalvamat, @mproffitt, @karlhepler, @shruti2522, @leon-andria, @prahaladramji, @Even Solberg, @utnim2, @warjiang, @Asish Kumar, @He1pa, @Emmanuel Alap, @d4v1d03, @Yvan da Silva, @Abhishek, @DavidChevallier, @zargor, @Kim Sondrup, @SamirMarin, @Hai Wu, @MatisseB, @beholdenkey, @nestoralonso, @HAkash Kumar, @olinux, @liangyuanpeng, @ngergs, @Penguin, @ealap, @markphillips100, @Henri Williams, @eshepelyuk, @CC007, @mintu, @M Slane, @zhuxw, @atelsier, @aleeriz, @LinYunling, @YvanDaSilva, @chai2010, @Sergey Ryabin, @vfarcic, @vemoo, @riven-blade, @ibishal, @empath-nirvana, @bozaro, @jgascon-nx, @reckless-huang, @Sergei Iakovlev, @Blarc, @JeevaRamanathan, @dennybaa, @PrettySolution, @east4ming, @nkabir, @sestegra, @XiaoK29, @ricochet1k, @yjsnly, @umaher, @SjuulJanssen, @wilsonwang371, @Lukáš Kubín, @samuel-deal-tisseo, @blakebarnett, @Uladzislau Maher, @ytsarev, @Vishalk91-4, @Stephen C, @Tom van Dinther, @MrGuoRanDuo, @dopesickjam*
24
+ _@Shashank Mittal, @MattHodge, @officialasishkumar, @Gmin2, @Akash Kumar, @sfshumaker, @sanzoghenzo, @MOHAMED FAWAS, @bradkwadsworth-mw, @excalq, @Daksh-10, @metacoma, @Wes McNamee, @Stéphane Este-Gracias, @octonawish-akcodes, @zong-zhe, @shashank-iitbhu, @NAVRockClimber, @AkashKumar7902, @Petrosz007, @patrycju, @Korada Vishal, @selfuryon, @tvandinther, @vtomilov, @Peefy, @taylormonacelli, @Tertium, @Stefano Borrelli, @Bishal, @kukacz, @borgius, @steeling, @jheyduk, @HStéphane Este-Gracias, @userxiaosi, @folliehiyuki, @kubernegit, @nizq, @Alexander Fuchs, @ihor-hrytskiv, @Mohamed Asif, @reedjosh, @Wck-iipi, @evensolberg, @aldoborrero@ron18219, @rodrigoalvamat, @mproffitt, @karlhepler, @shruti2522, @leon-andria, @prahaladramji, @Even Solberg, @utnim2, @warjiang, @Asish Kumar, @He1pa, @Emmanuel Alap, @d4v1d03, @Yvan da Silva, @Abhishek, @DavidChevallier, @zargor, @Kim Sondrup, @SamirMarin, @Hai Wu, @MatisseB, @beholdenkey, @nestoralonso, @HAkash Kumar, @olinux, @liangyuanpeng, @ngergs, @Penguin, @ealap, @markphillips100, @Henri Williams, @eshepelyuk, @CC007, @mintu, @M Slane, @zhuxw, @atelsier, @aleeriz, @LinYunling, @YvanDaSilva, @chai2010, @Sergey Ryabin, @vfarcic, @vemoo, @riven-blade, @ibishal, @empath-nirvana, @bozaro, @jgascon-nx, @reckless-huang, @Sergei Iakovlev, @Blarc, @JeevaRamanathan, @dennybaa, @PrettySolution, @east4ming, @nkabir, @sestegra, @XiaoK29, @ricochet1k, @yjsnly, @umaher, @SjuulJanssen, @wilsonwang371, @Lukáš Kubín, @samuel-deal-tisseo, @blakebarnett, @Uladzislau Maher, @ytsarev, @Vishalk91-4, @Stephen C, @Tom van Dinther, @MrGuoRanDuo, @dopesickjam_
25
25
26
26
## 📚 Key Updates
27
27
@@ -39,15 +39,15 @@ KCL IDE has further optimized incremental compilation and performance for semant
39
39
40
40
#### Language
41
41
42
- + String interpolation now supports escaping with ` \${} ` similar to Shell to cancel interpolation.
42
+ - String interpolation now supports escaping with ` \${} ` similar to Shell to cancel interpolation.
43
43
44
44
``` python
45
45
world = " world"
46
46
hello_world_0 = " hello ${world} " # hello world
47
47
hello_world_1 = " hello \${world} " # hello ${world}
48
48
```
49
49
50
- + Added schema type support to the ` typeof ` function for distinguishing schema types from instances.
50
+ - Added schema type support to the ` typeof ` function for distinguishing schema types from instances.
51
51
52
52
``` python
53
53
schema Foo:
@@ -58,7 +58,7 @@ type_schema = typeof(foo) # schema
58
58
type_type = typeof(Foo) # type
59
59
```
60
60
61
- + Added a ` full_pkg ` keyword argument to the ` instances() ` method of Schema to read instances of the corresponding schema from all code.
61
+ - Added a ` full_pkg ` keyword argument to the ` instances() ` method of Schema to read instances of the corresponding schema from all code.
62
62
63
63
``` python
64
64
schema Person:
@@ -68,43 +68,43 @@ alice = Person {name = "Alice"}
68
68
all_persons = Person.instances(True )
69
69
```
70
70
71
- + Removed implicit comparison between bool and int types ` 0 < True ` .
72
- + Removed comparison features for the list type ` [0] < [1] ` .
73
- + Added type assertion failure functionality to the ` as ` keyword.
74
- + Optimized closure variable capture logic of ` lambda ` functions and configuration code blocks ` {} ` in different scopes to be more intuitive.
71
+ - Removed implicit comparison between bool and int types ` 0 < True ` .
72
+ - Removed comparison features for the list type ` [0] < [1] ` .
73
+ - Added type assertion failure functionality to the ` as ` keyword.
74
+ - Optimized closure variable capture logic of ` lambda ` functions and configuration code blocks ` {} ` in different scopes to be more intuitive.
75
75
76
76
#### Toolchain
77
77
78
- + ` kcl run ` now supports outputting configurations in TOML format with the ` --format ` toml option.
79
- + ` kcl mod add ` now supports adding dependencies from private third-party OCI Registries and Git repositories with the ` --oci ` and ` --git ` options.
80
- + ` kcl import ` now supports importing entire Go Packages as KCL Schemas.
81
- + ` kcl import ` now supports importing files with YAML stream format (` --- ` ).
82
- + ` kcl import ` now supports importing TOML files as KCL configurations.
83
- + ` kcl clean ` now supports cleaning external dependencies and compile caches.
84
- + ` kcl mod init ` now supports setting the version of a new KCL module with the ` --version ` tag.
85
- + Commands like ` kcl run ` , ` kcl mod add ` , and ` kcl mod pull ` now support accessing private repositories via local Git.
78
+ - ` kcl run ` now supports outputting configurations in TOML format with the ` --format ` toml option.
79
+ - ` kcl mod add ` now supports adding dependencies from private third-party OCI Registries and Git repositories with the ` --oci ` and ` --git ` options.
80
+ - ` kcl import ` now supports importing entire Go Packages as KCL Schemas.
81
+ - ` kcl import ` now supports importing files with YAML stream format (` --- ` ).
82
+ - ` kcl import ` now supports importing TOML files as KCL configurations.
83
+ - ` kcl clean ` now supports cleaning external dependencies and compile caches.
84
+ - ` kcl mod init ` now supports setting the version of a new KCL module with the ` --version ` tag.
85
+ - Commands like ` kcl run ` , ` kcl mod add ` , and ` kcl mod pull ` now support accessing private repositories via local Git.
86
86
87
87
#### IDE
88
88
89
- + Supports multiple quick fix options.
90
- + Syntax highlighting for ` kcl.mod ` and ` kcl.mod.lock ` files.
91
- + Partial syntax hover highlighting in the IDE.
92
- + ` import ` completion for external dependencies.
93
- + Function symbol highlighting and Inlay Hints displaying default variable types.
89
+ - Supports multiple quick fix options.
90
+ - Syntax highlighting for ` kcl.mod ` and ` kcl.mod.lock ` files.
91
+ - Partial syntax hover highlighting in the IDE.
92
+ - ` import ` completion for external dependencies.
93
+ - Function symbol highlighting and Inlay Hints displaying default variable types.
94
94
95
95
![ inlayhint] ( /img/blog/2024-07-05-kcl-0.9.0-release/inlayhint.png )
96
96
97
97
#### API
98
98
99
- + The Override API now supports setting different attribute operators (` : ` , ` = ` , and ` += ` ) for configuration overrides.
100
- + Go API now supports prototext format and KCL schema output as KCL configurations.
101
- + Go API now supports serializing any Go Type and Go Value to KCL Schema and configurations.
99
+ - The Override API now supports setting different attribute operators (` : ` , ` = ` , and ` += ` ) for configuration overrides.
100
+ - Go API now supports prototext format and KCL schema output as KCL configurations.
101
+ - Go API now supports serializing any Go Type and Go Value to KCL Schema and configurations.
102
102
103
103
### 📦️ Standard Libraries and Third-Party Libraries
104
104
105
105
#### Standard Libraries
106
106
107
- + Added the ` file ` standard library for file IO operations, such as reading configurations from YAML and performing configuration merges.
107
+ - Added the ` file ` standard library for file IO operations, such as reading configurations from YAML and performing configuration merges.
108
108
109
109
``` python
110
110
import file
@@ -118,14 +118,14 @@ config = p.merge(yaml.decode(file.read("deployment.yaml")), {
118
118
119
119
For more functions in the ` file ` module, see: [ https://www.kcl-lang.io/docs/reference/model/file ] ( https://www.kcl-lang.io/docs/reference/model/file )
120
120
121
- + Added the ` template ` standard library for writing template configurations.
121
+ - Added the ` template ` standard library for writing template configurations.
122
122
123
123
``` python
124
124
import template
125
125
126
126
_data = {
127
- name = " handlebars" ,
128
- v = [ { a = 1 }, { a = 2 } ],
127
+ name = " handlebars" ,
128
+ v = [ { a = 1 }, { a = 2 } ],
129
129
c = { d = 5 },
130
130
g = { b = [ { aa = { bb = 55 } }, { aa = { bb = 66 } } ] },
131
131
people = [ " Yehuda Katz" , " Alan Johnson" , " Charles Jolley" ]
@@ -147,7 +147,7 @@ Hello world from {{name}}
147
147
""" , _data)
148
148
```
149
149
150
- + Added the ` runtime ` standard library for capturing runtime exceptions, useful for ` kcl test ` tool to test exception cases.
150
+ - Added the ` runtime ` standard library for capturing runtime exceptions, useful for ` kcl test ` tool to test exception cases.
151
151
152
152
``` python
153
153
import runtime
@@ -170,24 +170,24 @@ test_person_check_error = lambda {
170
170
171
171
The number of KCL models has increased to ** 313** , including major updates as follows:
172
172
173
- + ` k8s ` released version 1.30
174
- + ` argo-cd ` released version 0.1.1
175
- + ` argo-workflow ` released version 0.0.3
176
- + ` istio ` released version 1.21.2
177
- + ` victoria-metrics-operator ` released version 0.45.1
178
- + ` cert-manager ` released version 0.1.2
179
- + ` cilium ` released version 0.1.1
180
- + ` Longhorn ` released version 0.0.1
181
- + ` jsonpatch ` released version 0.0.5, supporting rfc6901Decode
182
- + Added a new third-party library ` difflib ` for comparing configuration differences
183
- + Added ` argo-cd-order ` for sorting argocd sync operation resource order
184
- + Added models for ` cluster-api ` , including ` cluster-api ` , ` cluster-api-provider-metal3 ` , ` cluster-api-provider-gcp ` , ` cluster-api-addon-provider-helm ` , ` cluster-api-addon-provider-aws ` , ` cluster-api-provider-azure ` , and more
173
+ - ` k8s ` released version 1.30
174
+ - ` argo-cd ` released version 0.1.1
175
+ - ` argo-workflow ` released version 0.0.3
176
+ - ` istio ` released version 1.21.2
177
+ - ` victoria-metrics-operator ` released version 0.45.1
178
+ - ` cert-manager ` released version 0.1.2
179
+ - ` cilium ` released version 0.1.1
180
+ - ` Longhorn ` released version 0.0.1
181
+ - ` jsonpatch ` released version 0.0.5, supporting rfc6901Decode
182
+ - Added a new third-party library ` difflib ` for comparing configuration differences
183
+ - Added ` argo-cd-order ` for sorting argocd sync operation resource order
184
+ - Added models for ` cluster-api ` , including ` cluster-api ` , ` cluster-api-provider-metal3 ` , ` cluster-api-provider-gcp ` , ` cluster-api-addon-provider-helm ` , ` cluster-api-addon-provider-aws ` , ` cluster-api-provider-azure ` , and more
185
185
186
186
### ☸️ Ecosystem Integration
187
187
188
- + Fixed concurrency issue in Argo KCL plugin causing Sync errors.
189
- + Releasing Flux KCL Controller [ https://github.com/kcl-lang/flux-kcl-controller ] ( https://github.com/kcl-lang/flux-kcl-controller ) , currently supporting GitOps with OCI and Git configurations.
190
- + KCL officially integrated into Crossplane Functions Marketplace, releasing v0.9.0 [ https://github.com/crossplane-contrib/function-kcl ] ( https://github.com/crossplane-contrib/function-kcl ) .
188
+ - Fixed concurrency issue in Argo KCL plugin causing Sync errors.
189
+ - Releasing Flux KCL Controller [ https://github.com/kcl-lang/flux-kcl-controller ] ( https://github.com/kcl-lang/flux-kcl-controller ) , currently supporting GitOps with OCI and Git configurations.
190
+ - KCL officially integrated into Crossplane Functions Marketplace, releasing v0.9.0 [ https://github.com/crossplane-contrib/function-kcl ] ( https://github.com/crossplane-contrib/function-kcl ) .
191
191
192
192
``` yaml
193
193
apiVersion : apiextensions.crossplane.io/v1
@@ -231,18 +231,18 @@ spec:
231
231
232
232
Additionally, you can find more real use cases of KCL with other ecosystem projects here:
233
233
234
- + [https://github.com/mindwm/mindwm-gitops](https://github.com/mindwm/mindwm-gitops)
235
- + [https://github.com/vfarcic/crossplane-kubernetes](https://github.com/vfarcic/crossplane-kubernetes)
236
- + [https://github.com/giantswarm/crossplane-gs-apis/blob/main/crossplane.giantswarm.io/xnetworks/package/compositions/peered-vpc-network.yaml](https://github.com/giantswarm/crossplane-gs-apis/blob/main/crossplane.giantswarm.io/xnetworks/package/compositions/peered-vpc-network.yaml)
237
- + [https://github.com/upbound/configuration-aws-eks/blob/main/apis/composition-kcl.yaml](https://github.com/upbound/configuration-aws-eks/blob/main/apis/composition-kcl.yaml)
234
+ - [https://github.com/mindwm/mindwm-gitops](https://github.com/mindwm/mindwm-gitops)
235
+ - [https://github.com/vfarcic/crossplane-kubernetes](https://github.com/vfarcic/crossplane-kubernetes)
236
+ - [https://github.com/giantswarm/crossplane-gs-apis/blob/main/crossplane.giantswarm.io/xnetworks/package/compositions/peered-vpc-network.yaml](https://github.com/giantswarm/crossplane-gs-apis/blob/main/crossplane.giantswarm.io/xnetworks/package/compositions/peered-vpc-network.yaml)
237
+ - [https://github.com/upbound/configuration-aws-eks/blob/main/apis/composition-kcl.yaml](https://github.com/upbound/configuration-aws-eks/blob/main/apis/composition-kcl.yaml)
238
238
239
239
### 🧩 Multi-Language SDKs and Plugins
240
240
241
241
#### Multi-Language SDKs
242
242
243
243
The number of KCL multi-language SDKs has increased to **7**, currently supporting Rust, Go, Java, .NET, Python, Node.js, and WASM. These can be used without installing additional KCL command-line tools, optimizing the installation size to **90%** of previous versions and removing the need for complex system dependencies. Furthermore, each SDK provides the same APIs for code execution, code analysis, type parsing, and adding external dependencies. Here are some examples with the Java and C# SDKs:
244
244
245
- + Java
245
+ - Java
246
246
247
247
` ` ` java
248
248
import com.kcl.api.API;
@@ -259,7 +259,7 @@ public class ExecProgramTest {
259
259
}
260
260
```
261
261
262
- + C#
262
+ - C#
263
263
264
264
``` csharp
265
265
namespace KclLib .Tests ;
@@ -336,7 +336,7 @@ For more examples of using other multi-language plugins, see [https://www.kcl-la
336
336
337
337
Additionally, you can find more real use cases of KCL multi-language plugins here:
338
338
339
- + [ https://github.com/cakehappens/kcfoil/blob/main/cmd/kcf/template.go ] ( https://github.com/cakehappens/kcfoil/blob/main/cmd/kcf/template.go )
339
+ - [ https://github.com/cakehappens/kcfoil/blob/main/cmd/kcf/template.go ] ( https://github.com/cakehappens/kcfoil/blob/main/cmd/kcf/template.go )
340
340
341
341
## 🌐 Other Resources
342
342
0 commit comments