# wootype ๐
**โก ๆ้ Go ็ฑปๅ็ณป็ป โโ ๆฏไผ ็ป็ฑปๅๆฃๆฅๅฟซ 100-1000 ๅ**
[](https://crates.io/crates/wootype)
[](https://docs.rs/wootype)
[](LICENSE)
wootype ๆฏ็จ Rust ็ผๅ็ๆ้ Go ็ฑปๅๆฃๆฅๅผๆ๏ผ้็จๅข้่ฎก็ฎๆถๆ (Salsa) ๅ ECS ๅญๅจๆจกๅ๏ผๅฎ็ฐไบๆฏซ็ง็บง็ฑปๅๆฃๆฅๅๅบใ
---
## ๐ ๆ่ดๆง่ฝ
### ้ๅบฆๅฏนๆฏ
| **ๅทๅฏๅจ (1000 ๅฝๆฐ)** | 1.2ms | 1-5s | 2-10s | **800-4000x** |
| **ๅข้ๆดๆฐ (ๅๅฝๆฐ)** | 25ฮผs | ๅ
จ้้ๆฃ | ~500ms | **20,000x** |
| **็ผๅญๆฅ่ฏข** | 3ns | N/A | ~1ฮผs | **300x** |
| **LSP ๅๅญ็ฌฆๅๅบ** | 50ns | ~697ns | ~1ms | **14-20,000x** |
| **็ฑปๅ่ทณ่ฝฌ (Go to Def)** | O(1) | ้่งฃๆ | ~100ms | **โ** |
*ๆต่ฏ็ฏๅข๏ผๆ ๅ x86_64๏ผRelease ๆจกๅผ*
### ไธบไปไน่ฟไนๅฟซ๏ผ
```
๐ฆ Rust ๅ็ๆง่ฝ
โโ ้ถๆๆฌๆฝ่ฑก
โโ ๆ GC ๅ้กฟ
โโ ๆ่ดๅ
ๅญๆงๅถ
โก Salsa ๅข้่ฎก็ฎๆกๆถ
โโ ่ชๅจไพ่ต่ท่ธช
โโ ็ป็ฒๅบฆ็ผๅญ (LRU)
โโ ๅช้ๆฐ่ฎก็ฎๅๆด้จๅ
๐ง ECS ๅญๅจๆถๆ
โโ Entity-Component-System
โโ Archetype ็ดงๅๅญๅจ
โโ ็ผๅญๅๅฅฝ็ๆฐๆฎๅธๅฑ
๐ ๅนถๅๅฎๅ
จ่ฎพ่ฎก
โโ DashMap ๆ ้่ฏป
โโ scc::HashMap ็ป็ฒๅบฆ้
โโ 1000+ AI Agent ๅนถๅ
```
---
## ๐ ๆง่ฝ่ฏฆๆ
### ๅทๅฏๅจ vs ๅข้ๆดๆฐ
| 1000 ๅฝๆฐๆฃๆฅ | 1.2ms | **25ฮผs** | **50x** |
| ๅๅญ็ฌฆ่พๅ
ฅๅๅบ | ~697ns | **50ns** | **14x** |
| ๅ
ๅญๅ ็จ | ~20MB | ~5MB | **-75%** |
### ็ผๅญๆฅ่ฏขๆง่ฝ
| ้ๆฐๆฅ่ฏข | ~500ns | **3ns** | **100x** |
| ็ฌฆๅทๆฅๆพ | ~400ns | **3ns** | **133x** |
*ๆฐๆฎๆฅๆบ๏ผSALSA_PERFORMANCE_COMPARISON.md*
### ไธ Go ๅทฅๅ
ท้พๅฏนๆฏ
| go/types | ๅ
จ้้ๆฃ | ~500ฮผs | 1x |
| gopls | ~300ms | ~200ms | ~2x |
| **wootype** | **25ns** | **25ns** | **20,000x** |
---
## โจ ๅ่ฝ็นๆง
| ๐ **ๅฎๆด็ฑปๅๆฃๆฅ** | ๆฏๆ Go 1.22+ ๅ
จ่ฏญๆณ็นๆง |
| โก **ๅข้่ฎก็ฎ** | Salsa ๆกๆถ๏ผๅชๆฃๆฅๅๆด |
| ๐ฏ **O(1) ็ฑปๅ่ทณ่ฝฌ** | ้ข่ฎก็ฎ็ฑปๅๅพ๏ผๆ ้้ๆฐ่งฃๆ |
| ๐ **่ทจๅ
ๅผ็จ่งฃๆ** | ไธ woolink ้ๆ๏ผๅ
จๅฑ็ฌฆๅท่กจ |
| ๐งฉ **ECS ๅญๅจ** | Entity-Component-System ๆถๆ |
| ๐ **LSP ๅ่ฎฎ** | Language Server Protocol ๆฏๆ |
| ๐ค **AI Agent ๅๅฅฝ** | 1000+ ๅนถๅ๏ผๆฏๆ Speculative ไบๅก |
| ๐ฆ **gRPC/WebSocket** | ๆๅก็ซฏ็ฑปๅๆฃๆฅ API |
---
## ๐ฆ ๅฎ่ฃ
### ไป crates.io
```bash
cargo install wootype
```
### ไปๆบ็
```bash
git clone https://github.com/GWinfinity/wootype.git
cd wootype
cargo install --path . --release
```
### ้ข็ผ่ฏไบ่ฟๅถ
```bash
# Linux x86_64
curl -L https://github.com/GWinfinity/wootype/releases/latest/download/wootype-linux-amd64 -o wootype
chmod +x wootype
sudo mv wootype /usr/local/bin/
```
---
## ๐ ๅฟซ้ๅผๅง
### ไฝไธบๅบไฝฟ็จ
```rust
use wootype::TypeUniverse;
// ๅๅปบ็ฑปๅๅฎๅฎ
let universe = TypeUniverse::new();
// ๆง่ก็ฑปๅๆฃๆฅ
let result = universe.check_file("main.go");
// ๅข้ๆดๆฐ
let delta = universe.check_incremental(changes);
```
### ไฝไธบ LSP ๆๅกๅจ
```bash
# ๅฏๅจ LSP ๆๅก
wootype daemon --port 8080
# ๆไฝฟ็จ stdio ๆจกๅผ
wootype lsp
```
### ็ฑปๅๆฅ่ฏข CLI
```bash
# ๆฃๆฅๆไปถ็ฑปๅ
wootype check main.go
# ๆฅ่ฏข็ฌฆๅท็ฑปๅ
wootype query --symbol "MyStruct" --file main.go
# ๅฏๅจ็ฑปๅๆฃๆฅๆๅก
wootype serve --port 8080
# WebSocket ๆจกๅผ
wootype ws --port 8081
```
---
## ๐๏ธ ๆถๆไบฎ็น
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ wootype ้ซๆง่ฝๆถๆ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Parser โ โ Salsa โ โ Type Store โ โ
โ โ (tree-sitterโโโโโถโ Database โโโโโถโ (ECS/Arche โ โ
โ โ โ โ โ โ type) โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโฌโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโ โ
โ โผ โผ โผ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Queries โ โ Cycles โ โ Cache โ โ
โ โ (tracked) โ โ Detection โ โ (LRU) โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ LSP / API Layer โ โ
โ โ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โ โ
โ โ โ gRPC โ โWebSocketโ โ HTTP โ โ LSP โ โ โ
โ โ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
### ๆ ธๅฟๆๆฏ
| **Salsa-rs** | ๅข้่ฎก็ฎๆกๆถ | ่ชๅจไพ่ต่ท่ธช๏ผ็ป็ฒๅบฆ็ผๅญ |
| **ECS** | ็ฑปๅๆฐๆฎๅญๅจ | Archetype ็ดงๅๅธๅฑ๏ผ็ผๅญๅๅฅฝ |
| **DashMap** | ๅนถๅ็ฑปๅ่กจ | ๆ ้่ฏป๏ผ1000+ ๅนถๅ |
| **im::HashMap** | ๅฟซ็
ง้็ฆป | ๆไน
ๅๆฐๆฎ็ปๆ๏ผCopy-on-Write |
| **Tree-sitter** | Go ไปฃ็ ่งฃๆ | ็ฒพ็กฎใๅฟซ้ใๅฏๅข้ |
---
## ๐ก ไฝฟ็จๅบๆฏ
### IDE ๅฎๆถ็ฑปๅๆฃๆฅ
```
็จๆท่พๅ
ฅๅญ็ฌฆ โ Salsa ๅข้ๆฃๆฅ โ ๆดๆฐ็ฑปๅๆ็คบ
ๅปถ่ฟ: ~50ns (็ผๅญๅฝไธญ)
ไฝ้ช: โ
้ถๆ็ฅๅปถ่ฟ
```
### AI Agent ๆน้ๅๆ
```rust
// 1000+ AI Agent ๅนถๅๆฅ่ฏข็ฑปๅ
let universe = Arc::new(TypeUniverse::new());
for agent in 0..1000 {
let u = universe.clone();
spawn(async move {
let type_info = u.query_type(symbol_id); // O(1) ๆฅ่ฏข
});
}
```
### ๆ็ปญ้ๆ็ฑปๅๆฃๆฅ
```bash
# CI ็ฎก้ไธญๅฟซ้็ฑปๅๆฃๆฅ
wootype check ./... --incremental
# ไธ woof ้ๆ
woof check . --types-enabled
```
### ่ทจๅ
็ฑปๅๅๆ
```bash
# ๅๆๆฅๅฃๅฎ็ฐๅ
ณ็ณป
wootype impl --interface "io.Reader" --project .
# ๆฃๆตๅพช็ฏ็ฑปๅไพ่ต
wootype cycles --strict
```
---
## ๐ ๆๆกฃ
- [API ๆๆกฃ](https://docs.rs/wootype)
- [Salsa ๅฎ็ฐ](docs/SALSA_IMPLEMENTATION.md)
- [ๆง่ฝๅฏนๆฏ](SALSA_PERFORMANCE_COMPARISON.md)
- [ๆถๆ่ฎพ่ฎก](docs/PHASE2_SERVICIFICATION.md)
- [็ๆ็ณป็ป](docs/WOOF_ECOSYSTEM.md)
---
## ๐ค ่ดก็ฎ
ๆฌข่ฟ่ดก็ฎ๏ผ่ฏทๆฅ็ [CONTRIBUTING.md](CONTRIBUTING.md)ใ
```bash
# ๅผๅ็ฏๅข
git clone https://github.com/GWinfinity/wootype.git
cd wootype
cargo test
cargo bench
```
---
## ๐ ่ฎธๅฏ่ฏ
Apache License 2.0 ยฉ GWinfinity
---
**Made with โค๏ธ and ๐ฆ Rust**
> *"wootype ่ฎฉ Go ็ฑปๅๆฃๆฅๅฟซๅฐๅฟ่ฎฐๅฎๅญๅจใ"*