|
123 | 123 |
|
124 | 124 | ## 3. Core Library Alternatives |
125 | 125 |
|
126 | | -28 TS -> Rust mappings in total, grouped by function: |
| 126 | +28 TS -> Rust mappings in total, grouped by function. Versions are pinned in `Cargo.toml` and omitted here to avoid staleness. |
127 | 127 |
|
128 | 128 | ### 3.1 CLI / UI |
129 | 129 |
|
130 | | -| # | Function | TypeScript Original | Rust Alternative | Version | Docs | |
131 | | -|---|----------|---------------------|------------------|---------|------| |
132 | | -| 1 | CLI framework | Commander.js | clap (derive) | 4.x | [docs.rs/clap](https://docs.rs/clap) | |
133 | | -| 2 | Terminal UI | React/Ink | ratatui + crossterm | 0.30 / 0.29 | [ratatui.rs](https://ratatui.rs) | |
134 | | -| 3 | Terminal styling | chalk | crossterm Style | 0.29 | [docs.rs/crossterm](https://docs.rs/crossterm) | |
135 | | -| 4 | Markdown rendering | marked | pulldown-cmark | 0.13 | [docs.rs/pulldown-cmark](https://docs.rs/pulldown-cmark) | |
136 | | -| 5 | Syntax highlighting | highlight.js | syntect | 5.x | [docs.rs/syntect](https://docs.rs/syntect) | |
137 | | -| 6 | Fuzzy search | Fuse.js | nucleo | 0.5 | [docs.rs/nucleo](https://docs.rs/nucleo) | |
| 130 | +| # | Function | TypeScript Original | Rust Alternative | Docs | |
| 131 | +|---|----------|---------------------|------------------|------| |
| 132 | +| 1 | CLI framework | Commander.js | clap (derive) | [docs.rs/clap](https://docs.rs/clap) | |
| 133 | +| 2 | Terminal UI | React/Ink | ratatui + crossterm | [ratatui.rs](https://ratatui.rs) | |
| 134 | +| 3 | Terminal styling | chalk | crossterm Style | [docs.rs/crossterm](https://docs.rs/crossterm) | |
| 135 | +| 4 | Markdown rendering | marked | pulldown-cmark | [docs.rs/pulldown-cmark](https://docs.rs/pulldown-cmark) | |
| 136 | +| 5 | Syntax highlighting | highlight.js | syntect | [docs.rs/syntect](https://docs.rs/syntect) | |
| 137 | +| 6 | Fuzzy search | Fuse.js | nucleo *(planned)* | [docs.rs/nucleo](https://docs.rs/nucleo) | |
138 | 138 |
|
139 | 139 | ### 3.2 Network / API |
140 | 140 |
|
141 | | -| # | Function | TypeScript Original | Rust Alternative | Version | Docs | |
142 | | -|---|----------|---------------------|------------------|---------|------| |
143 | | -| 7 | HTTP client | axios/undici | reqwest | 0.13 | [docs.rs/reqwest](https://docs.rs/reqwest) | |
144 | | -| 8 | WebSocket | ws | tokio-tungstenite | 0.29 | [docs.rs/tokio-tungstenite](https://docs.rs/tokio-tungstenite) | |
145 | | -| 9 | Streaming SSE | Anthropic SDK | eventsource-stream | 0.2 | [docs.rs/eventsource-stream](https://docs.rs/eventsource-stream) | |
146 | | -| 10 | OAuth | google-auth-library | oauth2 | 5.x | [docs.rs/oauth2](https://docs.rs/oauth2) | |
| 141 | +| # | Function | TypeScript Original | Rust Alternative | Docs | |
| 142 | +|---|----------|---------------------|------------------|------| |
| 143 | +| 7 | HTTP client | axios/undici | reqwest | [docs.rs/reqwest](https://docs.rs/reqwest) | |
| 144 | +| 8 | WebSocket | ws | tokio-tungstenite | [docs.rs/tokio-tungstenite](https://docs.rs/tokio-tungstenite) | |
| 145 | +| 9 | Streaming SSE | Anthropic SDK | eventsource-stream | [docs.rs/eventsource-stream](https://docs.rs/eventsource-stream) | |
| 146 | +| 10 | OAuth | google-auth-library | oauth2 | [docs.rs/oauth2](https://docs.rs/oauth2) | |
147 | 147 |
|
148 | 148 | ### 3.3 Serialization / Validation |
149 | 149 |
|
150 | | -| # | Function | TypeScript Original | Rust Alternative | Version | Docs | |
151 | | -|---|----------|---------------------|------------------|---------|------| |
152 | | -| 11 | JSON | Built-in JSON | serde + serde_json | 1.x / 1.x | [serde.rs](https://serde.rs) | |
153 | | -| 12 | YAML | yaml | serde_yml | 0.0.12 | [docs.rs/serde_yml](https://docs.rs/serde_yml) | |
154 | | -| 13 | TOML | -- | toml | 0.8 | [docs.rs/toml](https://docs.rs/toml) | |
155 | | -| 14 | Schema validation | Zod | schemars | 1.x | [docs.rs/schemars](https://docs.rs/schemars) | |
| 150 | +| # | Function | TypeScript Original | Rust Alternative | Docs | |
| 151 | +|---|----------|---------------------|------------------|------| |
| 152 | +| 11 | JSON | Built-in JSON | serde + serde_json | [serde.rs](https://serde.rs) | |
| 153 | +| 12 | YAML | yaml | serde_yml | [docs.rs/serde_yml](https://docs.rs/serde_yml) | |
| 154 | +| 13 | TOML | -- | toml | [docs.rs/toml](https://docs.rs/toml) | |
| 155 | +| 14 | Schema validation | Zod | schemars | [docs.rs/schemars](https://docs.rs/schemars) | |
| 156 | + |
| 157 | +> Note: `serde_yml` is the community successor to the archived `serde_yaml` (dtolnay). It is the correct modern choice. |
156 | 158 |
|
157 | 159 | ### 3.4 File System / Search |
158 | 160 |
|
159 | | -| # | Function | TypeScript Original | Rust Alternative | Version | Docs | |
160 | | -|---|----------|---------------------|------------------|---------|------| |
161 | | -| 15 | Glob | glob | globset | 0.4 | [docs.rs/globset](https://docs.rs/globset) | |
162 | | -| 16 | Grep/search | ripgrep bindings | grep crate family | 0.3 | [docs.rs/grep](https://docs.rs/grep) | |
163 | | -| 17 | Gitignore | -- | ignore | 0.4 | [docs.rs/ignore](https://docs.rs/ignore) | |
164 | | -| 18 | File watching | chokidar | notify | 8.x | [docs.rs/notify](https://docs.rs/notify) | |
165 | | -| 19 | Diff | diff | similar | 3.x | [docs.rs/similar](https://docs.rs/similar) | |
166 | | -| 20 | File locking | proper-lockfile | fd-lock | 4.0 | [docs.rs/fd-lock](https://docs.rs/fd-lock) | |
| 161 | +| # | Function | TypeScript Original | Rust Alternative | Docs | |
| 162 | +|---|----------|---------------------|------------------|------| |
| 163 | +| 15 | Glob | glob | globset | [docs.rs/globset](https://docs.rs/globset) | |
| 164 | +| 16 | Grep/search | ripgrep bindings | regex + ignore | [docs.rs/regex](https://docs.rs/regex) | |
| 165 | +| 17 | Gitignore | -- | ignore | [docs.rs/ignore](https://docs.rs/ignore) | |
| 166 | +| 18 | File watching | chokidar | notify | [docs.rs/notify](https://docs.rs/notify) | |
| 167 | +| 19 | Diff | diff | similar | [docs.rs/similar](https://docs.rs/similar) | |
| 168 | +| 20 | File locking | proper-lockfile | fd-lock | [docs.rs/fd-lock](https://docs.rs/fd-lock) | |
| 169 | + |
| 170 | +> Note: #16 uses `regex` crate for pattern matching + `ignore` crate for `.gitignore`-respecting directory traversal, rather than the unmaintained `grep` crate family. |
167 | 171 |
|
168 | 172 | ### 3.5 System / Process |
169 | 173 |
|
170 | | -| # | Function | TypeScript Original | Rust Alternative | Version | Docs | |
171 | | -|---|----------|---------------------|------------------|---------|------| |
172 | | -| 21 | Subprocess | execa | tokio::process | 1.x | [docs.rs/tokio](https://docs.rs/tokio) | |
173 | | -| 22 | Process tree | tree-kill | sysinfo | 0.38 | [docs.rs/sysinfo](https://docs.rs/sysinfo) | |
174 | | -| 23 | System directories | -- | directories | 6.x | [docs.rs/directories](https://docs.rs/directories) | |
175 | | -| 24 | Keychain | Custom impl | keyring | 3.x | [docs.rs/keyring](https://docs.rs/keyring) | |
| 174 | +| # | Function | TypeScript Original | Rust Alternative | Docs | |
| 175 | +|---|----------|---------------------|------------------|------| |
| 176 | +| 21 | Subprocess | execa | tokio::process | [docs.rs/tokio](https://docs.rs/tokio) | |
| 177 | +| 22 | Process tree | tree-kill | sysinfo | [docs.rs/sysinfo](https://docs.rs/sysinfo) | |
| 178 | +| 23 | System directories | -- | directories | [docs.rs/directories](https://docs.rs/directories) | |
| 179 | +| 24 | Keychain | Custom impl | keyring | [docs.rs/keyring](https://docs.rs/keyring) | |
176 | 180 |
|
177 | 181 | ### 3.6 Observability / Cache |
178 | 182 |
|
179 | | -| # | Function | TypeScript Original | Rust Alternative | Version | Docs | |
180 | | -|---|----------|---------------------|------------------|---------|------| |
181 | | -| 25 | OpenTelemetry | @opentelemetry/* | opentelemetry-rust | 0.31 | [docs.rs/opentelemetry](https://docs.rs/opentelemetry) | |
182 | | -| 26 | Logging/tracing | console.log | tracing | 0.1 | [docs.rs/tracing](https://docs.rs/tracing) | |
183 | | -| 27 | LRU cache | lru-cache | lru | 0.12 | [docs.rs/lru](https://docs.rs/lru) | |
184 | | -| 28 | Error handling | Error class | thiserror + anyhow | 2.x / 1.x | [docs.rs/thiserror](https://docs.rs/thiserror) | |
| 183 | +| # | Function | TypeScript Original | Rust Alternative | Docs | |
| 184 | +|---|----------|---------------------|------------------|------| |
| 185 | +| 25 | OpenTelemetry | @opentelemetry/* | opentelemetry | [docs.rs/opentelemetry](https://docs.rs/opentelemetry) | |
| 186 | +| 26 | Logging/tracing | console.log | tracing | [docs.rs/tracing](https://docs.rs/tracing) | |
| 187 | +| 27 | LRU cache | lru-cache | lru | [docs.rs/lru](https://docs.rs/lru) | |
| 188 | +| 28 | Error handling | Error class | thiserror + anyhow | [docs.rs/thiserror](https://docs.rs/thiserror) | |
185 | 189 |
|
186 | 190 | --- |
187 | 191 |
|
|
0 commit comments