phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0
This commit is contained in:
@ -134,7 +134,7 @@ processor.process(3.14) # すべてプラグインで動作!
|
||||
|
||||
```
|
||||
Nyashエコシステム(統一TypeBox ABI採用後):
|
||||
├── Nyashスクリプトプラグイン ← .nyashファイル(純粋なNyashコード)
|
||||
├── Nyashスクリプトプラグイン ← .hakoファイル(純粋なNyashコード)
|
||||
└── 統一TypeBoxプラグイン ← .so/.dll(ネイティブ実装)
|
||||
├── 基本機能(旧C ABI互換)
|
||||
├── 高速ディスパッチ(JIT最適化)
|
||||
|
||||
@ -195,7 +195,7 @@ tests/abi/
|
||||
|
||||
### nyash.toml設定
|
||||
```toml
|
||||
[plugins.nyash_abi_provider]
|
||||
[plugins.hako_abi_provider]
|
||||
path = "plugins/nyash_abi_provider.so"
|
||||
abi = "c"
|
||||
types = ["NyashABIProvider"]
|
||||
|
||||
@ -54,10 +54,10 @@ AIの頭の中:
|
||||
|
||||
```bash
|
||||
# スクリプトファイルをAOTコンパイル可能
|
||||
./nyash --aot script.nyash -o script.exe
|
||||
./nyash --aot script.hako -o script.exe
|
||||
|
||||
# JITで実行(ホットコードを自動最適化)
|
||||
./nyash --backend vm --jit script.nyash
|
||||
./nyash --backend vm --jit script.hako
|
||||
```
|
||||
|
||||
つまり:
|
||||
|
||||
@ -29,7 +29,7 @@ Nyashスクリプトプラグインは、**最もNyashらしいプラグイン
|
||||
### 1. シンプルなユーティリティBox
|
||||
|
||||
```nyash
|
||||
# math_utils.nyash - 数学ユーティリティプラグイン
|
||||
# math_utils.hako - 数学ユーティリティプラグイン
|
||||
|
||||
box MathUtils {
|
||||
init { }
|
||||
@ -66,7 +66,7 @@ box MathUtils {
|
||||
### 2. 他のプラグインと組み合わせる例
|
||||
|
||||
```nyash
|
||||
# data_processor.nyash - データ処理プラグイン
|
||||
# data_processor.hako - データ処理プラグイン
|
||||
|
||||
box DataProcessor {
|
||||
init { file, math, cache }
|
||||
@ -109,7 +109,7 @@ box DataProcessor {
|
||||
### 3. 高度なプラグイン - P2Pノード拡張
|
||||
|
||||
```nyash
|
||||
# mesh_node.nyash - P2Pメッシュネットワークノード
|
||||
# mesh_node.hako - P2Pメッシュネットワークノード
|
||||
|
||||
box MeshNode from P2PBox {
|
||||
init { routing, peers, messageHandlers }
|
||||
@ -181,8 +181,8 @@ box MeshNode from P2PBox {
|
||||
### 1. ローカルファイルとして
|
||||
|
||||
```nyash
|
||||
# main.nyash
|
||||
include "plugins/math_utils.nyash"
|
||||
# main.hako
|
||||
include "plugins/math_utils.hako"
|
||||
|
||||
local utils = new MathUtils()
|
||||
print(utils.factorial(5)) # 120
|
||||
@ -209,7 +209,7 @@ local utils = new MathUtils()
|
||||
|
||||
```nyash
|
||||
# 実行時にプラグインをロード
|
||||
local pluginCode = new FileBox().read("plugin.nyash")
|
||||
local pluginCode = new FileBox().read("plugin.hako")
|
||||
eval(pluginCode) # プラグインが利用可能に
|
||||
|
||||
local processor = new DataProcessor()
|
||||
@ -270,7 +270,7 @@ box SafeCalculator {
|
||||
| パフォーマンス | 中速 | 最速 | 高速 |
|
||||
| 開発効率 | 最高 | 中 | 中 |
|
||||
| デバッグ | 簡単 | 難しい | 中程度 |
|
||||
| 配布 | .nyashファイル | .so/.dll | 任意 |
|
||||
| 配布 | .hakoファイル | .so/.dll | 任意 |
|
||||
|
||||
## 📚 まとめ
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ my-awesome-package/
|
||||
│ └── README.md
|
||||
├── examples/
|
||||
│ └── basic_usage.ny
|
||||
└── .nyashignore # 公開時の除外ファイル
|
||||
└── .hakoignore # 公開時の除外ファイル
|
||||
```
|
||||
|
||||
### nyash.toml仕様
|
||||
@ -200,7 +200,7 @@ GET /search?q={query} # パッケージ検索
|
||||
"dependencies": {
|
||||
"basic-utils": "^2.0.0"
|
||||
},
|
||||
"tarball": "https://registry.nyash.dev/awesome-math-1.0.0.tgz"
|
||||
"tarball": "https://registry.hako.dev/awesome-math-1.0.0.tgz"
|
||||
}
|
||||
```
|
||||
|
||||
@ -221,7 +221,7 @@ public_key = "..."
|
||||
nyash_modules/
|
||||
└── awesome-math/
|
||||
├── nyash.toml
|
||||
└── .nyash-integrity # SHA256ハッシュ
|
||||
└── .hako-integrity # SHA256ハッシュ
|
||||
```
|
||||
|
||||
### 権限システム
|
||||
@ -247,9 +247,9 @@ members = [
|
||||
### プライベートレジストリ
|
||||
|
||||
```toml
|
||||
# .nyashrc
|
||||
# .hakorc
|
||||
[registries]
|
||||
default = "https://registry.nyash.dev"
|
||||
default = "https://registry.hako.dev"
|
||||
company = "https://npm.company.com"
|
||||
|
||||
[scopes]
|
||||
@ -276,7 +276,7 @@ nyash cache add awesome-math@1.0.0
|
||||
### インテリジェントキャッシュ
|
||||
|
||||
```
|
||||
~/.nyash/cache/
|
||||
~/.hako/cache/
|
||||
├── packages/
|
||||
│ └── awesome-math-1.0.0.tgz
|
||||
├── metadata/
|
||||
|
||||
Reference in New Issue
Block a user