CNWei 38dabd2ace refactor(core,shim): 统一基于 thiserror 的错误体系
- 移除 anyhow,使用 thiserror 定义强类型 Error 枚举
- 支持 #[from] 自动转换 mlua::Error,关键路径保留源码与上下文
- LuaRuntimeBuilder 采用惰性错误收集,简化链式初始化调用
- MirrorRegistry 实现规范化 FromLuaConversionError 错误转换
2026-09-10 14:33:54 +08:00
2021-01-21 23:05:19 +08:00
2026-08-26 11:52:55 +08:00
2021-01-21 23:05:19 +08:00
2021-01-21 23:05:19 +08:00
2021-01-21 23:05:19 +08:00
2021-01-21 23:05:19 +08:00

rshim

rshim is the shim program written in rust.

Why this exist?

There are several versions of shim:

  1. the official shim.cs was written in c# and required an instantiation of a .NET command line app every time it was started therefore is slower than directly executing. And it dose not handle Ctrl+C event correctly.

  2. shim.c is ok with performance and Ctrl+C event handling,but sometimes suffer memory violation (randomly exited with return code 3221226356).

  3. shim.cpp didn't work on my machine, calling it with any executable result in an infinite recursion of creating subprocess until eating all memory for unknown subtle reason.

rshim :

  1. less probability with bug and undefined behavior.
  2. properly handle variety errors.
  3. friendly error message.
  4. properly handle Ctrl+C events.
  5. properly handle utf-8 with or without bom in shim file.

Installation

First install rust

cargo build --release

Close any running process with existed shim. then

./repshims.bat

Executable Size

Without crt-static enabled: around 200kb

With crt-static enabled: around 300kb

S
Description
shim written in rust
Readme
498 KiB
Languages
Rust 95.1%
Batchfile 4.9%