Repository: kcl-lang/kcl (language: rust)

Issue:
[WIP] Feat : Support Call Kclvm Cli by C API
<!-- Thank you for contributing to KusionStack!

Note: 

1. With pull requests:

    - Open your pull request against "main"
    - Your pull request should have no more than two commits, if not you should squash them.
    - It should pass all tests in the available continuous integration systems such as GitHub Actions.
    - You should add/modify tests to cover your proposed code changes.
    - If your pull request contains a new feature, please document it on the README.

2. Please create an issue first to describe the problem.

    We recommend that link the issue with the PR in the following question.
    For more info, check https://kusionstack.io/docs/governance/contribute/
-->

#### 1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

- [ ] N
- [x] Y 
re #125 

#### 2. What is the scope of this PR (e.g. component or file name):

<!-- You can add the scope of this change here. 
-->
        KCLVM/kclvm/spec
        KCLVM/kclvm/src/lib.rs

#### 3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

<!-- You can choose a brief description here -->
- [ ] Affects user behaviors
- [ ] Contains syntax changes
- [ ] Contains variable changes
- [x] Contains experimental features
- [ ] Performance regression: Consumes more CPU
- [ ] Performance regression: Consumes more Memory
- [ ] Other

<!-- You can add more details here.
-->
    Support user to call kclvm_cli by c_api


#### 4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

- [x] N
- [ ] Y 

<!-- You can add more details here.

-->

#### 5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

<!-- You can choose a brief description here -->
- [x] Unit test
- [ ] Integration test
- [ ] Benchmark (add benchmark stats below)
- [ ] Manual test (add detailed scripts or steps below)
- [ ] Other

<!-- You can add more details here.
None
-->
KCLVM/kclvm/src/api_test.rs

#### 6. Release note

<!-- compatibility change, improvement, bugfix, and new feature need a release note -->

Please refer to [Release Notes Language Style Guide](https://kusionstack.io/docs/governance/release-policy/) to write a quality release note.

```release-note
None
```



Discussion / hints:
****CLA Assistant Lite bot**** All contributors have signed the CLA  ✍️ ✅
I have read the CLA Document and I hereby sign the CLA
## Pull Request Test Coverage Report for [Build 2744948016](https://coveralls.io/builds/51191024)

* **2** of **5523**   **(0.04%)**  changed or added relevant lines in **6** files are covered.
* No unchanged relevant lines lost coverage.
* Overall coverage decreased (**-7.6%**) to **51.731%**

---

|  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
| :-----|--------------|--------|---: |
| [kclvm/spec/src/main.rs](https://coveralls.io/builds/51191024/source?filename=kclvm%2Fspec%2Fsrc%2Fmain.rs#L2) | 1 | 3 | 33.33%
| [kclvm/spec/src/service/util.rs](https://coveralls.io/builds/51191024/source?filename=kclvm%2Fspec%2Fsrc%2Fservice%2Futil.rs#L2) | 0 | 25 | 0.0%
| [kclvm/spec/src/service/service.rs](https://coveralls.io/builds/51191024/source?filename=kclvm%2Fspec%2Fsrc%2Fservice%2Fservice.rs#L10) | 0 | 109 | 0.0%
| [kclvm/spec/src/service/api.rs](https://coveralls.io/builds/51191024/source?filename=kclvm%2Fspec%2Fsrc%2Fservice%2Fapi.rs#L10) | 0 | 153 | 0.0%
| [kclvm/spec/src/model/gpyrpc.rs](https://coveralls.io/builds/51191024/source?filename=kclvm%2Fspec%2Fsrc%2Fmodel%2Fgpyrpc.rs#L28) | 0 | 5232 | 0.0%
<!-- | **Total:** | **2** | **5523** | **0.04%** | -->


|  Totals | [![Coverage Status](https://coveralls.io/builds/51191024/badge)](https://coveralls.io/builds/51191024) |
| :-- | --: |
| Change from base [Build 2743999583](https://coveralls.io/builds/51186839): |  -7.6% |
| Covered Lines: | 22244 |
| Relevant Lines: | 42999 |

---
##### 💛  - [Coveralls](https://coveralls.io)


Fix patch:
diff --git a/cli/src/main.rs b/cli/src/main.rs
index 8ec47d258..421ccf5bf 100644
--- a/cli/src/main.rs
+++ b/cli/src/main.rs
@@ -7,7 +7,7 @@ use std::{
 
 #[link(name = "kclvm_cli_cdylib")]
 #[allow(improper_ctypes)]
-extern "C" {
+extern "C-unwind" {
     fn kclvm_cli_main(argc: c_int, argv: *const *const c_char) -> *mut ExitCode;
 }
 
diff --git a/kclvm/api/src/lib.rs b/kclvm/api/src/lib.rs
index 1ccf47a3a..e9a825720 100644
--- a/kclvm/api/src/lib.rs
+++ b/kclvm/api/src/lib.rs
@@ -83,7 +83,7 @@ pub fn call_with_plugin_agent<'a>(
 /// the Protobuf byte sequence and length of the calling parameter, and the return parameter is the byte sequence and
 /// length of Protobuf.
 #[no_mangle]
-pub extern "C" fn call_native(
+pub extern "C-unwind" fn call_native(
     name_ptr: *const u8,
     name_len: usize,
     args_ptr: *const u8,
diff --git a/kclvm/api/src/service/capi.rs b/kclvm/api/src/service/capi.rs
index 82038698d..287cfb238 100644
--- a/kclvm/api/src/service/capi.rs
+++ b/kclvm/api/src/service/capi.rs
@@ -21,7 +21,7 @@ fn c_char_to_vec(args: *const c_char, args_len: usize) -> Vec<u8> {
 
 /// Create an instance of kclvm_service and return its pointer
 #[no_mangle]
-pub extern "C" fn kclvm_service_new(plugin_agent: u64) -> *mut kclvm_service {
+pub extern "C-unwind" fn kclvm_service_new(plugin_agent: u64) -> *mut kclvm_service {
     let serv = kclvm_service { plugin_agent };
     Box::into_raw(Box::new(serv))
 }
@@ -31,7 +31,7 @@ pub extern "C" fn kclvm_service_new(plugin_agent: u64) -> *mut kclvm_service {
 /// This function should not be called twice on the same ptr.
 /// Delete KclvmService
 #[no_mangle]
-pub unsafe extern "C" fn kclvm_service_delete(serv: *mut kclvm_service) {
+pub unsafe extern "C-unwind" fn kclvm_service_delete(serv: *mut kclvm_service) {
     if !serv.is_null() {
         unsafe {
             drop(Box::from_raw(serv));
@@ -44,7 +44,7 @@ pub unsafe extern "C" fn kclvm_service_delete(serv: *mut kclvm_service) {
 /// This function should not be called twice on the same ptr.
 /// Free memory for string returned to the outside
 #[no_mangle]
-pub unsafe extern "C" fn kclvm_service_free_string(res: *mut c_char) {
+pub unsafe extern "C-unwind" fn kclvm_service_free_string(res: *mut c_char) {
     if !res.is_null() {
         unsafe {
             let _ = CString::from_raw(res);
@@ -90,7 +90,7 @@ macro_rules! call {
 /// result: [*const c_char]
 ///     Result of the call serialized as protobuf byte sequence
 #[no_mangle]
-pub extern "C" fn kclvm_service_call(
+pub extern "C-unwind" fn kclvm_service_call(
     serv: *mut kclvm_service,
     name: *const c_char,
     args: *const c_char,
@@ -120,7 +120,7 @@ pub extern "C" fn kclvm_service_call(
 /// result: [*const c_char]
 ///     Result of the call serialized as protobuf byte sequence
 #[no_mangle]
-pub extern "C" fn kclvm_service_call_with_length(
+pub extern "C-unwind" fn kclvm_service_call_with_length(
     serv: *mut kclvm_service,
     name: *const c_char,
     args: *const c_char,
diff --git a/kclvm/runner/src/runner.rs b/kclvm/runner/src/runner.rs
index b22825e77..82d71e049 100644
--- a/kclvm/runner/src/runner.rs
+++ b/kclvm/runner/src/runner.rs
@@ -312,8 +312,8 @@ impl LibRunner {
     ) -> Result<()> {
         // get kclvm_plugin_init
         let kclvm_plugin_init: libloading::Symbol<
-            unsafe extern "C" fn(
-                fn_ptr: extern "C" fn(
+            unsafe extern "C-unwind" fn(
+                fn_ptr: extern "C-unwind" fn(
                     method: *const c_char,
                     args_json: *const c_char,
                     kwargs_json: *const c_char,
@@ -324,12 +324,12 @@ impl LibRunner {
         // get plugin_method
         let plugin_method_ptr = plugin_method_ptr;
         let plugin_method_ptr = (plugin_method_ptr as *const u64) as *const ()
-            as *const extern "C" fn(
+            as *const extern "C-unwind" fn(
                 method: *const c_char,
                 args: *const c_char,
                 kwargs: *const c_char,
             ) -> *const c_char;
-        let plugin_method: extern "C" fn(
+        let plugin_method: extern "C-unwind" fn(
             method: *const c_char,
             args: *const c_char,
             kwargs: *const c_char,
@@ -345,7 +345,7 @@ impl LibRunner {
         args: &ExecProgramArgs,
     ) -> Result<ExecProgramResult> {
         let kcl_run: libloading::Symbol<
-            unsafe extern "C" fn(
+            unsafe extern "C-unwind" fn(
                 kclvm_main_ptr: u64, // main.k => kclvm_main
                 option_len: kclvm_size_t,
                 option_keys: *const *const kclvm_char_t,
@@ -512,7 +512,7 @@ impl FastRunner {
         #[cfg(not(target_arch = "wasm32"))]
         let prev_hook = std::panic::take_hook();
         #[cfg(not(target_arch = "wasm32"))]
-        std::panic::set_hook(Box::new(|info: &std::panic::PanicInfo| {
+        std::panic::set_hook(Box::new(|info: &std::panic::PanicHookInfo| {
             KCL_RUNTIME_PANIC_RECORD.with(|record| {
                 let mut record = record.borrow_mut();
                 record.kcl_panic_info = true;
@@ -536,7 +536,7 @@ impl FastRunner {
             if self.opts.plugin_agent_ptr > 0 {
                 #[cfg(not(target_arch = "wasm32"))]
                 unsafe {
-                    let plugin_method: extern "C" fn(
+                    let plugin_method: extern "C-unwind" fn(
                         method: *const c_char,
                         args: *const c_char,
                         kwargs: *const c_char,
diff --git a/kclvm/runtime/src/_kcl_run.rs b/kclvm/runtime/src/_kcl_run.rs
index a9ab2cbb0..4eba2cfff 100644
--- a/kclvm/runtime/src/_kcl_run.rs
+++ b/kclvm/runtime/src/_kcl_run.rs
@@ -85,7 +85,7 @@ fn new_ctx_with_opts(opts: FFIRunOptions, path_selector: &[String]) -> Context {
 #[no_mangle]
 #[runtime_fn]
 #[allow(clippy::too_many_arguments)]
-pub unsafe extern "C" fn _kcl_run(
+pub unsafe extern "C-unwind" fn _kcl_run(
     kclvm_main_ptr: u64, // main.k => kclvm_main
     option_len: kclvm_size_t,
     option_keys: *const *const kclvm_char_t,
@@ -110,7 +110,7 @@ pub unsafe extern "C" fn _kcl_run(
         kclvm_builtin_option_init(ctx, option_keys[i], option_values[i]);
     }
     let prev_hook = std::panic::take_hook();
-    std::panic::set_hook(Box::new(|info: &std::panic::PanicInfo| {
+    std::panic::set_hook(Box::new(|info: &std::panic::PanicHookInfo| {
         KCL_RUNTIME_PANIC_RECORD.with(|record| {
             let mut record = record.borrow_mut();
             record.kcl_panic_info = true;
@@ -172,7 +172,7 @@ unsafe fn _kcl_run_in_closure(
     kclvm_main_ptr: u64, // main.k => kclvm_main
 ) {
     let kclvm_main = (&kclvm_main_ptr as *const u64) as *const ()
-        as *const extern "C" fn(
+        as *const extern "C-unwind" fn(
             ctx: *mut kclvm_context_t,
             scope: *mut kclvm_eval_scope_t,
         ) -> *mut kclvm_value_ref_t;
diff --git a/kclvm/runtime/src/_kclvm.h b/kclvm/runtime/src/_kclvm.h
index c6452b242..0e1de382a 100644
--- a/kclvm/runtime/src/_kclvm.h
+++ b/kclvm/runtime/src/_kclvm.h
@@ -12,7 +12,7 @@
 #include <stdint.h>
 
 #ifdef __cplusplus
-extern "C" {
+extern "C-unwind" {
 #endif
 
 // please keep same as 'kclvm/runtime/src/kind/mod.rs#Kind'
@@ -724,7 +724,7 @@ kclvm_value_ref_t* kclvm_yaml_encode_all(kclvm_context_t* ctx, kclvm_value_ref_t
 kclvm_value_ref_t* kclvm_yaml_validate(kclvm_context_t* ctx, kclvm_value_ref_t* args, kclvm_value_ref_t* kwargs);
 
 #ifdef __cplusplus
-} // extern "C"
+} // extern "C-unwind"
 #endif
 
 #endif // _kclvm_h_
diff --git a/kclvm/runtime/src/base64/mod.rs b/kclvm/runtime/src/base64/mod.rs
index 5ed481346..68107e3b4 100644
--- a/kclvm/runtime/src/base64/mod.rs
+++ b/kclvm/runtime/src/base64/mod.rs
@@ -7,7 +7,7 @@ use crate::*;
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_base64_encode(
+pub extern "C-unwind" fn kclvm_base64_encode(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -24,7 +24,7 @@ pub extern "C" fn kclvm_base64_encode(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_base64_decode(
+pub extern "C-unwind" fn kclvm_base64_decode(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/collection/mod.rs b/kclvm/runtime/src/collection/mod.rs
index 7f4a02aa1..e7ab78517 100644
--- a/kclvm/runtime/src/collection/mod.rs
+++ b/kclvm/runtime/src/collection/mod.rs
@@ -4,7 +4,7 @@ use crate::*;
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_union_all(
+pub extern "C-unwind" fn kclvm_value_union_all(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/context/api.rs b/kclvm/runtime/src/context/api.rs
index aaeb77687..8c43a60a8 100644
--- a/kclvm/runtime/src/context/api.rs
+++ b/kclvm/runtime/src/context/api.rs
@@ -42,13 +42,13 @@ type kclvm_float_t = f64;
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_new() -> *mut kclvm_context_t {
+pub unsafe extern "C-unwind" fn kclvm_context_new() -> *mut kclvm_context_t {
     Box::into_raw(Box::new(Context::new()))
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_delete(p: *mut kclvm_context_t) {
+pub unsafe extern "C-unwind" fn kclvm_context_delete(p: *mut kclvm_context_t) {
     let ctx = mut_ptr_as_ref(p);
     for o in &ctx.objects {
         let ptr = (*o) as *mut kclvm_value_ref_t;
@@ -63,7 +63,7 @@ pub unsafe extern "C" fn kclvm_context_delete(p: *mut kclvm_context_t) {
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_set_kcl_location(
+pub unsafe extern "C-unwind" fn kclvm_context_set_kcl_location(
     p: *mut kclvm_context_t,
     filename: *const c_char,
     line: i32,
@@ -79,7 +79,7 @@ pub unsafe extern "C" fn kclvm_context_set_kcl_location(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_set_kcl_pkgpath(
+pub unsafe extern "C-unwind" fn kclvm_context_set_kcl_pkgpath(
     p: *mut kclvm_context_t,
     pkgpath: *const c_char,
 ) {
@@ -91,7 +91,7 @@ pub unsafe extern "C" fn kclvm_context_set_kcl_pkgpath(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_set_kcl_modpath(
+pub unsafe extern "C-unwind" fn kclvm_context_set_kcl_modpath(
     p: *mut kclvm_context_t,
     module_path: *const c_char,
 ) {
@@ -103,7 +103,7 @@ pub unsafe extern "C" fn kclvm_context_set_kcl_modpath(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_set_kcl_workdir(
+pub unsafe extern "C-unwind" fn kclvm_context_set_kcl_workdir(
     p: *mut kclvm_context_t,
     workdir: *const c_char,
 ) {
@@ -115,7 +115,7 @@ pub unsafe extern "C" fn kclvm_context_set_kcl_workdir(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_set_kcl_filename(
+pub unsafe extern "C-unwind" fn kclvm_context_set_kcl_filename(
     ctx: *mut kclvm_context_t,
     filename: *const c_char,
 ) {
@@ -127,7 +127,7 @@ pub unsafe extern "C" fn kclvm_context_set_kcl_filename(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_set_kcl_line_col(
+pub unsafe extern "C-unwind" fn kclvm_context_set_kcl_line_col(
     ctx: *mut kclvm_context_t,
     line: i32,
     col: i32,
@@ -142,19 +142,19 @@ pub unsafe extern "C" fn kclvm_context_set_kcl_line_col(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_scope_new() -> *mut kclvm_eval_scope_t {
+pub unsafe extern "C-unwind" fn kclvm_scope_new() -> *mut kclvm_eval_scope_t {
     Box::into_raw(Box::default())
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_scope_delete(scope: *mut kclvm_eval_scope_t) {
+pub unsafe extern "C-unwind" fn kclvm_scope_delete(scope: *mut kclvm_eval_scope_t) {
     drop(Box::from_raw(scope));
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_scope_add_setter(
+pub unsafe extern "C-unwind" fn kclvm_scope_add_setter(
     _ctx: *mut kclvm_context_t,
     scope: *mut kclvm_eval_scope_t,
     pkg: *const c_char,
@@ -175,7 +175,7 @@ pub unsafe extern "C" fn kclvm_scope_add_setter(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_scope_set(
+pub unsafe extern "C-unwind" fn kclvm_scope_set(
     _ctx: *mut kclvm_context_t,
     scope: *mut kclvm_eval_scope_t,
     pkg: *const c_char,
@@ -192,7 +192,7 @@ pub unsafe extern "C" fn kclvm_scope_set(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_scope_get(
+pub unsafe extern "C-unwind" fn kclvm_scope_get(
     ctx: *mut kclvm_context_t,
     scope: *mut kclvm_eval_scope_t,
     pkg: *const c_char,
@@ -220,14 +220,17 @@ pub unsafe extern "C" fn kclvm_scope_get(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_set_debug_mode(p: *mut kclvm_context_t, v: kclvm_bool_t) {
+pub unsafe extern "C-unwind" fn kclvm_context_set_debug_mode(
+    p: *mut kclvm_context_t,
+    v: kclvm_bool_t,
+) {
     let p = mut_ptr_as_ref(p);
     p.cfg.debug_mode = v != 0;
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_set_strict_range_check(
+pub unsafe extern "C-unwind" fn kclvm_context_set_strict_range_check(
     p: *mut kclvm_context_t,
     v: kclvm_bool_t,
 ) {
@@ -237,14 +240,17 @@ pub unsafe extern "C" fn kclvm_context_set_strict_range_check(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_set_disable_none(p: *mut kclvm_context_t, v: kclvm_bool_t) {
+pub unsafe extern "C-unwind" fn kclvm_context_set_disable_none(
+    p: *mut kclvm_context_t,
+    v: kclvm_bool_t,
+) {
     let p = mut_ptr_as_ref(p);
     p.plan_opts.disable_none = v != 0;
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_set_disable_schema_check(
+pub unsafe extern "C-unwind" fn kclvm_context_set_disable_schema_check(
     p: *mut kclvm_context_t,
     v: kclvm_bool_t,
 ) {
@@ -258,7 +264,7 @@ pub unsafe extern "C" fn kclvm_context_set_disable_schema_check(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_invoke(
+pub unsafe extern "C-unwind" fn kclvm_context_invoke(
     p: *mut kclvm_context_t,
     method: *const c_char,
     args: *const c_char,
@@ -295,7 +301,7 @@ unsafe fn _kclvm_context_invoke(
     }
 
     let ptr = (&fn_addr as *const u64) as *const ()
-        as *const extern "C" fn(
+        as *const extern "C-unwind" fn(
             ctx: *mut kclvm_context_t,
             args: *const kclvm_value_ref_t,
             kwargs: *const kclvm_value_ref_t,
@@ -306,7 +312,7 @@ unsafe fn _kclvm_context_invoke(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_pkgpath_is_imported(
+pub unsafe extern "C-unwind" fn kclvm_context_pkgpath_is_imported(
     ctx: *mut kclvm_context_t,
     pkgpath: *const kclvm_char_t,
 ) -> kclvm_bool_t {
diff --git a/kclvm/runtime/src/crypto/mod.rs b/kclvm/runtime/src/crypto/mod.rs
index 6d54ab1ff..dc4d3f310 100644
--- a/kclvm/runtime/src/crypto/mod.rs
+++ b/kclvm/runtime/src/crypto/mod.rs
@@ -21,7 +21,7 @@ type kclvm_value_ref_t = ValueRef;
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_crypto_md5(
+pub extern "C-unwind" fn kclvm_crypto_md5(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -43,7 +43,7 @@ pub extern "C" fn kclvm_crypto_md5(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_crypto_sha1(
+pub extern "C-unwind" fn kclvm_crypto_sha1(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -65,7 +65,7 @@ pub extern "C" fn kclvm_crypto_sha1(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_crypto_sha224(
+pub extern "C-unwind" fn kclvm_crypto_sha224(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -97,7 +97,7 @@ pub extern "C" fn kclvm_crypto_sha224(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_crypto_sha256(
+pub extern "C-unwind" fn kclvm_crypto_sha256(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -129,7 +129,7 @@ pub extern "C" fn kclvm_crypto_sha256(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_crypto_sha384(
+pub extern "C-unwind" fn kclvm_crypto_sha384(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -161,7 +161,7 @@ pub extern "C" fn kclvm_crypto_sha384(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_crypto_sha512(
+pub extern "C-unwind" fn kclvm_crypto_sha512(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -193,7 +193,7 @@ pub extern "C" fn kclvm_crypto_sha512(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_crypto_blake3(
+pub extern "C-unwind" fn kclvm_crypto_blake3(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -221,7 +221,7 @@ pub extern "C" fn kclvm_crypto_blake3(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_crypto_uuid(
+pub extern "C-unwind" fn kclvm_crypto_uuid(
     ctx: *mut kclvm_context_t,
     _args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -232,7 +232,7 @@ pub extern "C" fn kclvm_crypto_uuid(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_crypto_filesha256(
+pub extern "C-unwind" fn kclvm_crypto_filesha256(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -272,7 +272,7 @@ pub extern "C" fn kclvm_crypto_filesha256(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_crypto_filesha512(
+pub extern "C-unwind" fn kclvm_crypto_filesha512(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -310,7 +310,7 @@ pub extern "C" fn kclvm_crypto_filesha512(
 // fileblake3
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_crypto_fileblake3(
+pub extern "C-unwind" fn kclvm_crypto_fileblake3(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/datetime/mod.rs b/kclvm/runtime/src/datetime/mod.rs
index 5c8873fee..fd28b9ee0 100644
--- a/kclvm/runtime/src/datetime/mod.rs
+++ b/kclvm/runtime/src/datetime/mod.rs
@@ -10,7 +10,7 @@ use crate::*;
 /// `today() -> str`
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_datetime_today(
+pub extern "C-unwind" fn kclvm_datetime_today(
     ctx: *mut kclvm_context_t,
     _args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -26,7 +26,7 @@ pub extern "C" fn kclvm_datetime_today(
 /// `now() -> str`
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_datetime_now(
+pub extern "C-unwind" fn kclvm_datetime_now(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -44,7 +44,7 @@ pub extern "C" fn kclvm_datetime_now(
 /// `ticks() -> float`
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_datetime_ticks(
+pub extern "C-unwind" fn kclvm_datetime_ticks(
     ctx: *mut kclvm_context_t,
     _args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -58,7 +58,7 @@ pub extern "C" fn kclvm_datetime_ticks(
 /// `date() -> str`
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_datetime_date(
+pub extern "C-unwind" fn kclvm_datetime_date(
     ctx: *mut kclvm_context_t,
     _args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -72,7 +72,7 @@ pub extern "C" fn kclvm_datetime_date(
 /// `validate(str, str) -> bool`
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_datetime_validate(
+pub extern "C-unwind" fn kclvm_datetime_validate(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/eval/mod.rs b/kclvm/runtime/src/eval/mod.rs
index 5b31a834d..a413f1b95 100644
--- a/kclvm/runtime/src/eval/mod.rs
+++ b/kclvm/runtime/src/eval/mod.rs
@@ -9,8 +9,10 @@ use crate::{
 };
 
 /// Variable setter function type. fn(ctx: &mut Context, scope: &mut ScopeEval, args: ValueRef, kwargs: ValueRef) -> ValueRef.
-pub type SetterFuncType =
-    unsafe extern "C" fn(*mut kclvm_context_t, *mut kclvm_eval_scope_t) -> *const kclvm_value_ref_t;
+pub type SetterFuncType = unsafe extern "C-unwind" fn(
+    *mut kclvm_context_t,
+    *mut kclvm_eval_scope_t,
+) -> *const kclvm_value_ref_t;
 
 /// LazyEvalScope represents a scope of sequentially independent calculations, where
 /// the calculation of values is lazy and only recursively performed through
diff --git a/kclvm/runtime/src/file/mod.rs b/kclvm/runtime/src/file/mod.rs
index 311f6981a..d5841a925 100644
--- a/kclvm/runtime/src/file/mod.rs
+++ b/kclvm/runtime/src/file/mod.rs
@@ -9,7 +9,7 @@ use std::path::Path;
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_read(
+pub extern "C-unwind" fn kclvm_file_read(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -31,7 +31,7 @@ pub extern "C" fn kclvm_file_read(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_glob(
+pub extern "C-unwind" fn kclvm_file_glob(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -56,7 +56,7 @@ pub extern "C" fn kclvm_file_glob(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_modpath(
+pub extern "C-unwind" fn kclvm_file_modpath(
     ctx: *mut kclvm_context_t,
     _args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -68,7 +68,7 @@ pub extern "C" fn kclvm_file_modpath(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_workdir(
+pub extern "C-unwind" fn kclvm_file_workdir(
     ctx: *mut kclvm_context_t,
     _args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -81,7 +81,7 @@ pub extern "C" fn kclvm_file_workdir(
 /// Read the path of the current script or module that is being executed
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_current(
+pub extern "C-unwind" fn kclvm_file_current(
     ctx: *mut kclvm_context_t,
     _args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -96,7 +96,7 @@ pub extern "C" fn kclvm_file_current(
 /// query information about the destination file.
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_exists(
+pub extern "C-unwind" fn kclvm_file_exists(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -117,7 +117,7 @@ pub extern "C" fn kclvm_file_exists(
 /// components normalized and symbolic links resolved.
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_abs(
+pub extern "C-unwind" fn kclvm_file_abs(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -139,7 +139,7 @@ pub extern "C" fn kclvm_file_abs(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_mkdir(
+pub extern "C-unwind" fn kclvm_file_mkdir(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -165,7 +165,7 @@ pub extern "C" fn kclvm_file_mkdir(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_delete(
+pub extern "C-unwind" fn kclvm_file_delete(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -196,7 +196,7 @@ pub extern "C" fn kclvm_file_delete(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_cp(
+pub extern "C-unwind" fn kclvm_file_cp(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -233,7 +233,7 @@ pub extern "C" fn kclvm_file_cp(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_mv(
+pub extern "C-unwind" fn kclvm_file_mv(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -258,7 +258,7 @@ pub extern "C" fn kclvm_file_mv(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_size(
+pub extern "C-unwind" fn kclvm_file_size(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -286,7 +286,7 @@ pub extern "C" fn kclvm_file_size(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_write(
+pub extern "C-unwind" fn kclvm_file_write(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -316,7 +316,7 @@ pub extern "C" fn kclvm_file_write(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_append(
+pub extern "C-unwind" fn kclvm_file_append(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -349,7 +349,7 @@ pub extern "C" fn kclvm_file_append(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_file_read_env(
+pub extern "C-unwind" fn kclvm_file_read_env(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/json/mod.rs b/kclvm/runtime/src/json/mod.rs
index 24d9230c7..03bc2cd31 100644
--- a/kclvm/runtime/src/json/mod.rs
+++ b/kclvm/runtime/src/json/mod.rs
@@ -6,7 +6,7 @@ use crate::*;
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_json_encode(
+pub extern "C-unwind" fn kclvm_json_encode(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -27,7 +27,7 @@ pub extern "C" fn kclvm_json_encode(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_json_decode(
+pub extern "C-unwind" fn kclvm_json_decode(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -47,7 +47,7 @@ pub extern "C" fn kclvm_json_decode(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_json_validate(
+pub extern "C-unwind" fn kclvm_json_validate(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -67,7 +67,7 @@ pub extern "C" fn kclvm_json_validate(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_json_dump_to_file(
+pub extern "C-unwind" fn kclvm_json_dump_to_file(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/manifests/mod.rs b/kclvm/runtime/src/manifests/mod.rs
index 092f602f4..bb2f0dad4 100644
--- a/kclvm/runtime/src/manifests/mod.rs
+++ b/kclvm/runtime/src/manifests/mod.rs
@@ -51,7 +51,7 @@ type kclvm_value_ref_t = ValueRef;
 /// TODO: more options on the function `yaml_stream`.
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_manifests_yaml_stream(
+pub extern "C-unwind" fn kclvm_manifests_yaml_stream(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/math/mod.rs b/kclvm/runtime/src/math/mod.rs
index ec3913704..63275daa5 100644
--- a/kclvm/runtime/src/math/mod.rs
+++ b/kclvm/runtime/src/math/mod.rs
@@ -10,7 +10,7 @@ use crate::*;
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_ceil(
+pub extern "C-unwind" fn kclvm_math_ceil(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -30,7 +30,7 @@ pub extern "C" fn kclvm_math_ceil(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_factorial(
+pub extern "C-unwind" fn kclvm_math_factorial(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -70,7 +70,7 @@ pub extern "C" fn kclvm_math_factorial(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_floor(
+pub extern "C-unwind" fn kclvm_math_floor(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -90,7 +90,7 @@ pub extern "C" fn kclvm_math_floor(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_gcd(
+pub extern "C-unwind" fn kclvm_math_gcd(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -112,7 +112,7 @@ pub extern "C" fn kclvm_math_gcd(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_isfinite(
+pub extern "C-unwind" fn kclvm_math_isfinite(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -136,7 +136,7 @@ pub extern "C" fn kclvm_math_isfinite(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_isinf(
+pub extern "C-unwind" fn kclvm_math_isinf(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -163,7 +163,7 @@ pub extern "C" fn kclvm_math_isinf(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_isnan(
+pub extern "C-unwind" fn kclvm_math_isnan(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -187,7 +187,7 @@ pub extern "C" fn kclvm_math_isnan(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_modf(
+pub extern "C-unwind" fn kclvm_math_modf(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -219,7 +219,7 @@ pub extern "C" fn kclvm_math_modf(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_exp(
+pub extern "C-unwind" fn kclvm_math_exp(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -238,7 +238,7 @@ pub extern "C" fn kclvm_math_exp(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_expm1(
+pub extern "C-unwind" fn kclvm_math_expm1(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -257,7 +257,7 @@ pub extern "C" fn kclvm_math_expm1(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_log(
+pub extern "C-unwind" fn kclvm_math_log(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -286,7 +286,7 @@ pub extern "C" fn kclvm_math_log(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_log1p(
+pub extern "C-unwind" fn kclvm_math_log1p(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -305,7 +305,7 @@ pub extern "C" fn kclvm_math_log1p(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_log2(
+pub extern "C-unwind" fn kclvm_math_log2(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -324,7 +324,7 @@ pub extern "C" fn kclvm_math_log2(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_log10(
+pub extern "C-unwind" fn kclvm_math_log10(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -343,7 +343,7 @@ pub extern "C" fn kclvm_math_log10(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_pow(
+pub extern "C-unwind" fn kclvm_math_pow(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -376,7 +376,7 @@ pub extern "C" fn kclvm_math_pow(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_math_sqrt(
+pub extern "C-unwind" fn kclvm_math_sqrt(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/net/mod.rs b/kclvm/runtime/src/net/mod.rs
index 37e6ebe95..e11b4cea1 100644
--- a/kclvm/runtime/src/net/mod.rs
+++ b/kclvm/runtime/src/net/mod.rs
@@ -10,7 +10,7 @@ use crate::*;
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_split_host_port(
+pub extern "C-unwind" fn kclvm_net_split_host_port(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -34,7 +34,7 @@ pub extern "C" fn kclvm_net_split_host_port(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_join_host_port(
+pub extern "C-unwind" fn kclvm_net_join_host_port(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -61,7 +61,7 @@ pub extern "C" fn kclvm_net_join_host_port(
 #[cfg(not(target_arch = "wasm32"))]
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_fqdn(
+pub extern "C-unwind" fn kclvm_net_fqdn(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -98,7 +98,7 @@ pub extern "C" fn kclvm_net_fqdn(
 #[cfg(target_arch = "wasm32")]
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_fqdn(
+pub extern "C-unwind" fn kclvm_net_fqdn(
     _ctx: *mut kclvm_context_t,
     _args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -110,7 +110,7 @@ pub extern "C" fn kclvm_net_fqdn(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_parse_IP(
+pub extern "C-unwind" fn kclvm_net_parse_IP(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -122,7 +122,7 @@ pub extern "C" fn kclvm_net_parse_IP(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_to_IP4(
+pub extern "C-unwind" fn kclvm_net_to_IP4(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -134,7 +134,7 @@ pub extern "C" fn kclvm_net_to_IP4(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_to_IP16(
+pub extern "C-unwind" fn kclvm_net_to_IP16(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -146,7 +146,7 @@ pub extern "C" fn kclvm_net_to_IP16(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_IP_string(
+pub extern "C-unwind" fn kclvm_net_IP_string(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -174,7 +174,7 @@ pub extern "C" fn kclvm_net_IP_string(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_is_IPv4(
+pub extern "C-unwind" fn kclvm_net_is_IPv4(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -200,7 +200,7 @@ pub extern "C" fn kclvm_net_is_IPv4(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_is_IP(
+pub extern "C-unwind" fn kclvm_net_is_IP(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -223,7 +223,7 @@ pub extern "C" fn kclvm_net_is_IP(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_is_loopback_IP(
+pub extern "C-unwind" fn kclvm_net_is_loopback_IP(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -251,7 +251,7 @@ pub extern "C" fn kclvm_net_is_loopback_IP(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_is_multicast_IP(
+pub extern "C-unwind" fn kclvm_net_is_multicast_IP(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -279,7 +279,7 @@ pub extern "C" fn kclvm_net_is_multicast_IP(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_is_interface_local_multicast_IP(
+pub extern "C-unwind" fn kclvm_net_is_interface_local_multicast_IP(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -309,7 +309,7 @@ pub extern "C" fn kclvm_net_is_interface_local_multicast_IP(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_is_link_local_multicast_IP(
+pub extern "C-unwind" fn kclvm_net_is_link_local_multicast_IP(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -341,7 +341,7 @@ pub extern "C" fn kclvm_net_is_link_local_multicast_IP(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_is_link_local_unicast_IP(
+pub extern "C-unwind" fn kclvm_net_is_link_local_unicast_IP(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -373,7 +373,7 @@ pub const fn Ipv6Addr_is_unicast_link_local(_self: &Ipv6Addr) -> bool {
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_is_global_unicast_IP(
+pub extern "C-unwind" fn kclvm_net_is_global_unicast_IP(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -398,7 +398,7 @@ pub extern "C" fn kclvm_net_is_global_unicast_IP(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_parse_CIDR(
+pub extern "C-unwind" fn kclvm_net_parse_CIDR(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -429,7 +429,7 @@ pub extern "C" fn kclvm_net_parse_CIDR(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_hosts_in_CIDR(
+pub extern "C-unwind" fn kclvm_net_hosts_in_CIDR(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -464,7 +464,7 @@ pub extern "C" fn kclvm_net_hosts_in_CIDR(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_subnets_from_CIDR(
+pub extern "C-unwind" fn kclvm_net_subnets_from_CIDR(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -501,7 +501,7 @@ pub extern "C" fn kclvm_net_subnets_from_CIDR(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_is_IP_in_CIDR(
+pub extern "C-unwind" fn kclvm_net_is_IP_in_CIDR(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -583,7 +583,7 @@ const fn Ipv4Addr_is_benchmarking(_self: &std::net::Ipv4Addr) -> bool {
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_net_is_unspecified_IP(
+pub extern "C-unwind" fn kclvm_net_is_unspecified_IP(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/panic/mod.rs b/kclvm/runtime/src/panic/mod.rs
index d5ee2ffea..bd853afbe 100644
--- a/kclvm/runtime/src/panic/mod.rs
+++ b/kclvm/runtime/src/panic/mod.rs
@@ -13,7 +13,7 @@ use crate::*;
 /// message in case of a runtime panic.
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_runtime_catch(
+pub extern "C-unwind" fn kclvm_runtime_catch(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/regex/mod.rs b/kclvm/runtime/src/regex/mod.rs
index 5d5a4b996..b5dda9a9c 100644
--- a/kclvm/runtime/src/regex/mod.rs
+++ b/kclvm/runtime/src/regex/mod.rs
@@ -8,7 +8,7 @@ use crate::*;
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_regex_match(
+pub extern "C-unwind" fn kclvm_regex_match(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -39,7 +39,7 @@ pub extern "C" fn kclvm_regex_match(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_regex_replace(
+pub extern "C-unwind" fn kclvm_regex_replace(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -66,7 +66,7 @@ pub extern "C" fn kclvm_regex_replace(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_regex_compile(
+pub extern "C-unwind" fn kclvm_regex_compile(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -87,7 +87,7 @@ pub extern "C" fn kclvm_regex_compile(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_regex_findall(
+pub extern "C-unwind" fn kclvm_regex_findall(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -127,7 +127,7 @@ pub extern "C" fn kclvm_regex_findall(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_regex_search(
+pub extern "C-unwind" fn kclvm_regex_search(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -153,7 +153,7 @@ pub extern "C" fn kclvm_regex_search(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_regex_split(
+pub extern "C-unwind" fn kclvm_regex_split(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/stdlib/assert_api.rs b/kclvm/runtime/src/stdlib/assert_api.rs
index 34c6cb007..2aa14548a 100644
--- a/kclvm/runtime/src/stdlib/assert_api.rs
+++ b/kclvm/runtime/src/stdlib/assert_api.rs
@@ -7,7 +7,7 @@ type kclvm_value_ref_t = ValueRef;
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_assert(
+pub extern "C-unwind" fn kclvm_assert(
     ctx: *mut kclvm_context_t,
     value: *const kclvm_value_ref_t,
     msg: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/stdlib/builtin_api.rs b/kclvm/runtime/src/stdlib/builtin_api.rs
index d7c4dae60..eb3107985 100644
--- a/kclvm/runtime/src/stdlib/builtin_api.rs
+++ b/kclvm/runtime/src/stdlib/builtin_api.rs
@@ -10,7 +10,7 @@ type kclvm_value_ref_t = ValueRef;
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_option_init(
+pub unsafe extern "C-unwind" fn kclvm_builtin_option_init(
     ctx: *mut kclvm_context_t,
     key: *const c_char,
     value: *const c_char,
@@ -21,7 +21,7 @@ pub unsafe extern "C" fn kclvm_builtin_option_init(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_option_reset(
+pub unsafe extern "C-unwind" fn kclvm_builtin_option_reset(
     ctx: *mut kclvm_context_t,
     _args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -36,7 +36,7 @@ pub unsafe extern "C" fn kclvm_builtin_option_reset(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_option(
+pub unsafe extern "C-unwind" fn kclvm_builtin_option(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -195,7 +195,7 @@ pub unsafe extern "C" fn kclvm_builtin_option(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_print(
+pub unsafe extern "C-unwind" fn kclvm_builtin_print(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -219,7 +219,7 @@ pub unsafe extern "C" fn kclvm_builtin_print(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_len(
+pub unsafe extern "C-unwind" fn kclvm_builtin_len(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -235,7 +235,7 @@ pub unsafe extern "C" fn kclvm_builtin_len(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_any_true(
+pub unsafe extern "C-unwind" fn kclvm_builtin_any_true(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -251,7 +251,7 @@ pub unsafe extern "C" fn kclvm_builtin_any_true(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_isunique(
+pub unsafe extern "C-unwind" fn kclvm_builtin_isunique(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -267,7 +267,7 @@ pub unsafe extern "C" fn kclvm_builtin_isunique(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_sorted(
+pub unsafe extern "C-unwind" fn kclvm_builtin_sorted(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -285,7 +285,7 @@ pub unsafe extern "C" fn kclvm_builtin_sorted(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_int(
+pub unsafe extern "C-unwind" fn kclvm_builtin_int(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -303,7 +303,7 @@ pub unsafe extern "C" fn kclvm_builtin_int(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_float(
+pub unsafe extern "C-unwind" fn kclvm_builtin_float(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -320,7 +320,7 @@ pub unsafe extern "C" fn kclvm_builtin_float(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_bool(
+pub unsafe extern "C-unwind" fn kclvm_builtin_bool(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -337,7 +337,7 @@ pub unsafe extern "C" fn kclvm_builtin_bool(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -354,7 +354,7 @@ pub unsafe extern "C" fn kclvm_builtin_str(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_max(
+pub unsafe extern "C-unwind" fn kclvm_builtin_max(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -372,7 +372,7 @@ pub unsafe extern "C" fn kclvm_builtin_max(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_min(
+pub unsafe extern "C-unwind" fn kclvm_builtin_min(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -390,7 +390,7 @@ pub unsafe extern "C" fn kclvm_builtin_min(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_multiplyof(
+pub unsafe extern "C-unwind" fn kclvm_builtin_multiplyof(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -413,7 +413,7 @@ pub unsafe extern "C" fn kclvm_builtin_multiplyof(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_abs(
+pub unsafe extern "C-unwind" fn kclvm_builtin_abs(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -430,7 +430,7 @@ pub unsafe extern "C" fn kclvm_builtin_abs(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_all_true(
+pub unsafe extern "C-unwind" fn kclvm_builtin_all_true(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -446,7 +446,7 @@ pub unsafe extern "C" fn kclvm_builtin_all_true(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_hex(
+pub unsafe extern "C-unwind" fn kclvm_builtin_hex(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -463,7 +463,7 @@ pub unsafe extern "C" fn kclvm_builtin_hex(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_sum(
+pub unsafe extern "C-unwind" fn kclvm_builtin_sum(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -483,7 +483,7 @@ pub unsafe extern "C" fn kclvm_builtin_sum(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_pow(
+pub unsafe extern "C-unwind" fn kclvm_builtin_pow(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -506,7 +506,7 @@ pub unsafe extern "C" fn kclvm_builtin_pow(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_round(
+pub unsafe extern "C-unwind" fn kclvm_builtin_round(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -526,7 +526,7 @@ pub unsafe extern "C" fn kclvm_builtin_round(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_zip(
+pub unsafe extern "C-unwind" fn kclvm_builtin_zip(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -538,7 +538,7 @@ pub unsafe extern "C" fn kclvm_builtin_zip(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_list(
+pub unsafe extern "C-unwind" fn kclvm_builtin_list(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -559,7 +559,7 @@ pub unsafe extern "C" fn kclvm_builtin_list(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_dict(
+pub unsafe extern "C-unwind" fn kclvm_builtin_dict(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -579,7 +579,7 @@ pub unsafe extern "C" fn kclvm_builtin_dict(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_typeof(
+pub unsafe extern "C-unwind" fn kclvm_builtin_typeof(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -600,7 +600,7 @@ pub unsafe extern "C" fn kclvm_builtin_typeof(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_bin(
+pub unsafe extern "C-unwind" fn kclvm_builtin_bin(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -617,7 +617,7 @@ pub unsafe extern "C" fn kclvm_builtin_bin(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_oct(
+pub unsafe extern "C-unwind" fn kclvm_builtin_oct(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -634,7 +634,7 @@ pub unsafe extern "C" fn kclvm_builtin_oct(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_ord(
+pub unsafe extern "C-unwind" fn kclvm_builtin_ord(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -651,7 +651,7 @@ pub unsafe extern "C" fn kclvm_builtin_ord(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_range(
+pub unsafe extern "C-unwind" fn kclvm_builtin_range(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -675,7 +675,7 @@ pub unsafe extern "C" fn kclvm_builtin_range(
 /// Return `True` if the input value is `None` or `Undefined`, and `False` otherwise.
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_isnullish(
+pub unsafe extern "C-unwind" fn kclvm_builtin_isnullish(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/stdlib/plugin.rs b/kclvm/runtime/src/stdlib/plugin.rs
index 081e4962d..0d6bbc800 100644
--- a/kclvm/runtime/src/stdlib/plugin.rs
+++ b/kclvm/runtime/src/stdlib/plugin.rs
@@ -11,7 +11,7 @@ use std::sync::Mutex;
 lazy_static! {
     static ref PLUGIN_HANDLER_FN_PTR: Mutex<
         Option<
-            extern "C" fn(
+            extern "C-unwind" fn(
                 method: *const c_char,
                 args_json: *const c_char,
                 kwargs_json: *const c_char,
@@ -25,8 +25,8 @@ pub const PLUGIN_MODULE_PREFIX: &str = "kcl_plugin.";
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_plugin_init(
-    fn_ptr: extern "C" fn(
+pub extern "C-unwind" fn kclvm_plugin_init(
+    fn_ptr: extern "C-unwind" fn(
         method: *const c_char,
         args_json: *const c_char,
         kwargs_json: *const c_char,
@@ -43,7 +43,7 @@ pub extern "C" fn kclvm_plugin_init(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_plugin_invoke(
+pub unsafe extern "C-unwind" fn kclvm_plugin_invoke(
     ctx: *mut kclvm_context_t,
     method: *const c_char,
     args: *const kclvm_value_ref_t,
@@ -89,7 +89,7 @@ pub unsafe extern "C" fn kclvm_plugin_invoke(
 #[cfg(not(target_arch = "wasm32"))]
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_plugin_invoke_json(
+pub extern "C-unwind" fn kclvm_plugin_invoke_json(
     method: *const c_char,
     args: *const c_char,
     kwargs: *const c_char,
@@ -105,7 +105,7 @@ pub extern "C" fn kclvm_plugin_invoke_json(
 #[cfg(target_arch = "wasm32")]
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_plugin_invoke_json(
+pub extern "C-unwind" fn kclvm_plugin_invoke_json(
     method: *const c_char,
     args: *const c_char,
     kwargs: *const c_char,
@@ -116,7 +116,7 @@ pub extern "C" fn kclvm_plugin_invoke_json(
 }
 
 #[cfg(target_arch = "wasm32")]
-extern "C" {
+extern "C-unwind" {
     pub fn kclvm_plugin_invoke_json_wasm(
         method: *const c_char,
         args: *const c_char,
diff --git a/kclvm/runtime/src/template/mod.rs b/kclvm/runtime/src/template/mod.rs
index bb7004933..dd0d34706 100644
--- a/kclvm/runtime/src/template/mod.rs
+++ b/kclvm/runtime/src/template/mod.rs
@@ -7,7 +7,7 @@ use handlebars::{html_escape, Handlebars};
 /// returns the string output.
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_template_execute(
+pub extern "C-unwind" fn kclvm_template_execute(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -39,7 +39,7 @@ pub extern "C" fn kclvm_template_execute(
 /// Replaces the characters `&"<>` with the equivalent html / xml entities.
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_template_html_escape(
+pub extern "C-unwind" fn kclvm_template_html_escape(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/units/mod.rs b/kclvm/runtime/src/units/mod.rs
index b71115a4f..742d4ace2 100644
--- a/kclvm/runtime/src/units/mod.rs
+++ b/kclvm/runtime/src/units/mod.rs
@@ -41,7 +41,7 @@ pub const INVALID_UNITS: [&str; 4] = ["ni", "ui", "mi", "ki"];
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_units_to_n(
+pub extern "C-unwind" fn kclvm_units_to_n(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -62,7 +62,7 @@ pub extern "C" fn kclvm_units_to_n(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_units_to_u(
+pub extern "C-unwind" fn kclvm_units_to_u(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -83,7 +83,7 @@ pub extern "C" fn kclvm_units_to_u(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_units_to_m(
+pub extern "C-unwind" fn kclvm_units_to_m(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -104,7 +104,7 @@ pub extern "C" fn kclvm_units_to_m(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_units_to_K(
+pub extern "C-unwind" fn kclvm_units_to_K(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -124,7 +124,7 @@ pub extern "C" fn kclvm_units_to_K(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_units_to_M(
+pub extern "C-unwind" fn kclvm_units_to_M(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -144,7 +144,7 @@ pub extern "C" fn kclvm_units_to_M(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_units_to_G(
+pub extern "C-unwind" fn kclvm_units_to_G(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -164,7 +164,7 @@ pub extern "C" fn kclvm_units_to_G(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_units_to_T(
+pub extern "C-unwind" fn kclvm_units_to_T(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -184,7 +184,7 @@ pub extern "C" fn kclvm_units_to_T(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_units_to_P(
+pub extern "C-unwind" fn kclvm_units_to_P(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -204,7 +204,7 @@ pub extern "C" fn kclvm_units_to_P(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_units_to_Ki(
+pub extern "C-unwind" fn kclvm_units_to_Ki(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -224,7 +224,7 @@ pub extern "C" fn kclvm_units_to_Ki(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_units_to_Mi(
+pub extern "C-unwind" fn kclvm_units_to_Mi(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -244,7 +244,7 @@ pub extern "C" fn kclvm_units_to_Mi(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_units_to_Gi(
+pub extern "C-unwind" fn kclvm_units_to_Gi(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -264,7 +264,7 @@ pub extern "C" fn kclvm_units_to_Gi(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_units_to_Ti(
+pub extern "C-unwind" fn kclvm_units_to_Ti(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -284,7 +284,7 @@ pub extern "C" fn kclvm_units_to_Ti(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_units_to_Pi(
+pub extern "C-unwind" fn kclvm_units_to_Pi(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/value/api.rs b/kclvm/runtime/src/value/api.rs
index dd94018f8..fb2c57c11 100644
--- a/kclvm/runtime/src/value/api.rs
+++ b/kclvm/runtime/src/value/api.rs
@@ -45,7 +45,7 @@ pub type kclvm_float_t = f64;
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_context_set_import_names(
+pub unsafe extern "C-unwind" fn kclvm_context_set_import_names(
     p: *mut kclvm_context_t,
     import_names: *const kclvm_value_ref_t,
 ) {
@@ -69,14 +69,16 @@ pub unsafe extern "C" fn kclvm_context_set_import_names(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_Undefined(ctx: *mut kclvm_context_t) -> *mut kclvm_value_ref_t {
+pub extern "C-unwind" fn kclvm_value_Undefined(
+    ctx: *mut kclvm_context_t,
+) -> *mut kclvm_value_ref_t {
     let ctx = mut_ptr_as_ref(ctx);
     new_mut_ptr(ctx, ValueRef::undefined())
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_None(ctx: *mut kclvm_context_t) -> *mut kclvm_value_ref_t {
+pub extern "C-unwind" fn kclvm_value_None(ctx: *mut kclvm_context_t) -> *mut kclvm_value_ref_t {
     let ctx = mut_ptr_as_ref(ctx);
     new_mut_ptr(ctx, ValueRef::none())
 }
@@ -85,21 +87,21 @@ pub extern "C" fn kclvm_value_None(ctx: *mut kclvm_context_t) -> *mut kclvm_valu
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_True(ctx: *mut kclvm_context_t) -> *mut kclvm_value_ref_t {
+pub extern "C-unwind" fn kclvm_value_True(ctx: *mut kclvm_context_t) -> *mut kclvm_value_ref_t {
     let ctx = mut_ptr_as_ref(ctx);
     kclvm_value_Bool(ctx, 1)
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_False(ctx: *mut kclvm_context_t) -> *mut kclvm_value_ref_t {
+pub extern "C-unwind" fn kclvm_value_False(ctx: *mut kclvm_context_t) -> *mut kclvm_value_ref_t {
     let ctx = mut_ptr_as_ref(ctx);
     kclvm_value_Bool(ctx, 0)
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_Bool(
+pub extern "C-unwind" fn kclvm_value_Bool(
     ctx: *mut kclvm_context_t,
     v: kclvm_bool_t,
 ) -> *mut kclvm_value_ref_t {
@@ -113,7 +115,7 @@ pub extern "C" fn kclvm_value_Bool(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_Int(
+pub extern "C-unwind" fn kclvm_value_Int(
     ctx: *mut kclvm_context_t,
     v: kclvm_int_t,
 ) -> *mut kclvm_value_ref_t {
@@ -123,7 +125,7 @@ pub extern "C" fn kclvm_value_Int(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_Float(
+pub extern "C-unwind" fn kclvm_value_Float(
     ctx: *mut kclvm_context_t,
     v: kclvm_float_t,
 ) -> *mut kclvm_value_ref_t {
@@ -133,7 +135,7 @@ pub extern "C" fn kclvm_value_Float(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_Unit(
+pub extern "C-unwind" fn kclvm_value_Unit(
     ctx: *mut kclvm_context_t,
     v: kclvm_float_t,
     raw: kclvm_int_t,
@@ -146,7 +148,7 @@ pub extern "C" fn kclvm_value_Unit(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_Str(
+pub unsafe extern "C-unwind" fn kclvm_value_Str(
     ctx: *mut kclvm_context_t,
     v: *const kclvm_char_t,
 ) -> *mut kclvm_value_ref_t {
@@ -163,14 +165,14 @@ pub unsafe extern "C" fn kclvm_value_Str(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_List(ctx: *mut kclvm_context_t) -> *mut kclvm_value_ref_t {
+pub extern "C-unwind" fn kclvm_value_List(ctx: *mut kclvm_context_t) -> *mut kclvm_value_ref_t {
     let ctx = mut_ptr_as_ref(ctx);
     new_mut_ptr(ctx, ValueRef::list(None))
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_List6(
+pub extern "C-unwind" fn kclvm_value_List6(
     ctx: *mut kclvm_context_t,
     v1: *const kclvm_value_ref_t,
     v2: *const kclvm_value_ref_t,
@@ -189,7 +191,7 @@ pub extern "C" fn kclvm_value_List6(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_List10(
+pub extern "C-unwind" fn kclvm_value_List10(
     ctx: *mut kclvm_context_t,
     v1: *const kclvm_value_ref_t,
     v2: *const kclvm_value_ref_t,
@@ -212,21 +214,21 @@ pub extern "C" fn kclvm_value_List10(
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_Dict(ctx: *mut kclvm_context_t) -> *mut kclvm_value_ref_t {
+pub extern "C-unwind" fn kclvm_value_Dict(ctx: *mut kclvm_context_t) -> *mut kclvm_value_ref_t {
     let ctx = mut_ptr_as_ref(ctx);
     new_mut_ptr(ctx, ValueRef::dict(None))
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_value_Schema(ctx: *mut kclvm_context_t) -> *mut kclvm_value_ref_t {
+pub extern "C-unwind" fn kclvm_value_Schema(ctx: *mut kclvm_context_t) -> *mut kclvm_value_ref_t {
     let ctx = mut_ptr_as_ref(ctx);
     new_mut_ptr(ctx, ValueRef::schema())
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_schema_with_config(
+pub unsafe extern "C-unwind" fn kclvm_value_schema_with_config(
     ctx: *mut kclvm_context_t,
     schema_dict: *const kclvm_value_ref_t,
     config: *const kclvm_value_ref_t,
@@ -291,7 +293,7 @@ pub unsafe extern "C" fn kclvm_value_schema_with_config(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_Function(
+pub unsafe extern "C-unwind" fn kclvm_value_Function(
     ctx: *mut kclvm_context_t,
     fn_ptr: *const u64,
     closure: *const kclvm_value_ref_t,
@@ -316,7 +318,7 @@ pub unsafe extern "C" fn kclvm_value_Function(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_Function_using_ptr(
+pub unsafe extern "C-unwind" fn kclvm_value_Function_using_ptr(
     ctx: *mut kclvm_context_t,
     fn_ptr: *const u64,
     name: *const kclvm_char_t,
@@ -331,7 +333,7 @@ pub unsafe extern "C" fn kclvm_value_Function_using_ptr(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_schema_function(
+pub unsafe extern "C-unwind" fn kclvm_value_schema_function(
     ctx: *mut kclvm_context_t,
     fn_ptr: *const u64,
     check_fn_ptr: *const u64,
@@ -396,7 +398,7 @@ pub unsafe extern "C" fn kclvm_value_schema_function(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_from_json(
+pub unsafe extern "C-unwind" fn kclvm_value_from_json(
     ctx: *mut kclvm_context_t,
     s: *const kclvm_char_t,
 ) -> *mut kclvm_value_ref_t {
@@ -412,7 +414,7 @@ pub unsafe extern "C" fn kclvm_value_from_json(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_to_json_value(
+pub unsafe extern "C-unwind" fn kclvm_value_to_json_value(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
 ) -> *mut kclvm_value_ref_t {
@@ -428,7 +430,7 @@ pub unsafe extern "C" fn kclvm_value_to_json_value(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_to_json_value_with_null(
+pub unsafe extern "C-unwind" fn kclvm_value_to_json_value_with_null(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
 ) -> *mut kclvm_value_ref_t {
@@ -444,7 +446,7 @@ pub unsafe extern "C" fn kclvm_value_to_json_value_with_null(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_plan_to_json(
+pub unsafe extern "C-unwind" fn kclvm_value_plan_to_json(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
 ) -> *mut kclvm_value_ref_t {
@@ -462,7 +464,7 @@ pub unsafe extern "C" fn kclvm_value_plan_to_json(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_plan_to_yaml(
+pub unsafe extern "C-unwind" fn kclvm_value_plan_to_yaml(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
 ) -> *mut kclvm_value_ref_t {
@@ -480,7 +482,7 @@ pub unsafe extern "C" fn kclvm_value_plan_to_yaml(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_to_yaml_value(
+pub unsafe extern "C-unwind" fn kclvm_value_to_yaml_value(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
 ) -> *mut kclvm_value_ref_t {
@@ -496,7 +498,7 @@ pub unsafe extern "C" fn kclvm_value_to_yaml_value(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_to_str_value(
+pub unsafe extern "C-unwind" fn kclvm_value_to_str_value(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
 ) -> *mut kclvm_value_ref_t {
@@ -517,7 +519,9 @@ pub unsafe extern "C" fn kclvm_value_to_str_value(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_Str_ptr(p: *const kclvm_value_ref_t) -> *const kclvm_char_t {
+pub unsafe extern "C-unwind" fn kclvm_value_Str_ptr(
+    p: *const kclvm_value_ref_t,
+) -> *const kclvm_char_t {
     let p = ptr_as_ref(p);
     match &*p.rc.borrow() {
         Value::str_value(ref v) => v.as_ptr() as *const c_char,
@@ -527,7 +531,9 @@ pub unsafe extern "C" fn kclvm_value_Str_ptr(p: *const kclvm_value_ref_t) -> *co
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_function_ptr(p: *const kclvm_value_ref_t) -> *const u64 {
+pub unsafe extern "C-unwind" fn kclvm_value_function_ptr(
+    p: *const kclvm_value_ref_t,
+) -> *const u64 {
     let p = ptr_as_ref(p);
     match &*p.rc.borrow() {
         Value::func_value(ref v) => v.fn_ptr as *const u64,
@@ -537,7 +543,9 @@ pub unsafe extern "C" fn kclvm_value_function_ptr(p: *const kclvm_value_ref_t) -
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_check_function_ptr(p: *const kclvm_value_ref_t) -> *const u64 {
+pub unsafe extern "C-unwind" fn kclvm_value_check_function_ptr(
+    p: *const kclvm_value_ref_t,
+) -> *const u64 {
     let p = ptr_as_ref(p);
     match &*p.rc.borrow() {
         Value::func_value(ref v) => v.check_fn_ptr as *const u64,
@@ -547,7 +555,7 @@ pub unsafe extern "C" fn kclvm_value_check_function_ptr(p: *const kclvm_value_re
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_function_invoke(
+pub unsafe extern "C-unwind" fn kclvm_value_function_invoke(
     p: *const kclvm_value_ref_t,
     ctx: *mut kclvm_context_t,
     args: *mut kclvm_value_ref_t,
@@ -635,7 +643,7 @@ pub unsafe extern "C" fn kclvm_value_function_invoke(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_deep_copy(
+pub unsafe extern "C-unwind" fn kclvm_value_deep_copy(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
 ) -> *mut kclvm_value_ref_t {
@@ -648,7 +656,7 @@ pub unsafe extern "C" fn kclvm_value_deep_copy(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_delete(p: *mut kclvm_value_ref_t) {
+pub unsafe extern "C-unwind" fn kclvm_value_delete(p: *mut kclvm_value_ref_t) {
     if p.is_null() {
         return;
     }
@@ -663,7 +671,9 @@ pub unsafe extern "C" fn kclvm_value_delete(p: *mut kclvm_value_ref_t) {
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_iter(p: *const kclvm_value_ref_t) -> *mut kclvm_iterator_t {
+pub unsafe extern "C-unwind" fn kclvm_value_iter(
+    p: *const kclvm_value_ref_t,
+) -> *mut kclvm_iterator_t {
     let p = ptr_as_ref(p);
     let iter = ValueIterator::from_value(p);
     Box::into_raw(Box::new(iter))
@@ -671,20 +681,20 @@ pub unsafe extern "C" fn kclvm_value_iter(p: *const kclvm_value_ref_t) -> *mut k
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_iterator_delete(p: *mut kclvm_iterator_t) {
+pub unsafe extern "C-unwind" fn kclvm_iterator_delete(p: *mut kclvm_iterator_t) {
     free_mut_ptr(p);
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_iterator_is_end(p: *mut kclvm_iterator_t) -> kclvm_bool_t {
+pub unsafe extern "C-unwind" fn kclvm_iterator_is_end(p: *mut kclvm_iterator_t) -> kclvm_bool_t {
     let p = ptr_as_ref(p);
     p.is_end() as kclvm_bool_t
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_iterator_cur_key(
+pub unsafe extern "C-unwind" fn kclvm_iterator_cur_key(
     p: *mut kclvm_iterator_t,
 ) -> *const kclvm_value_ref_t {
     let p = ptr_as_ref(p);
@@ -696,7 +706,7 @@ pub unsafe extern "C" fn kclvm_iterator_cur_key(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_iterator_cur_value(
+pub unsafe extern "C-unwind" fn kclvm_iterator_cur_value(
     p: *mut kclvm_iterator_t,
 ) -> *const kclvm_value_ref_t {
     let p = mut_ptr_as_ref(p);
@@ -708,7 +718,7 @@ pub unsafe extern "C" fn kclvm_iterator_cur_value(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_iterator_next_value(
+pub unsafe extern "C-unwind" fn kclvm_iterator_next_value(
     p: *mut kclvm_iterator_t,
     host: *const kclvm_value_ref_t,
 ) -> *const kclvm_value_ref_t {
@@ -727,21 +737,24 @@ pub unsafe extern "C" fn kclvm_iterator_next_value(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_len(p: *const kclvm_value_ref_t) -> kclvm_size_t {
+pub unsafe extern "C-unwind" fn kclvm_list_len(p: *const kclvm_value_ref_t) -> kclvm_size_t {
     let p = ptr_as_ref(p);
     p.len() as kclvm_size_t
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_resize(p: *mut kclvm_value_ref_t, newsize: kclvm_size_t) {
+pub unsafe extern "C-unwind" fn kclvm_list_resize(
+    p: *mut kclvm_value_ref_t,
+    newsize: kclvm_size_t,
+) {
     let p = mut_ptr_as_ref(p);
     p.list_resize(newsize as usize);
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_clear(p: *mut kclvm_value_ref_t) {
+pub unsafe extern "C-unwind" fn kclvm_list_clear(p: *mut kclvm_value_ref_t) {
     let p = mut_ptr_as_ref(p);
     p.list_clear();
 }
@@ -749,7 +762,7 @@ pub unsafe extern "C" fn kclvm_list_clear(p: *mut kclvm_value_ref_t) {
 /// Return number of occurrences of the list value.
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_count(
+pub unsafe extern "C-unwind" fn kclvm_list_count(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
     item: *const kclvm_value_ref_t,
@@ -765,7 +778,7 @@ pub unsafe extern "C" fn kclvm_list_count(
 /// Return first index of the list value. Panic if the value is not present.
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_find(
+pub unsafe extern "C-unwind" fn kclvm_list_find(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
     item: *const kclvm_value_ref_t,
@@ -781,7 +794,7 @@ pub unsafe extern "C" fn kclvm_list_find(
 /// Insert object before index of the list value.
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_insert(
+pub unsafe extern "C-unwind" fn kclvm_list_insert(
     p: *mut kclvm_value_ref_t,
     index: *const kclvm_value_ref_t,
     value: *const kclvm_value_ref_t,
@@ -794,7 +807,7 @@ pub unsafe extern "C" fn kclvm_list_insert(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_get(
+pub unsafe extern "C-unwind" fn kclvm_list_get(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
     i: kclvm_size_t,
@@ -809,7 +822,7 @@ pub unsafe extern "C" fn kclvm_list_get(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_get_option(
+pub unsafe extern "C-unwind" fn kclvm_list_get_option(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
     i: kclvm_size_t,
@@ -824,7 +837,7 @@ pub unsafe extern "C" fn kclvm_list_get_option(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_set(
+pub unsafe extern "C-unwind" fn kclvm_list_set(
     p: *mut kclvm_value_ref_t,
     i: kclvm_size_t,
     v: *const kclvm_value_ref_t,
@@ -836,7 +849,7 @@ pub unsafe extern "C" fn kclvm_list_set(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_pop(
+pub unsafe extern "C-unwind" fn kclvm_list_pop(
     ctx: *mut kclvm_context_t,
     p: *mut kclvm_value_ref_t,
 ) -> *const kclvm_value_ref_t {
@@ -850,7 +863,7 @@ pub unsafe extern "C" fn kclvm_list_pop(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_pop_first(
+pub unsafe extern "C-unwind" fn kclvm_list_pop_first(
     ctx: *mut kclvm_context_t,
     p: *mut kclvm_value_ref_t,
 ) -> *const kclvm_value_ref_t {
@@ -863,7 +876,10 @@ pub unsafe extern "C" fn kclvm_list_pop_first(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_append(p: *mut kclvm_value_ref_t, v: *const kclvm_value_ref_t) {
+pub unsafe extern "C-unwind" fn kclvm_list_append(
+    p: *mut kclvm_value_ref_t,
+    v: *const kclvm_value_ref_t,
+) {
     let p = mut_ptr_as_ref(p);
     let v = ptr_as_ref(v);
     p.list_append(v);
@@ -871,35 +887,41 @@ pub unsafe extern "C" fn kclvm_list_append(p: *mut kclvm_value_ref_t, v: *const
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_append_bool(p: *mut kclvm_value_ref_t, v: kclvm_bool_t) {
+pub unsafe extern "C-unwind" fn kclvm_list_append_bool(p: *mut kclvm_value_ref_t, v: kclvm_bool_t) {
     let p = mut_ptr_as_ref(p);
     p.list_append(&ValueRef::bool(v != 0));
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_append_int(p: *mut kclvm_value_ref_t, v: kclvm_int_t) {
+pub unsafe extern "C-unwind" fn kclvm_list_append_int(p: *mut kclvm_value_ref_t, v: kclvm_int_t) {
     let p = mut_ptr_as_ref(p);
     p.list_append(&ValueRef::int(v));
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_append_float(p: *mut kclvm_value_ref_t, v: kclvm_float_t) {
+pub unsafe extern "C-unwind" fn kclvm_list_append_float(
+    p: *mut kclvm_value_ref_t,
+    v: kclvm_float_t,
+) {
     let p = mut_ptr_as_ref(p);
     p.list_append(&ValueRef::float(v));
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_append_str(p: *mut kclvm_value_ref_t, v: *const kclvm_char_t) {
+pub unsafe extern "C-unwind" fn kclvm_list_append_str(
+    p: *mut kclvm_value_ref_t,
+    v: *const kclvm_char_t,
+) {
     let p = mut_ptr_as_ref(p);
     p.list_append(&ValueRef::str(c2str(v)));
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_append_unpack(
+pub unsafe extern "C-unwind" fn kclvm_list_append_unpack(
     p: *mut kclvm_value_ref_t,
     v: *const kclvm_value_ref_t,
 ) {
@@ -913,7 +935,7 @@ pub unsafe extern "C" fn kclvm_list_append_unpack(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_list_remove_at(p: *mut kclvm_value_ref_t, i: kclvm_size_t) {
+pub unsafe extern "C-unwind" fn kclvm_list_remove_at(p: *mut kclvm_value_ref_t, i: kclvm_size_t) {
     let p = mut_ptr_as_ref(p);
     p.list_remove_at(i as usize);
 }
@@ -924,7 +946,7 @@ pub unsafe extern "C" fn kclvm_list_remove_at(p: *mut kclvm_value_ref_t, i: kclv
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_len(p: *const kclvm_value_ref_t) -> kclvm_size_t {
+pub unsafe extern "C-unwind" fn kclvm_dict_len(p: *const kclvm_value_ref_t) -> kclvm_size_t {
     let p = ptr_as_ref(p);
     match &*p.rc.borrow() {
         Value::dict_value(ref dict) => dict.values.len() as kclvm_size_t,
@@ -934,14 +956,14 @@ pub unsafe extern "C" fn kclvm_dict_len(p: *const kclvm_value_ref_t) -> kclvm_si
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_clear(p: *mut kclvm_value_ref_t) {
+pub unsafe extern "C-unwind" fn kclvm_dict_clear(p: *mut kclvm_value_ref_t) {
     let p = mut_ptr_as_ref(p);
     p.dict_clear();
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_is_override_attr(
+pub unsafe extern "C-unwind" fn kclvm_dict_is_override_attr(
     p: *const kclvm_value_ref_t,
     key: *const kclvm_char_t,
 ) -> kclvm_bool_t {
@@ -957,7 +979,7 @@ pub unsafe extern "C" fn kclvm_dict_is_override_attr(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_get(
+pub unsafe extern "C-unwind" fn kclvm_dict_get(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
     key: *const kclvm_value_ref_t,
@@ -973,7 +995,7 @@ pub unsafe extern "C" fn kclvm_dict_get(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_has_value(
+pub unsafe extern "C-unwind" fn kclvm_dict_has_value(
     p: *const kclvm_value_ref_t,
     key: *const kclvm_char_t,
 ) -> kclvm_bool_t {
@@ -987,7 +1009,7 @@ pub unsafe extern "C" fn kclvm_dict_has_value(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_get_value(
+pub unsafe extern "C-unwind" fn kclvm_dict_get_value(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
     key: *const kclvm_char_t,
@@ -1002,7 +1024,7 @@ pub unsafe extern "C" fn kclvm_dict_get_value(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_get_entry(
+pub unsafe extern "C-unwind" fn kclvm_dict_get_entry(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
     key: *const kclvm_char_t,
@@ -1017,7 +1039,7 @@ pub unsafe extern "C" fn kclvm_dict_get_entry(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_get_value_by_path(
+pub unsafe extern "C-unwind" fn kclvm_dict_get_value_by_path(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
     path: *const kclvm_char_t,
@@ -1032,7 +1054,7 @@ pub unsafe extern "C" fn kclvm_dict_get_value_by_path(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_set_value(
+pub unsafe extern "C-unwind" fn kclvm_dict_set_value(
     ctx: *mut kclvm_context_t,
     p: *mut kclvm_value_ref_t,
     key: *const kclvm_char_t,
@@ -1065,7 +1087,7 @@ pub unsafe extern "C" fn kclvm_dict_set_value(
 #[no_mangle]
 #[runtime_fn]
 /// Return all dict keys.
-pub unsafe extern "C" fn kclvm_dict_keys(
+pub unsafe extern "C-unwind" fn kclvm_dict_keys(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
 ) -> *const kclvm_value_ref_t {
@@ -1077,7 +1099,7 @@ pub unsafe extern "C" fn kclvm_dict_keys(
 #[no_mangle]
 #[runtime_fn]
 /// Return all dict values.
-pub unsafe extern "C" fn kclvm_dict_values(
+pub unsafe extern "C-unwind" fn kclvm_dict_values(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
 ) -> *const kclvm_value_ref_t {
@@ -1088,7 +1110,7 @@ pub unsafe extern "C" fn kclvm_dict_values(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_insert(
+pub unsafe extern "C-unwind" fn kclvm_dict_insert(
     ctx: *mut kclvm_context_t,
     p: *mut kclvm_value_ref_t,
     key: *const kclvm_char_t,
@@ -1114,7 +1136,7 @@ pub unsafe extern "C" fn kclvm_dict_insert(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_merge(
+pub unsafe extern "C-unwind" fn kclvm_dict_merge(
     ctx: *mut kclvm_context_t,
     p: *mut kclvm_value_ref_t,
     key: *const kclvm_char_t,
@@ -1164,7 +1186,7 @@ pub unsafe extern "C" fn kclvm_dict_merge(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_insert_value(
+pub unsafe extern "C-unwind" fn kclvm_dict_insert_value(
     ctx: *mut kclvm_context_t,
     p: *mut kclvm_value_ref_t,
     key: *const kclvm_value_ref_t,
@@ -1192,7 +1214,7 @@ pub unsafe extern "C" fn kclvm_dict_insert_value(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_update_key_value(
+pub unsafe extern "C-unwind" fn kclvm_dict_update_key_value(
     p: *mut kclvm_value_ref_t,
     key: *const kclvm_value_ref_t,
     v: *const kclvm_value_ref_t,
@@ -1206,7 +1228,7 @@ pub unsafe extern "C" fn kclvm_dict_update_key_value(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_safe_insert(
+pub unsafe extern "C-unwind" fn kclvm_dict_safe_insert(
     ctx: *mut kclvm_context_t,
     p: *mut kclvm_value_ref_t,
     key: *const kclvm_char_t,
@@ -1223,7 +1245,7 @@ pub unsafe extern "C" fn kclvm_dict_safe_insert(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_insert_unpack(
+pub unsafe extern "C-unwind" fn kclvm_dict_insert_unpack(
     ctx: *mut kclvm_context_t,
     p: *mut kclvm_value_ref_t,
     v: *const kclvm_value_ref_t,
@@ -1236,7 +1258,7 @@ pub unsafe extern "C" fn kclvm_dict_insert_unpack(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_default_collection_insert_int_pointer(
+pub unsafe extern "C-unwind" fn kclvm_default_collection_insert_int_pointer(
     p: *mut kclvm_value_ref_t,
     key: *const kclvm_char_t,
     ptr: *const u64,
@@ -1260,7 +1282,7 @@ pub unsafe extern "C" fn kclvm_default_collection_insert_int_pointer(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_default_collection_insert_value(
+pub unsafe extern "C-unwind" fn kclvm_default_collection_insert_value(
     p: *mut kclvm_value_ref_t,
     key: *const kclvm_char_t,
     value: *const kclvm_value_ref_t,
@@ -1283,14 +1305,20 @@ pub unsafe extern "C" fn kclvm_default_collection_insert_value(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_remove(p: *mut kclvm_value_ref_t, key: *const kclvm_char_t) {
+pub unsafe extern "C-unwind" fn kclvm_dict_remove(
+    p: *mut kclvm_value_ref_t,
+    key: *const kclvm_char_t,
+) {
     let p = mut_ptr_as_ref(p);
     p.dict_remove(c2str(key));
 }
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_dict_update(p: *mut kclvm_value_ref_t, v: *const kclvm_value_ref_t) {
+pub unsafe extern "C-unwind" fn kclvm_dict_update(
+    p: *mut kclvm_value_ref_t,
+    v: *const kclvm_value_ref_t,
+) {
     let p = mut_ptr_as_ref(p);
     let v = ptr_as_ref(v);
     p.dict_update(v);
@@ -1304,7 +1332,7 @@ pub unsafe extern "C" fn kclvm_dict_update(p: *mut kclvm_value_ref_t, v: *const
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_is_truthy(p: *const kclvm_value_ref_t) -> kclvm_bool_t {
+pub unsafe extern "C-unwind" fn kclvm_value_is_truthy(p: *const kclvm_value_ref_t) -> kclvm_bool_t {
     let p = ptr_as_ref(p);
     p.is_truthy() as kclvm_bool_t
 }
@@ -1313,7 +1341,7 @@ pub unsafe extern "C" fn kclvm_value_is_truthy(p: *const kclvm_value_ref_t) -> k
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_len(p: *const kclvm_value_ref_t) -> kclvm_size_t {
+pub unsafe extern "C-unwind" fn kclvm_value_len(p: *const kclvm_value_ref_t) -> kclvm_size_t {
     let p = ptr_as_ref(p);
     p.len() as kclvm_size_t
 }
@@ -1322,7 +1350,7 @@ pub unsafe extern "C" fn kclvm_value_len(p: *const kclvm_value_ref_t) -> kclvm_s
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_cmp_equal_to(
+pub unsafe extern "C-unwind" fn kclvm_value_cmp_equal_to(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1337,7 +1365,7 @@ pub unsafe extern "C" fn kclvm_value_cmp_equal_to(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_cmp_not_equal_to(
+pub unsafe extern "C-unwind" fn kclvm_value_cmp_not_equal_to(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1352,7 +1380,7 @@ pub unsafe extern "C" fn kclvm_value_cmp_not_equal_to(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_cmp_less_than(
+pub unsafe extern "C-unwind" fn kclvm_value_cmp_less_than(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1367,7 +1395,7 @@ pub unsafe extern "C" fn kclvm_value_cmp_less_than(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_cmp_less_than_or_equal(
+pub unsafe extern "C-unwind" fn kclvm_value_cmp_less_than_or_equal(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1379,7 +1407,7 @@ pub unsafe extern "C" fn kclvm_value_cmp_less_than_or_equal(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_cmp_greater_than(
+pub unsafe extern "C-unwind" fn kclvm_value_cmp_greater_than(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1394,7 +1422,7 @@ pub unsafe extern "C" fn kclvm_value_cmp_greater_than(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_cmp_greater_than_or_equal(
+pub unsafe extern "C-unwind" fn kclvm_value_cmp_greater_than_or_equal(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1408,7 +1436,7 @@ pub unsafe extern "C" fn kclvm_value_cmp_greater_than_or_equal(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_is(
+pub unsafe extern "C-unwind" fn kclvm_value_is(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1423,7 +1451,7 @@ pub unsafe extern "C" fn kclvm_value_is(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_is_not(
+pub unsafe extern "C-unwind" fn kclvm_value_is_not(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1438,7 +1466,7 @@ pub unsafe extern "C" fn kclvm_value_is_not(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_in(
+pub unsafe extern "C-unwind" fn kclvm_value_in(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1450,7 +1478,7 @@ pub unsafe extern "C" fn kclvm_value_in(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_not_in(
+pub unsafe extern "C-unwind" fn kclvm_value_not_in(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1462,7 +1490,7 @@ pub unsafe extern "C" fn kclvm_value_not_in(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_as(
+pub unsafe extern "C-unwind" fn kclvm_value_as(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1479,7 +1507,7 @@ pub unsafe extern "C" fn kclvm_value_as(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_unary_plus(
+pub unsafe extern "C-unwind" fn kclvm_value_unary_plus(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
 ) -> *mut kclvm_value_ref_t {
@@ -1489,7 +1517,7 @@ pub unsafe extern "C" fn kclvm_value_unary_plus(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_unary_minus(
+pub unsafe extern "C-unwind" fn kclvm_value_unary_minus(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
 ) -> *mut kclvm_value_ref_t {
@@ -1499,7 +1527,7 @@ pub unsafe extern "C" fn kclvm_value_unary_minus(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_unary_not(
+pub unsafe extern "C-unwind" fn kclvm_value_unary_not(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
 ) -> *mut kclvm_value_ref_t {
@@ -1509,7 +1537,7 @@ pub unsafe extern "C" fn kclvm_value_unary_not(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_unary_l_not(
+pub unsafe extern "C-unwind" fn kclvm_value_unary_l_not(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
 ) -> *mut kclvm_value_ref_t {
@@ -1521,7 +1549,7 @@ pub unsafe extern "C" fn kclvm_value_unary_l_not(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_add(
+pub unsafe extern "C-unwind" fn kclvm_value_op_add(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1534,7 +1562,7 @@ pub unsafe extern "C" fn kclvm_value_op_add(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_sub(
+pub unsafe extern "C-unwind" fn kclvm_value_op_sub(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1547,7 +1575,7 @@ pub unsafe extern "C" fn kclvm_value_op_sub(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_mul(
+pub unsafe extern "C-unwind" fn kclvm_value_op_mul(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1560,7 +1588,7 @@ pub unsafe extern "C" fn kclvm_value_op_mul(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_div(
+pub unsafe extern "C-unwind" fn kclvm_value_op_div(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1572,7 +1600,7 @@ pub unsafe extern "C" fn kclvm_value_op_div(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_mod(
+pub unsafe extern "C-unwind" fn kclvm_value_op_mod(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1584,7 +1612,7 @@ pub unsafe extern "C" fn kclvm_value_op_mod(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_pow(
+pub unsafe extern "C-unwind" fn kclvm_value_op_pow(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1597,7 +1625,7 @@ pub unsafe extern "C" fn kclvm_value_op_pow(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_floor_div(
+pub unsafe extern "C-unwind" fn kclvm_value_op_floor_div(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1609,7 +1637,7 @@ pub unsafe extern "C" fn kclvm_value_op_floor_div(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_bit_lshift(
+pub unsafe extern "C-unwind" fn kclvm_value_op_bit_lshift(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1622,7 +1650,7 @@ pub unsafe extern "C" fn kclvm_value_op_bit_lshift(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_bit_rshift(
+pub unsafe extern "C-unwind" fn kclvm_value_op_bit_rshift(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1635,7 +1663,7 @@ pub unsafe extern "C" fn kclvm_value_op_bit_rshift(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_bit_and(
+pub unsafe extern "C-unwind" fn kclvm_value_op_bit_and(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1647,7 +1675,7 @@ pub unsafe extern "C" fn kclvm_value_op_bit_and(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_bit_xor(
+pub unsafe extern "C-unwind" fn kclvm_value_op_bit_xor(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1659,7 +1687,7 @@ pub unsafe extern "C" fn kclvm_value_op_bit_xor(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_bit_or(
+pub unsafe extern "C-unwind" fn kclvm_value_op_bit_or(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1674,7 +1702,7 @@ pub unsafe extern "C" fn kclvm_value_op_bit_or(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_aug_add(
+pub unsafe extern "C-unwind" fn kclvm_value_op_aug_add(
     ctx: *mut kclvm_context_t,
     a: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1687,7 +1715,7 @@ pub unsafe extern "C" fn kclvm_value_op_aug_add(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_aug_sub(
+pub unsafe extern "C-unwind" fn kclvm_value_op_aug_sub(
     ctx: *mut kclvm_context_t,
     a: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1700,7 +1728,7 @@ pub unsafe extern "C" fn kclvm_value_op_aug_sub(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_aug_mul(
+pub unsafe extern "C-unwind" fn kclvm_value_op_aug_mul(
     ctx: *mut kclvm_context_t,
     a: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1713,7 +1741,7 @@ pub unsafe extern "C" fn kclvm_value_op_aug_mul(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_aug_div(
+pub unsafe extern "C-unwind" fn kclvm_value_op_aug_div(
     _ctx: *mut kclvm_context_t,
     a: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1725,7 +1753,7 @@ pub unsafe extern "C" fn kclvm_value_op_aug_div(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_aug_mod(
+pub unsafe extern "C-unwind" fn kclvm_value_op_aug_mod(
     _ctx: *mut kclvm_context_t,
     a: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1737,7 +1765,7 @@ pub unsafe extern "C" fn kclvm_value_op_aug_mod(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_aug_pow(
+pub unsafe extern "C-unwind" fn kclvm_value_op_aug_pow(
     ctx: *mut kclvm_context_t,
     a: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1750,7 +1778,7 @@ pub unsafe extern "C" fn kclvm_value_op_aug_pow(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_aug_floor_div(
+pub unsafe extern "C-unwind" fn kclvm_value_op_aug_floor_div(
     _ctx: *mut kclvm_context_t,
     a: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1762,7 +1790,7 @@ pub unsafe extern "C" fn kclvm_value_op_aug_floor_div(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_aug_bit_lshift(
+pub unsafe extern "C-unwind" fn kclvm_value_op_aug_bit_lshift(
     ctx: *mut kclvm_context_t,
     a: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1775,7 +1803,7 @@ pub unsafe extern "C" fn kclvm_value_op_aug_bit_lshift(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_aug_bit_rshift(
+pub unsafe extern "C-unwind" fn kclvm_value_op_aug_bit_rshift(
     ctx: *mut kclvm_context_t,
     a: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1788,7 +1816,7 @@ pub unsafe extern "C" fn kclvm_value_op_aug_bit_rshift(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_aug_bit_and(
+pub unsafe extern "C-unwind" fn kclvm_value_op_aug_bit_and(
     _ctx: *mut kclvm_context_t,
     a: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1800,7 +1828,7 @@ pub unsafe extern "C" fn kclvm_value_op_aug_bit_and(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_aug_bit_xor(
+pub unsafe extern "C-unwind" fn kclvm_value_op_aug_bit_xor(
     _ctx: *mut kclvm_context_t,
     a: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1812,7 +1840,7 @@ pub unsafe extern "C" fn kclvm_value_op_aug_bit_xor(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_op_aug_bit_or(
+pub unsafe extern "C-unwind" fn kclvm_value_op_aug_bit_or(
     ctx: *mut kclvm_context_t,
     a: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1825,7 +1853,7 @@ pub unsafe extern "C" fn kclvm_value_op_aug_bit_or(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_union(
+pub unsafe extern "C-unwind" fn kclvm_value_union(
     ctx: *mut kclvm_context_t,
     schema: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1864,7 +1892,7 @@ pub unsafe extern "C" fn kclvm_value_union(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_logic_and(
+pub unsafe extern "C-unwind" fn kclvm_value_logic_and(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1876,7 +1904,7 @@ pub unsafe extern "C" fn kclvm_value_logic_and(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_logic_or(
+pub unsafe extern "C-unwind" fn kclvm_value_logic_or(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1888,7 +1916,7 @@ pub unsafe extern "C" fn kclvm_value_logic_or(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_subscr(
+pub unsafe extern "C-unwind" fn kclvm_value_subscr(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1900,7 +1928,7 @@ pub unsafe extern "C" fn kclvm_value_subscr(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_subscr_set(
+pub unsafe extern "C-unwind" fn kclvm_value_subscr_set(
     ctx: *mut kclvm_context_t,
     p: *mut kclvm_value_ref_t,
     index: *const kclvm_value_ref_t,
@@ -1915,7 +1943,7 @@ pub unsafe extern "C" fn kclvm_value_subscr_set(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_subscr_option(
+pub unsafe extern "C-unwind" fn kclvm_value_subscr_option(
     ctx: *mut kclvm_context_t,
     a: *const kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
@@ -1927,7 +1955,7 @@ pub unsafe extern "C" fn kclvm_value_subscr_option(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_load_attr(
+pub unsafe extern "C-unwind" fn kclvm_value_load_attr(
     ctx: *mut kclvm_context_t,
     obj: *const kclvm_value_ref_t,
     key: *const kclvm_char_t,
@@ -1940,7 +1968,7 @@ pub unsafe extern "C" fn kclvm_value_load_attr(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_load_attr_option(
+pub unsafe extern "C-unwind" fn kclvm_value_load_attr_option(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
     key: *const kclvm_char_t,
@@ -1955,7 +1983,7 @@ pub unsafe extern "C" fn kclvm_value_load_attr_option(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_remove_item(
+pub unsafe extern "C-unwind" fn kclvm_value_remove_item(
     a: *mut kclvm_value_ref_t,
     b: *const kclvm_value_ref_t,
 ) {
@@ -1972,7 +2000,7 @@ pub unsafe extern "C" fn kclvm_value_remove_item(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_slice(
+pub unsafe extern "C-unwind" fn kclvm_value_slice(
     ctx: *mut kclvm_context_t,
     x: *const kclvm_value_ref_t,
     a: *const kclvm_value_ref_t,
@@ -1988,7 +2016,7 @@ pub unsafe extern "C" fn kclvm_value_slice(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_slice_option(
+pub unsafe extern "C-unwind" fn kclvm_value_slice_option(
     ctx: *mut kclvm_context_t,
     x: *const kclvm_value_ref_t,
     a: *const kclvm_value_ref_t,
@@ -2009,7 +2037,7 @@ pub unsafe extern "C" fn kclvm_value_slice_option(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_schema_backtrack_cache(
+pub unsafe extern "C-unwind" fn kclvm_schema_backtrack_cache(
     ctx: *mut kclvm_context_t,
     schema: *const kclvm_value_ref_t,
     cache: *mut kclvm_value_ref_t,
@@ -2050,7 +2078,7 @@ pub unsafe extern "C" fn kclvm_schema_backtrack_cache(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_schema_instances(
+pub unsafe extern "C-unwind" fn kclvm_schema_instances(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -2119,7 +2147,7 @@ fn collect_schema_instances(list: &mut ValueRef, v_list: &[ValueRef], runtime_ty
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_schema_value_check(
+pub unsafe extern "C-unwind" fn kclvm_schema_value_check(
     ctx: *mut kclvm_context_t,
     schema_value: *mut kclvm_value_ref_t,
     schema_config: *const kclvm_value_ref_t,
@@ -2182,7 +2210,7 @@ pub unsafe extern "C" fn kclvm_schema_value_check(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_schema_do_check_with_index_sign_attr(
+pub unsafe extern "C-unwind" fn kclvm_schema_do_check_with_index_sign_attr(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -2225,7 +2253,7 @@ pub unsafe extern "C" fn kclvm_schema_do_check_with_index_sign_attr(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_schema_optional_check(
+pub unsafe extern "C-unwind" fn kclvm_schema_optional_check(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
 ) {
@@ -2238,7 +2266,7 @@ pub unsafe extern "C" fn kclvm_schema_optional_check(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_schema_default_settings(
+pub unsafe extern "C-unwind" fn kclvm_schema_default_settings(
     schema_value: *mut kclvm_value_ref_t,
     _config_value: *const kclvm_value_ref_t,
     args: *const kclvm_value_ref_t,
@@ -2255,7 +2283,7 @@ pub unsafe extern "C" fn kclvm_schema_default_settings(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_schema_assert(
+pub unsafe extern "C-unwind" fn kclvm_schema_assert(
     ctx: *mut kclvm_context_t,
     value: *const kclvm_value_ref_t,
     msg: *const kclvm_value_ref_t,
@@ -2294,7 +2322,7 @@ pub unsafe extern "C" fn kclvm_schema_assert(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_schema_value_new(
+pub unsafe extern "C-unwind" fn kclvm_schema_value_new(
     ctx: *mut kclvm_context_t,
     args: *mut kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -2395,7 +2423,7 @@ pub unsafe extern "C" fn kclvm_schema_value_new(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_convert_collection_value(
+pub unsafe extern "C-unwind" fn kclvm_convert_collection_value(
     ctx: *mut kclvm_context_t,
     value: *const kclvm_value_ref_t,
     tpe: *const kclvm_char_t,
@@ -2419,7 +2447,7 @@ pub unsafe extern "C" fn kclvm_convert_collection_value(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_schema_get_value(
+pub unsafe extern "C-unwind" fn kclvm_schema_get_value(
     ctx: *mut kclvm_context_t,
     p: *const kclvm_value_ref_t,
     key: *const kclvm_char_t,
@@ -2513,7 +2541,7 @@ pub unsafe extern "C" fn kclvm_schema_get_value(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_config_attr_map(
+pub unsafe extern "C-unwind" fn kclvm_config_attr_map(
     value: *mut kclvm_value_ref_t,
     name: *const kclvm_char_t,
     type_str: *const kclvm_char_t,
@@ -2530,7 +2558,7 @@ pub unsafe extern "C" fn kclvm_config_attr_map(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_value_Decorator(
+pub unsafe extern "C-unwind" fn kclvm_value_Decorator(
     ctx: *mut kclvm_context_t,
     name: *const kclvm_char_t,
     args: *const kclvm_value_ref_t,
@@ -2564,7 +2592,7 @@ pub unsafe extern "C" fn kclvm_value_Decorator(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_lower(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_lower(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2579,7 +2607,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_lower(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_upper(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_upper(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2594,7 +2622,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_upper(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_capitalize(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_capitalize(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2609,7 +2637,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_capitalize(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_chars(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_chars(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2624,7 +2652,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_chars(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_count(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_count(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2646,7 +2674,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_count(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_endswith(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_endswith(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2668,7 +2696,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_endswith(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_find(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_find(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2690,7 +2718,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_find(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_format(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_format(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -2706,7 +2734,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_format(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_index(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_index(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2728,7 +2756,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_index(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_isalnum(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_isalnum(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2743,7 +2771,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_isalnum(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_isalpha(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_isalpha(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2758,7 +2786,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_isalpha(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_isdigit(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_isdigit(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2773,7 +2801,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_isdigit(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_islower(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_islower(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2788,7 +2816,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_islower(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_isspace(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_isspace(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2803,7 +2831,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_isspace(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_istitle(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_istitle(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2818,7 +2846,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_istitle(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_isupper(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_isupper(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2833,7 +2861,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_isupper(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_join(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_join(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2849,7 +2877,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_join(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_lstrip(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_lstrip(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2865,7 +2893,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_lstrip(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_rstrip(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_rstrip(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2881,7 +2909,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_rstrip(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_replace(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_replace(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2902,7 +2930,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_replace(
 /// Otherwise, return a copy of the original string.
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_removeprefix(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_removeprefix(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2920,7 +2948,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_removeprefix(
 /// Otherwise, return a copy of the original string.
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_removesuffix(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_removesuffix(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2936,7 +2964,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_removesuffix(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_rfind(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_rfind(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2958,7 +2986,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_rfind(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_rindex(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_rindex(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -2980,7 +3008,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_rindex(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_rsplit(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_rsplit(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -3007,7 +3035,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_rsplit(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_split(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_split(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -3034,7 +3062,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_split(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_splitlines(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_splitlines(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -3058,7 +3086,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_splitlines(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_startswith(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_startswith(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -3080,7 +3108,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_startswith(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_strip(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_strip(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
@@ -3096,7 +3124,7 @@ pub unsafe extern "C" fn kclvm_builtin_str_strip(
 
 #[no_mangle]
 #[runtime_fn]
-pub unsafe extern "C" fn kclvm_builtin_str_title(
+pub unsafe extern "C-unwind" fn kclvm_builtin_str_title(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     _kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/value/val_type.rs b/kclvm/runtime/src/value/val_type.rs
index 8b19a2d1d..66b631e4c 100644
--- a/kclvm/runtime/src/value/val_type.rs
+++ b/kclvm/runtime/src/value/val_type.rs
@@ -37,7 +37,7 @@ pub const NUMBER_MULTIPLIER_TYPE: &str = "units.NumberMultiplier";
 pub const NUMBER_MULTIPLIER_REGEX: &str =
     r"^([1-9][0-9]{0,63})(E|P|T|G|M|K|k|m|u|n|Ei|Pi|Ti|Gi|Mi|Ki)$";
 
-pub type SchemaTypeFunc = unsafe extern "C" fn(
+pub type SchemaTypeFunc = unsafe extern "C-unwind" fn(
     *mut kclvm_context_t,
     *const kclvm_value_ref_t,
     *const kclvm_value_ref_t,
diff --git a/kclvm/runtime/src/yaml/mod.rs b/kclvm/runtime/src/yaml/mod.rs
index edcfdf0c2..80cd78f8c 100644
--- a/kclvm/runtime/src/yaml/mod.rs
+++ b/kclvm/runtime/src/yaml/mod.rs
@@ -7,7 +7,7 @@ pub const JSON_STREAM_SEP: &str = "\n";
 /// encode(data, sort_keys=False, ignore_private=False, ignore_none=False)
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_yaml_encode(
+pub extern "C-unwind" fn kclvm_yaml_encode(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -28,7 +28,7 @@ pub extern "C" fn kclvm_yaml_encode(
 /// encode_all(data, sort_keys=False, ignore_private=False, ignore_none=False)
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_yaml_encode_all(
+pub extern "C-unwind" fn kclvm_yaml_encode_all(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -53,7 +53,7 @@ pub extern "C" fn kclvm_yaml_encode_all(
 /// decode(value)
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_yaml_decode(
+pub extern "C-unwind" fn kclvm_yaml_decode(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -74,7 +74,7 @@ pub extern "C" fn kclvm_yaml_decode(
 /// decode_all(value)
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_yaml_decode_all(
+pub extern "C-unwind" fn kclvm_yaml_decode_all(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -95,7 +95,7 @@ pub extern "C" fn kclvm_yaml_decode_all(
 /// dump_to_file(data, sort_keys=False, ignore_private=False, ignore_none=False)
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_yaml_dump_to_file(
+pub extern "C-unwind" fn kclvm_yaml_dump_to_file(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -122,7 +122,7 @@ pub extern "C" fn kclvm_yaml_dump_to_file(
 /// dump_all_to_file(data, sort_keys=False, ignore_private=False, ignore_none=False)
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_yaml_dump_all_to_file(
+pub extern "C-unwind" fn kclvm_yaml_dump_all_to_file(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
@@ -157,7 +157,7 @@ pub extern "C" fn kclvm_yaml_dump_all_to_file(
 /// validate(value: str) -> bool
 #[no_mangle]
 #[runtime_fn]
-pub extern "C" fn kclvm_yaml_validate(
+pub extern "C-unwind" fn kclvm_yaml_validate(
     ctx: *mut kclvm_context_t,
     args: *const kclvm_value_ref_t,
     kwargs: *const kclvm_value_ref_t,
diff --git a/kclvm/src/capi.rs b/kclvm/src/capi.rs
index feea2d0bf..65e39378a 100644
--- a/kclvm/src/capi.rs
+++ b/kclvm/src/capi.rs
@@ -12,7 +12,7 @@ use crate::{intern_fmt, intern_run};
 ///
 /// _This implementation is copied from wasm-bindgen_
 #[no_mangle]
-pub unsafe extern "C" fn kcl_malloc(size: usize) -> *mut u8 {
+pub unsafe extern "C-unwind" fn kcl_malloc(size: usize) -> *mut u8 {
     let align = mem::align_of::<usize>();
     let layout = Layout::from_size_align(size, align).expect("Invalid layout");
     if layout.size() > 0 {
@@ -32,7 +32,7 @@ pub unsafe extern "C" fn kcl_malloc(size: usize) -> *mut u8 {
 ///
 /// _This implementation is copied from wasm-bindgen_
 #[no_mangle]
-pub unsafe extern "C" fn kcl_free(ptr: *mut u8, size: usize) {
+pub unsafe extern "C-unwind" fn kcl_free(ptr: *mut u8, size: usize) {
     // This happens for zero-length slices, and in that case `ptr` is
     // likely bogus so don't actually send this to the system allocator
     if size == 0 {
@@ -53,7 +53,7 @@ pub struct ExecProgramResult {
 
 /// Execute KCL file with arguments and return the JSON/YAML result.
 #[no_mangle]
-pub unsafe extern "C" fn kcl_exec_program(
+pub unsafe extern "C-unwind" fn kcl_exec_program(
     filename_ptr: *const c_char,
     src_ptr: *const c_char,
 ) -> *const ExecProgramResult {
@@ -93,7 +93,7 @@ pub unsafe extern "C" fn kcl_exec_program(
 
 /// Free memory allocated for the ExecProgramResult.
 #[no_mangle]
-pub unsafe extern "C" fn kcl_free_exec_program_result(result: *const ExecProgramResult) {
+pub unsafe extern "C-unwind" fn kcl_free_exec_program_result(result: *const ExecProgramResult) {
     if result.is_null() {
         return;
     }
@@ -118,7 +118,7 @@ pub unsafe extern "C" fn kcl_free_exec_program_result(result: *const ExecProgram
 
 /// Get the YAML result from ExecProgramResult.
 #[no_mangle]
-pub unsafe extern "C" fn kcl_result_get_yaml_result(
+pub unsafe extern "C-unwind" fn kcl_result_get_yaml_result(
     result: *const ExecProgramResult,
 ) -> *const c_char {
     if result.is_null() {
@@ -135,7 +135,7 @@ pub unsafe extern "C" fn kcl_result_get_yaml_result(
 
 /// Get the JSON result from ExecProgramResult.
 #[no_mangle]
-pub unsafe extern "C" fn kcl_result_get_json_result(
+pub unsafe extern "C-unwind" fn kcl_result_get_json_result(
     result: *const ExecProgramResult,
 ) -> *const c_char {
     if result.is_null() {
@@ -152,7 +152,7 @@ pub unsafe extern "C" fn kcl_result_get_json_result(
 
 /// Get the error message from ExecProgramResult.
 #[no_mangle]
-pub unsafe extern "C" fn kcl_result_get_err_message(
+pub unsafe extern "C-unwind" fn kcl_result_get_err_message(
     result: *const ExecProgramResult,
 ) -> *const c_char {
     if result.is_null() {
@@ -169,7 +169,7 @@ pub unsafe extern "C" fn kcl_result_get_err_message(
 
 /// Get the log message from ExecProgramResult.
 #[no_mangle]
-pub unsafe extern "C" fn kcl_result_get_log_message(
+pub unsafe extern "C-unwind" fn kcl_result_get_log_message(
     result: *const ExecProgramResult,
 ) -> *const c_char {
     if result.is_null() {
@@ -186,7 +186,7 @@ pub unsafe extern "C" fn kcl_result_get_log_message(
 
 /// Exposes a normal kcl run function to the WASM host.
 #[no_mangle]
-pub unsafe extern "C" fn kcl_run(
+pub unsafe extern "C-unwind" fn kcl_run(
     filename_ptr: *const c_char,
     src_ptr: *const c_char,
 ) -> *const c_char {
@@ -204,7 +204,7 @@ pub unsafe extern "C" fn kcl_run(
 
 /// Exposes a normal kcl run function with the log message to the WASM host.
 #[no_mangle]
-pub unsafe extern "C" fn kcl_run_with_log_message(
+pub unsafe extern "C-unwind" fn kcl_run_with_log_message(
     filename_ptr: *const c_char,
     src_ptr: *const c_char,
 ) -> *const c_char {
@@ -224,7 +224,7 @@ pub unsafe extern "C" fn kcl_run_with_log_message(
 
 /// Exposes a normal kcl fmt function to the WASM host.
 #[no_mangle]
-pub unsafe extern "C" fn kcl_fmt(src_ptr: *const c_char) -> *const c_char {
+pub unsafe extern "C-unwind" fn kcl_fmt(src_ptr: *const c_char) -> *const c_char {
     if src_ptr.is_null() {
         return std::ptr::null();
     }
@@ -238,13 +238,13 @@ pub unsafe extern "C" fn kcl_fmt(src_ptr: *const c_char) -> *const c_char {
 
 /// Exposes a normal kcl version function to the WASM host.
 #[no_mangle]
-pub unsafe extern "C" fn kcl_version() -> *const c_char {
+pub unsafe extern "C-unwind" fn kcl_version() -> *const c_char {
     CString::new(kclvm_version::VERSION).unwrap().into_raw()
 }
 
 /// Exposes a normal kcl runtime error function to the WASM host.
 #[no_mangle]
-pub unsafe extern "C" fn kcl_runtime_err(buffer: *mut u8, length: usize) -> isize {
+pub unsafe extern "C-unwind" fn kcl_runtime_err(buffer: *mut u8, length: usize) -> isize {
     KCL_RUNTIME_PANIC_RECORD.with(|e| {
         let message = &e.borrow().message;
         if !message.is_empty() {
diff --git a/kclvm/src/lib.rs b/kclvm/src/lib.rs
index 649194fd8..e8f5b2374 100644
--- a/kclvm/src/lib.rs
+++ b/kclvm/src/lib.rs
@@ -16,7 +16,7 @@ use kclvm_runtime::PanicInfo;
 ///
 /// args is a ExecProgramArgs JSON string.
 #[no_mangle]
-pub unsafe extern "C" fn kclvm_cli_run(
+pub unsafe extern "C-unwind" fn kclvm_cli_run(
     args: *const c_char,
     plugin_agent: *const c_char,
 ) -> *const c_char {
@@ -70,7 +70,10 @@ fn kclvm_cli_run_unsafe(
 
 /// KCL CLI main function CAPI.
 #[no_mangle]
-pub unsafe extern "C" fn kclvm_cli_main(argc: c_int, argv: *const *const c_char) -> *mut ExitCode {
+pub unsafe extern "C-unwind" fn kclvm_cli_main(
+    argc: c_int,
+    argv: *const *const c_char,
+) -> *mut ExitCode {
     let prev_hook = std::panic::take_hook();
 
     // disable print panic info
diff --git a/scripts/docker/kcl-builder-alpine/Dockerfile b/scripts/docker/kcl-builder-alpine/Dockerfile
index 5bc9f3f80..08c85f69e 100644
--- a/scripts/docker/kcl-builder-alpine/Dockerfile
+++ b/scripts/docker/kcl-builder-alpine/Dockerfile
@@ -28,7 +28,7 @@ ENV GOPATH=/go \
     CARGO_NET_GIT_FETCH_WITH_CLI=true
 
 # install rust and cargo
-RUN wget -qO- https://sh.rustup.rs | sh -s -- -y \
+RUN wget -qO- https://sh.rustup.rs | bash -s -- -y --default-toolchain 1.83.0 \
     && echo 'source $HOME/.cargo/env' >> $HOME/.ashrc \
     && . $HOME/.cargo/env \
     && cargo version \
diff --git a/scripts/docker/kcl-builder-arm64/Dockerfile b/scripts/docker/kcl-builder-arm64/Dockerfile
index d9a0ed963..640e70244 100644
--- a/scripts/docker/kcl-builder-arm64/Dockerfile
+++ b/scripts/docker/kcl-builder-arm64/Dockerfile
@@ -1,5 +1,5 @@
 # Copyright The KCL Authors. All rights reserved.
-# Builder for kcllang/kcl-builder-arm64 image
+# Builder for ghcr.io/kcl-lang/kcl-builder-arm64 image
 
 FROM arm64v8/ubuntu:20.04
 
@@ -12,7 +12,7 @@ RUN apt-get install -y curl make gcc git zlib1g-dev
 RUN apt install -y pkg-config libssl-dev
 
 # rust
-RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
+RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.83.0
 ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
 
 RUN cargo version
diff --git a/scripts/docker/kcl-builder-centos7/Dockerfile b/scripts/docker/kcl-builder-centos7/Dockerfile
index b860b965f..bf5ed977b 100644
--- a/scripts/docker/kcl-builder-centos7/Dockerfile
+++ b/scripts/docker/kcl-builder-centos7/Dockerfile
@@ -44,7 +44,7 @@ RUN yum install -y wget
 
 # rust
 # https://www.rust-lang.org/tools/install
-RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
+RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.83.0
 ENV PATH="/root/.cargo/bin:${PATH}"
 ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
 
diff --git a/scripts/docker/kcl-builder-centos8/Dockerfile b/scripts/docker/kcl-builder-centos8/Dockerfile
index 92edb3d11..72e0125b5 100644
--- a/scripts/docker/kcl-builder-centos8/Dockerfile
+++ b/scripts/docker/kcl-builder-centos8/Dockerfile
@@ -23,7 +23,7 @@ RUN yum -y install ca-certificates
 # rust-1.54.0
 # cargo 1.54.0
 # RUN yum -y install rust cargo rustfmt
-RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
+RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.83.0
 RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
 
 ENV PATH="/root/.cargo/bin:${PATH}"
diff --git a/scripts/docker/kcl-builder-fedora39/Dockerfile b/scripts/docker/kcl-builder-fedora39/Dockerfile
index 1d0245437..2d1e52c2e 100644
--- a/scripts/docker/kcl-builder-fedora39/Dockerfile
+++ b/scripts/docker/kcl-builder-fedora39/Dockerfile
@@ -13,7 +13,7 @@ RUN sed -i -e "s|#baseurl=http://download.example/pub/fedora/linux|baseurl=https
 RUN dnf -y install make which wget git ca-certificates clang llvm-devel libffi-devel python3-devel
 
 # rust
-RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
+RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.83.0
     echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
 ENV PATH="/root/.cargo/bin:${PATH}"
 ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
diff --git a/scripts/docker/kcl-builder/Dockerfile b/scripts/docker/kcl-builder/Dockerfile
index b79efa091..c5223cd49 100644
--- a/scripts/docker/kcl-builder/Dockerfile
+++ b/scripts/docker/kcl-builder/Dockerfile
@@ -1,6 +1,6 @@
 # Copyright The KCL Authors. All rights reserved.
 
-FROM ubuntu:22.04
+FROM ghcr.io/zong-zhe/ubuntu:22.04
 
 #RUN uname -a
 #RUN cat /etc/os-release
@@ -28,7 +28,7 @@ RUN ln -sf /usr/local/python3.9/bin/python3.9 /usr/bin/python3.9
 
 # rust
 # https://www.rust-lang.org/tools/install
-RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
+RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.83.0
 ENV PATH="/root/.cargo/bin:${PATH}"
 ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
 
@@ -49,7 +49,6 @@ RUN mkdir -p /root/download && cd /root/download \
   && tar -zxvf go1.20.5.linux-amd64.tar.gz \
   && mv ./go /usr/local/go1.20.5
 RUN ln -sf /usr/local/go1.20.5/bin/go /usr/bin/go
-RUN rm -rf /root/download
 
 ENV GOPATH=/go
 ENV GOLANG_VERSION=1.20.5


Test patch:
diff --git a/.github/workflows/build-test-macos-arm64.yml b/.github/workflows/build-test-macos-arm64.yml
index fc5b770ee..0fe587251 100644
--- a/.github/workflows/build-test-macos-arm64.yml
+++ b/.github/workflows/build-test-macos-arm64.yml
@@ -32,7 +32,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.79
+          toolchain: 1.83
           override: true
           components: clippy, rustfmt
       - name: Set up python
diff --git a/.github/workflows/build-test-ubuntu-arm64.yml b/.github/workflows/build-test-ubuntu-arm64.yml
index b084c711a..f2c761c8e 100644
--- a/.github/workflows/build-test-ubuntu-arm64.yml
+++ b/.github/workflows/build-test-ubuntu-arm64.yml
@@ -26,13 +26,13 @@ jobs:
 
       - name: Pull custom ARM64 Docker image
         run: |
-          docker pull --platform linux/arm64 kcllang/kcl-builder-arm64
+          docker pull --platform linux/arm64 ghcr.io/kcl-lang/kcl-builder-arm64
 
       - name: Build in Docker
         run: |
           docker run --rm --platform linux/arm64 \
             -v ${{ github.workspace }}:/workspace -w /workspace \
-            kcllang/kcl-builder-arm64 \
+            ghcr.io/kcl-lang/kcl-builder-arm64 \
             /bin/bash -c "export KCL_BUILD_GIT_SHA=$(git rev-parse HEAD) && git config --global --add safe.directory /workspace && git config --global user.name 'GitHub Action' && git config --global user.email 'action@github.com' && make && make release && _build/dist/linux/kclvm/bin/kclvm_cli version"
 
       - name: Read VERSION file
diff --git a/.github/workflows/macos_test.yaml b/.github/workflows/macos_test.yaml
index 96502779c..489a89c56 100644
--- a/.github/workflows/macos_test.yaml
+++ b/.github/workflows/macos_test.yaml
@@ -47,7 +47,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.79
+          toolchain: 1.83
           override: true
           components: clippy, rustfmt
       - name: Code format check
diff --git a/.github/workflows/mingw_test.yaml b/.github/workflows/mingw_test.yaml
index c9c70c844..3cc37d8ef 100644
--- a/.github/workflows/mingw_test.yaml
+++ b/.github/workflows/mingw_test.yaml
@@ -19,7 +19,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.79
+          toolchain: 1.83
           override: true
           components: clippy, rustfmt
 
diff --git a/.github/workflows/test_compiler_base.yaml b/.github/workflows/test_compiler_base.yaml
index e573c5281..303de1bb8 100644
--- a/.github/workflows/test_compiler_base.yaml
+++ b/.github/workflows/test_compiler_base.yaml
@@ -22,7 +22,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.79
+          toolchain: 1.83
           override: true
           components: clippy, rustfmt
       - name: Rust code format check
@@ -43,7 +43,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.79
+          toolchain: 1.83
           override: true
           components: clippy, rustfmt
       - name: Compiler_base rust unit test
diff --git a/.github/workflows/ubuntu_test.yaml b/.github/workflows/ubuntu_test.yaml
index de8fbc61d..87e6cb462 100644
--- a/.github/workflows/ubuntu_test.yaml
+++ b/.github/workflows/ubuntu_test.yaml
@@ -32,7 +32,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.79
+          toolchain: 1.83
           override: true
           components: clippy, rustfmt
       - name: Code format check
diff --git a/.github/workflows/wasm_test.yaml b/.github/workflows/wasm_test.yaml
index 497f66fb4..48406adad 100644
--- a/.github/workflows/wasm_test.yaml
+++ b/.github/workflows/wasm_test.yaml
@@ -20,7 +20,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.79
+          toolchain: 1.83
           override: true
           components: clippy, rustfmt
 
diff --git a/.github/workflows/windows_test.yaml b/.github/workflows/windows_test.yaml
index b55178641..d19a60dc3 100644
--- a/.github/workflows/windows_test.yaml
+++ b/.github/workflows/windows_test.yaml
@@ -22,7 +22,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.79
+          toolchain: 1.83
           override: true
           components: clippy, rustfmt