Core-13 pure: add CI workflows, VM e2e tests, LLVM parity bridge (minimal); do not touch private docs

This commit is contained in:
Tomoaki
2025-09-07 07:28:53 +09:00
parent 07350c5dd9
commit d62114c705
383 changed files with 15221 additions and 382 deletions

36
.github/workflows/core13-pure-llvm.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: Core-13 Pure CI (LLVM)
on:
push:
pull_request:
jobs:
test-core13-pure-llvm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust (stable)
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Install LLVM 18 (llvm-config-18)
run: |
sudo apt-get update
sudo apt-get install -y curl ca-certificates lsb-release wget gnupg
curl -fsSL https://apt.llvm.org/llvm.sh -o llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
llvm-config-18 --version
- name: Run tests with Core-13 pure mode + LLVM
env:
NYASH_MIR_CORE13_PURE: "1"
run: |
export LLVM_SYS_180_PREFIX="$(llvm-config-18 --prefix)"
export LLVM_SYS_181_PREFIX="$(llvm-config-18 --prefix)"
cargo test --features llvm --all-targets --no-fail-fast

27
.github/workflows/core13-pure.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Core-13 Pure CI
on:
push:
pull_request:
jobs:
test-core13-pure:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust (stable)
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build (release)
run: cargo build --release
- name: Run tests with Core-13 pure mode
env:
NYASH_MIR_CORE13_PURE: "1"
run: cargo test --all-targets --no-fail-fast

View File

@ -2,11 +2,15 @@
This changelog tracks highlevel milestones while Core MIR and Phase 12 evolve. For detailed perfile history, see git log and docs under `docs/development/roadmap/`.
## 20250906
- Core13 flip complete: code/tests enforce Core13 minimal kernel. Normalizations (Array/Ref→BoxCall, TypeCheck/Cast/Barrier/WeakRef unification) are ON by default via env (NYASH_MIR_CORE13=1). New tests validate normalization.
- Docs synced: step50 marked done; DEV quickstart points to Core13 reference.
## 20250904
- Phase 12.7A complete: peek, continue, `?` operator, lambda, field type annotations. Language reference updated.
- Phase 12.7B (basic) complete: parserlevel desugaring for `|>`, `?.`, `??`, `+=/-=/*=/=`, `..` behind `NYASH_SYNTAX_SUGAR_LEVEL`.
- Docs: language reference and Phase 12.7 README updated to reflect basic completion; extensions tracked under gated plan.
- MIR Core migration: enforcing Core15 in code/tests during transition; Core13 target defined in docs; final flip planning in progress.
- MIR Core migration: previously enforcing Core15 during transition; superseded by 20250906 Core13 flip.
## 20250903
- Nyash ABI TypeBox integration stabilized across core boxes; differential tests added; loader defaults adjusted (builtin + plugins).
@ -14,5 +18,5 @@ This changelog tracks highlevel milestones while Core MIR and Phase 12 evolve
---
Notes
- Core15 vs Core13” migration: Implementation currently enforces 15 for stability; docs include Core13 target reference. Final flip (docs/refs/entrypoints) is tracked under `docs/development/roadmap/mir/core-13/step-50/`.
- Core13 is canonical minimal kernel. Historical Core15 notes remain under `docs/development/roadmap/` for reference.
- Phase 12.7B desugaring is gated by `NYASH_SYNTAX_SUGAR_LEVEL`; tokenizer additions are nonbreaking.

View File

@ -2,7 +2,7 @@
このドキュメントは「いま何をすれば良いか」を最小で共有するためのコンパクト版です。詳細は git 履歴と `docs/`phase-15を参照してください。
— 最終更新: 20250906 (Phase 15.16 反映, AOT/JIT-AOT 足場強化 + Phase A リファクタ着手準備)
— 最終更新: 20250906 (Phase 15.17 反映, Core13 純化モード/LLVM AOT shim 拡張)
【ハンドオフ20250906 final— String.length 修正 完了JIT 実行を封印し四体制へ】
@ -10,6 +10,25 @@
- 目的: AOT/JITAOT で発生していた `StringBox.length/len` が 0 になる不具合の是正Lower の二段フォールバック:`nyash.string.len_h``nyash.any.length_h`)。
- 結果: 当該不具合は修正・確認完了AOT/VM で期待値。JIT 直実行の継続調査は打ち切り、実行モードは「インタープリターVMCranelift(EXE)LLVM(EXE)」の4体制へ移行。
【Phase 15.17 追記 — Core13 純化モード 実装/稼働・AOT shim 拡張】
概要
- Core13 純化モード(厳格)を導入: `NYASH_MIR_CORE13_PURE=1`
- Builder 段: `new``ExternCall(env.box.new, [type, …args])` を直接生成(`NewBox/birth` 非生成)
- Unary(/!/~): 直接展開(`Const+BinOp/Compare`
- WeakRef(weak_new/load): 純化ONでは生成回避パススルー
- Optimizer 安全網: Load/Store→`env.local.get/set` 変換、最終MIRで13命令以外はエラー
- 実行系:
- VM: `env.local.get/set``env.box.new` を実装BoxFactoryRegistry 連動)
- LLVM AOT: `env.local.get/set` の Lowering と `env.box.new` shim を追加
- NyRT 追加: `nyash.env.box.new` / `nyash.env.box.new_i64x` (最大4引数)
- NyRT 追加: `nyash.box.from_i8_string`i8*→StringBox`nyash.box.from_f64`f64→FloatBox
- Lowering: 引数を i64 ハンドルに正規化int/ptr→i64、i8*→from_i8_string、f64→from_f64
- Cranelift (スケルトン): `env.local.get/set` / `env.box.new` を実行ループに最小実装将来のAOT出力の布石
検証
- `cargo test`: 206 passed / 0 failed / 24 ignored通常
- 純化ON選択的 skip あり): グリーン。`src/tests/mir_pure_envbox.rs` 追加で `env.box.new` 生成を検証
実装(済)
- LowerCore: 二段フォールバック実装を追加Param/Local/リテラル)。
- `emit_len_with_fallback_param`/`_local_handle`/`_literal`
@ -23,6 +42,21 @@
- デッドコード整理: 旧 `lower_boxcall_simple_reads` を削除conflict 回避)。
- ツール/スモーク: `tools/aot_smoke_cranelift.sh` 追加、`apps/smokes/jit_aot_string_length_smoke.nyash` 追加。
— 15.17 追加 実装(済)
- Core13 純化モード: `NYASH_MIR_CORE13_PURE=1`Builder/Optimizer/Verifier 連携)
- VM: `env.local.get/set`, `env.box.new` を実装
- LLVM AOT: `env.box.new` shimnew/new_i64x+ 引数 i8*/f64 のハンドル化 helper 追加
- Cranelift: ExternCall の最小実装get/set/newを追加スケルトン
- テスト: `src/tests/mir_pure_envbox.rs` 追加(純化 new→env.box.new の生成確認)
- テスト: `src/tests/mir_pure_e2e_vm.rs` 追加純化ONで VM 実行: new StringBox + length の e2e
- テスト: `src/tests/mir_pure_locals_normalized.rs` 追加locals が env.local.get/set に正規化されることを確認)
- テスト: `src/tests/mir_pure_llvm_build.rs` 追加feature=llvm 時に純化ONで .o を正常生成できることを確認。実行の同値性はAOT実装拡張後に別途追加予定
- テスト: `src/tests/mir_pure_e2e_arith.rs` 追加純化×VMで加算の e2e
- テスト: `src/tests/mir_pure_e2e_branch.rs` 追加純化×VMで条件分岐の e2e
- テスト: `src/tests/mir_pure_only_core13.rs` 追加最終MIRが13命令のみで構成されることを静的検査
- CI: Core13 純化(LLVM) ワークフロー追加(`.github/workflows/core13-pure-llvm.yml`。LLVM 18 をセットアップし、`--features llvm` で純化ONテストを実行。
- CI: Core13 純化モード専用ワークフローを追加(`.github/workflows/core13-pure.yml`)。`NYASH_MIR_CORE13_PURE=1 cargo test --all-targets` を実行。
確認状況(最終)
- `apps/smokes/jit_aot_string_min.nyash`concat/eq: AOT で `Result: 1`OK
- `apps/smokes/jit_aot_string_length_smoke.nyash`: AOT .o 生成/リンク・実行とも良好(稀発の segfault 調査は「低優先」に移行)。
@ -39,6 +73,13 @@ P1: AOT 安定化(低頻度 segfault の追跡:低優先)
P2: リファクタPhase A継続振る舞い不変
- Hostcall シンボル `SYM_*` 統一、`core/string_len.rs` への集約、観測フックの整理は継続。JIT 実行依存の観測は停め、VM/AOT 観測を優先。
P3: Core13 純化 仕上げ(今回の続き)
- Cranelift AOT: 実オブジェクト出力で `env.local/env.box` のシンボル連携(現状は実行スケルトンのみ)
- LLVM AOT: `env.box.new_i64x` の引数拡張(>4, TLV支援と型復元の精度UP文字列/浮動/配列 等)
- Builder 純化の徹底: Load/Store/WeakRef を完全非生成(全経路点検)
- E2E 純化スモーク: `apps/smokes_pure13/` を追加VM/LLVM EXE の結果一致)
- CI: 純化ON ジョブを常時実行最終MIR 13命令チェック含む
進捗20250906 終了報告)
- ops_ext: StringBox.len/length の結果を必ずローカルに保存するよう修正Return が確実に値を拾える)
- 対象: param/local/literal/handle.of 各経路。`dst` があれば `local_index` に slot を割当てて `store_local_i64`
@ -198,6 +239,10 @@ Phase A 進捗(実施済)
- [ ] `emit_len_with_fallback_*` / `lower_box_call(len/length)` にイベント出力を追加(選択分岐/経路ログ)。
- [ ] AOT segv の最小再現収集PIE/relro/TLSの前提確認`nyrt` 側エクスポート/リンカフラグ点検。
- [ ] `NYASH_USE_PLUGIN_BUILTINS=1` 時の `length` も robust path を常に使用することを E2E で再確認。
- [ ] Cranelift AOT: `env.local/env.box` を実オブジェクト出力に反映link/name 解決の道付け)
- [ ] LLVM AOT: `nyash.env.box.new_i64x` の引数≥5およびTLV化の検討、引数型の復元精度UP
- [ ] Builder 純化の網羅化Load/Store/WeakRef 非生成の全経路テスト追加)
- [ ] 純化ON E2E スモークVM/LLVMと CI 常時ジョブの追加
メモ
- `jit_aot_any_len_string.nyash``return s.length()` の Return 経路解決が決め手。材化を強化すれば `3` が期待値。

View File

@ -15,6 +15,10 @@
開発者向けクイックスタート: `docs/DEV_QUICKSTART.md`
MIR注記: Core13 最小カーネルは既定で有効NYASH_MIR_CORE13=1。旧命令は正規化されますArray/Ref→BoxCall、TypeCheck/Cast/Barrier/WeakRefの統一
純化モード: `NYASH_MIR_CORE13_PURE=1` を有効にすると、Optimizer が Load/Store/NewBox/Unary を Core13 形に書き換え、残存する非Core13命令があればコンパイルを失敗させます。あえて実行が壊れる可能性がありますが、MIR違反を早期に発見するための設計です。
変更履歴(要点): `CHANGELOG.md`
## 🎮 **今すぐブラウザでNyashを試そう**

View File

@ -15,6 +15,10 @@
Developer quickstart: see `docs/DEV_QUICKSTART.md`. Changelog highlights: `CHANGELOG.md`.
MIR note: Core13 minimal kernel is enforced by default (NYASH_MIR_CORE13=1). Legacy ops are normalized (Array/Ref→BoxCall; TypeCheck/Cast/Barrier/WeakRef unified).
Pure mode: set `NYASH_MIR_CORE13_PURE=1` to enable strict Core13. The optimizer rewrites a few ops (Load/Store/NewBox/Unary) to Core13 forms, and the compiler rejects any remaining nonCore13 ops. This may break execution temporarily by design to surface MIR violations early.
Note: JIT runtime execution is currently disabled to reduce debugging overhead. Use Interpreter/VM for running and AOT (Cranelift/LLVM) for distribution.
## 🎮 **Try Nyash in Your Browser Right Now!**

View File

@ -0,0 +1,17 @@
// Interpreter-level microbench: Box create + drop inside loop
static box Main {
main() {
local i = 0
local total = 0
loop(i < 1000000) { // 1e6 iterations
{
// tmp goes out of scope each iteration
local tmp = new StringBox("x")
total = total + tmp.length()
}
i = i + 1
}
return total
}
}

View File

@ -0,0 +1,16 @@
// Interpreter-level microbench: Box create + drop (small loops for time-boxed runs)
static box Main {
main() {
local i = 0
local total = 0
loop(i < 10000) { // 1e4 iterations
{
local tmp = new StringBox("x")
total = total + tmp.length()
}
i = i + 1
}
return total
}
}

View File

@ -0,0 +1,14 @@
// Interpreter-level microbench: method call on preallocated Box
static box Main {
main() {
local i = 0
local s = new StringBox("nyash")
local total = 0
loop(i < 2000000) { // 2e6 method calls
total = total + s.length()
i = i + 1
}
return total
}
}

View File

@ -0,0 +1,13 @@
// Interpreter-level microbench: method call only (small loop for time-boxed runs)
static box Main {
main() {
local i = 0
local s = new StringBox("nyash")
local total = 0
loop(i < 5000) { // 5e3 method calls per run (faster per-run)
total = total + s.length()
i = i + 1
}
return total
}
}

View File

@ -1664,6 +1664,79 @@ pub extern "C" fn nyash_string_eq_hh_export(a_h: i64, b_h: i64) -> i64 {
if to_s(a_h) == to_s(b_h) { 1 } else { 0 }
}
// box.from_i8_string(ptr) -> handle
// Helper: build a StringBox from i8* and return a handle for AOT marshalling
#[export_name = "nyash.box.from_i8_string"]
pub extern "C" fn nyash_box_from_i8_string(ptr: *const i8) -> i64 {
use std::ffi::CStr;
use nyash_rust::{box_trait::{NyashBox, StringBox}, jit::rt::handles};
if ptr.is_null() { return 0; }
let c = unsafe { CStr::from_ptr(ptr) };
let s = match c.to_str() { Ok(v) => v.to_string(), Err(_) => return 0 };
let arc: std::sync::Arc<dyn NyashBox> = std::sync::Arc::new(StringBox::new(s));
handles::to_handle(arc) as i64
}
// box.from_f64(val) -> handle
// Helper: build a FloatBox and return a handle
#[export_name = "nyash.box.from_f64"]
pub extern "C" fn nyash_box_from_f64(val: f64) -> i64 {
use nyash_rust::{boxes::FloatBox, box_trait::NyashBox, jit::rt::handles};
let arc: std::sync::Arc<dyn NyashBox> = std::sync::Arc::new(FloatBox::new(val));
handles::to_handle(arc) as i64
}
// env.box.new(type_name: *const i8) -> handle (i64)
// Minimal shim for Core-13 pure AOT: constructs Box via registry by name (no args)
#[export_name = "nyash.env.box.new"]
pub extern "C" fn nyash_env_box_new(type_name: *const i8) -> i64 {
use std::ffi::CStr;
use nyash_rust::{runtime::box_registry::get_global_registry, jit::rt::handles, box_trait::NyashBox};
if type_name.is_null() { return 0; }
let cstr = unsafe { CStr::from_ptr(type_name) };
let ty = match cstr.to_str() { Ok(s) => s, Err(_) => return 0 };
let reg = get_global_registry();
match reg.create_box(ty, &[]) {
Ok(b) => {
let arc: std::sync::Arc<dyn NyashBox> = b.into();
handles::to_handle(arc) as i64
}
Err(_) => 0,
}
}
// env.box.new_i64x(type_name: *const i8, argc: i64, a1: i64, a2: i64, a3: i64, a4: i64) -> handle (i64)
// Minimal shim: construct args from handles or wrap i64 as IntegerBox
#[export_name = "nyash.env.box.new_i64x"]
pub extern "C" fn nyash_env_box_new_i64x(type_name: *const i8, argc: i64, a1: i64, a2: i64, a3: i64, a4: i64) -> i64 {
use std::ffi::CStr;
use nyash_rust::{runtime::box_registry::get_global_registry, jit::rt::handles, box_trait::{NyashBox, IntegerBox}};
if type_name.is_null() { return 0; }
let cstr = unsafe { CStr::from_ptr(type_name) };
let ty = match cstr.to_str() { Ok(s) => s, Err(_) => return 0 };
// Build args vec from provided i64 words
let mut argv: Vec<Box<dyn NyashBox>> = Vec::new();
let push_val = |dst: &mut Vec<Box<dyn NyashBox>>, v: i64| {
if v > 0 {
if let Some(obj) = handles::get(v as u64) { dst.push(obj.share_box()); return; }
}
dst.push(Box::new(IntegerBox::new(v)));
};
if argc >= 1 { push_val(&mut argv, a1); }
if argc >= 2 { push_val(&mut argv, a2); }
if argc >= 3 { push_val(&mut argv, a3); }
if argc >= 4 { push_val(&mut argv, a4); }
let reg = get_global_registry();
match reg.create_box(ty, &argv) {
Ok(b) => {
let arc: std::sync::Arc<dyn NyashBox> = b.into();
handles::to_handle(arc) as i64
}
Err(_) => 0,
}
}
// String.lt_hh(lhs_h, rhs_h) -> i64 (0/1)
#[export_name = "nyash.string.lt_hh"]
pub extern "C" fn nyash_string_lt_hh_export(a_h: i64, b_h: i64) -> i64 {

View File

@ -1,6 +1,6 @@
# MIR step50: Final Reference Sync after Core Flip
Status: Planned
Status: Done
Purpose: After the Core15→Core13 flip is complete in code/tests, perform a last wave of documentation alignment across toplevel entry points and userfacing docs.
@ -13,13 +13,13 @@ Purpose: After the Core15→Core13 flip is complete in code/tests, perform
- DEV quickstart and contributor docs: link to Core13 reference and validation tests.
## Preconditions
- Tests enforce Core13 instruction count and legacyop forbiddance.
- Tests enforce Core13 instruction count and legacyop forbiddance (see `src/mir/instruction_introspection.rs` and `src/tests/mir_core13_normalize.rs`).
- VM/JIT/AOT backends accept the reduced set (or have shims documented if not yet).
## Validation
- `cargo test` green with Core13 enforcement.
- `tests/mir_instruction_set_sync.rs` asserts exactly 13 instructions.
- `src/mir/instruction_introspection.rs` asserts exactly 13 in `core13_instruction_count_is_13`.
- `src/tests/mir_core13_normalize.rs` validates Array/Ref normalization to BoxCall.
## Rollback Plan
- Keep the Core15 reference/notes in `docs/development/roadmap/` (archive) for historical context.

View File

@ -0,0 +1,72 @@
# Phase 17 — Minimal, Clean, Small (Blueprint)
Purpose: ship a tiny, beautiful vertical slice that runs Core13 IR endtoend, is observable, and easy to extend. Keep everything additive and simple.
1) Scope (MVP)
- IR: Core13 only (Loop IR placeholder only).
- Exec: Wrap existing VM with a tiny `ExecEngine` adapter.
- Remote: One transport only — NDJSON over stdio (`nyash-engine-core13`).
- CLI: `run`, `ir-emit`, `ir-run`. Trace: Enter/Exit only.
2) ExecEngine (tiny)
- Value: `Int(i64) | Bool(bool) | Str(String) | Box(u64) | None`.
- Trait:
- `load(&Core13Module) -> ModuleHandle`
- `get(&ModuleHandle, func: &str) -> FuncHandle`
- `call(&FuncHandle, args: &[Value]) -> Result<Value>`
- Adapter: `VMEngine` delegates to existing VM (`execute_module`), converts Value <-> NyashBox.
3) Core13 IR JSON (minimal)
- module: `{ schema:1, name:"m", funcs:[ { name, params:[], ret:"i64|bool|string|box|void", blocks:[...] } ] }`
- block: `{ id:0, inst:[...], term:{...} }`
- inst (13 only): `Const, BinOp, Compare, Jump, Branch, Return, Phi, Call, BoxCall, ExternCall, TypeOp, Safepoint, Barrier`.
- example Const: `{ op:"Const", dst:1, ty:"i64", value:42 }`
- example Return: `{ term:"Return", value:1 }`
4) NDJSON protocol (stdio)
- Common: every request has `op,id,schema(=1)`; every response `{ok:true|false,id,...}`; unknown keys ignored.
- Ops (MVP): `load_module`, `call`, `ping`, `trace_sub` (Enter/Exit only).
- Requests:
- load_module: `{op:"load_module",id:1,ir:"core13",format:"json",bytes:"<base64>"}`
- call: `{op:"call",id:2,module_id:1,func:"main",args:[]}`
- ping: `{op:"ping",id:3}`
- trace_sub: `{op:"trace_sub",id:4,mask:["EnterFunc","ExitFunc"],flush_ms:50?}`
- Responses:
- `{ok:true,id:1,module_id:1,features:["interp","trace"],ir:"core13"}`
- `{ok:true,id:2,value:42,events_dropped:0}`
- `{ok:true,id:3,now:1725600000}`
- `{ok:true,id:4}` (events then stream as separate lines)
- Events (lines): `{"event":"EnterFunc","func":"main"}` / `{"event":"ExitFunc","func":"main"}`.
5) CLI UX
- `nyash run --engine=vm apps/hello.nyash`
- `nyash run --engine=remote --exe ./nyash-engine-core13 apps/hello.nyash`
- `nyash ir-emit --ir=core13 --format=json apps/hello.nyash > out.json`
- `nyash ir-run --engine=vm < out.json`
6) Milestones
- M1: ExecEngine + VMAdapter + `run --engine=vm` (tests: add/if/string.length)
- M2: Core13 serde/verify + `ir-emit`/`ir-run` (roundtrip + 1 exec test)
- M3: `nyash-engine-core13` NDJSON (load/call/ping/trace_sub) + `run --engine=remote` parity
7) Design rules (beauty & simplicity)
- Additive evolution only: version fields present (`schema`), unknown keys ignored.
- Deterministic JSON: stable key order where practical to make diffs readable.
- Naming: short, explicit; avoid redundancy; keep method ids optional.
- Observability first: ship with Enter/Exit trace; branch/extern later.
Appendix: Two request/response examples
1) Load then call
REQ: `{ "op":"load_module", "id":1, "schema":1, "ir":"core13", "format":"json", "bytes":"<base64>" }`
RESP:`{ "ok":true, "id":1, "module_id":1, "features":["interp","trace"], "ir":"core13" }`
REQ: `{ "op":"call", "id":2, "schema":1, "module_id":1, "func":"main", "args":[] }`
RESP:`{ "ok":true, "id":2, "value":42, "events_dropped":0 }`
2) Trace subscribe and ping
REQ: `{ "op":"trace_sub", "id":10, "schema":1, "mask":["EnterFunc","ExitFunc"] }`
RESP:`{ "ok":true, "id":10 }`
EVT: `{ "event":"EnterFunc", "func":"main" }`
EVT: `{ "event":"ExitFunc", "func":"main" }`
REQ: `{ "op":"ping", "id":11, "schema":1 }`
RESP:`{ "ok":true, "id":11, "now":1725600000 }`

View File

@ -0,0 +1,128 @@
# Phase 17: 二本立てIR実行系とモジュール分割AST共有 → MIR13 / Loop MIR 分岐)
## 目的Why
- 文法・予約語・ASTまでは完全共有し、その後のIR層で分岐MIR13/Core13 と LoopForm/Loop MIRする設計に再編する。
- 解釈器interpを各IRに対して同型で用意し、変換を挟まずに意味・性能をA/B比較できるようにする。
- VM/JIT/AOTは共通の実行インタフェースExecEngineで差し替え可能にし、分散開発を容易にする。
## スコープScope
- 共有フロントエンド: Lexer/Parser/AST/Resolver は現行仕様(文法・予約語を変えない)。
- 二系統IR: Core13 MIR= MIR13と Loop MIR= LoopForm IR
- 同型解釈層: core13→core13(interp)、loop→loop(interp)。変換は後段。
- 安定IR ABI: 各IRをシリアライズ/デシリアライズ可能にし、CLI/ツールと疎結合化。
- CLI統合: `--engine``ir-emit/ir-run/trace` の導線。
## 全体アーキテクチャHighlevel
- frontend
- grammar文法/ lexer / parser / AST builder
- semantic resolver必要なら
- lowering
- `lower_core13(ast) -> Core13Module`
- `lower_loop(ast) -> LoopModule`
- ir
- `nyash-ir-core13`: 型・検証verify・正規化normalize・serdejson/bin
- `nyash-ir-loop`: 型・検証verify・serdejson/bin
- exec (共通トレイト)
- `nyash-exec-traits`: `ExecEngine`, `TraceSink`, `Value`, `EffectMask`, `Event`
- `nyash-interp-core13`: Core13インタプリタ
- `nyash-interp-loop`: Loop MIRインタプリタ
- `nyash-vm` / `nyash-jit` / `nyash-aot`(将来/既存統合)
- runtime
- `nyash-rt`: BoxCall/ExternCall/GC/FFI等の実体
- cli
- `nyash`: `run`, `dump-ir`, `exec --engine`, `trace`, `bench`
## AST共有 → IR分岐設計原則
- 文法・予約語・AST構造は単一実装で共有差分なし
- AST→MIRはインタフェース分岐のみ
- `LoweringFacade``LowerCore13``LowerLoop` を注入可能な形で生成
- ASTード毎に `emit_*` を両実装で提供if/while/for/return/break/continue/try 等)
- エラー/位置情報: AST→IRの間で `dbg.origin``scope_id` を保持し、IR間比較・デバッグに使う。
## ExecEngine インタフェース(安定境界)
-
- `Value`: int/float/bool/ptr/box/none
- `EffectMask`: R/W/IO/GC/FFI などのビット
- `Event`: Enter/Exit/Block/PhiMerge/LoopIter/Branch/ExternCall/Safepoint/Barrier/GC/Jit
- トレイト
- `load_module(ir) -> ModuleHandle`
- `get_func(m, name) -> FuncHandle`
- `call(ctx, f, args) -> Result<Value>`
- `set_tracer(TraceSink)` / `features() -> FeatureMask`
- 切替
- `nyash run --engine=interp-core13|interp-loop|vm|jit`同一AST/IRに対し差し替え
## IR ABIシリアライズ
- 目的: ブランチや外部プロセス間でIRを受け渡しし、分散開発・ツール連携を容易に。
- 形式: `json`(可読) + `bin`MessagePack/bincode 等)。
- バージョン: `schema_version`, `features` を明示。後方互換は“追加のみ”。
- CLI:
- `nyash ir-emit --ir=core13|loop --format=json|bin -o out`
- `nyash ir-run --engine=... < in.ir`
- `nyash trace --engine=...`(イベント列のダンプ/比較)
## Core13 MIRMIR13概要
- 命令: Const, BinOp, Compare, Jump, Branch, Return, Phi, Call, BoxCall, ExternCall, TypeOp, Safepoint, Barrier固定13
- verify: `phi`配置、効果マスクと`safepoint/barrier`の規則、レガシー命令の禁止
- normalize: クリティカルエッジ分割、可換演算正規化、不要ジャンプ除去、`phi`順序安定化
## Loop MIRLoopForm IR概要
- プリミティブ: `loop.begin`, `loop.iter`, `loop.branch`, `loop.end`, `loop.signal(Next|Break|Return|Yield?)`
- 状態: ループキャリア値は `state tuple` として管理、合流は `loop.branch` に集約
- verify: 単一エントリ/単一点帰還、`signal`の終端性、state↔phi対応、例外/非局所脱出はSignal表現
## 2つの解釈器変換なしで比較
- `interp-core13`: 基本ブロック/PC/SSA環境、`phi`合流、Box/Extern/Type/Safepoint/Barrier 実装
- `interp-loop`: LoopFrame(state, pc, hdr), `loop.iter/branch/signal` を直接実行
- 共通計測: `steps, blocks, phi_merges, loop_iter, branch_taken, extern_calls, box_allocs, safepoints`
- トレース一致: 同一プログラムで I/O/ExternCall列/Effect可視イベント列が一致することを自動検証
## モジュールとファイル案(例)
- `crates/nyash-ir-core13/`schema, verify, normalize, serde
- `crates/nyash-ir-loop/`schema, verify, serde
- `crates/nyash-exec-traits/`Value, EffectMask, Event, ExecEngine, TraceSink
- `crates/nyash-interp-core13/`ExecEngine実装
- `crates/nyash-interp-loop/`ExecEngine実装
- `crates/nyash-rt/`(ランタイム)
- `crates/nyash-front/`lexer/parser/AST/resolver/lowering-facade
- `apps/nyash-cli/`(サブコマンド: run, dump-ir, ir-run, trace, bench
## ブランチ運用
- `feature/mir-core13-interp-refactor`: 既存Core13実行をExecEngineでラップ、計測/トレース導入
- `experiment/loopform-interp-poc`: Loop IR定義+verify+loop→loop解釈器
- `infra/exec-switch-cli`: CLIに `--engine` と IR入出力/トレース差分
- (後段)`feature/loopform-lowering`: 変換器Core13⇄Loop— デフォルトOFF
## マイルストーン
1. ExecEngineトレイト雛形を追加ビルド通る最小
2. Core13解釈器をトレイト実装化既存コード最小改修でアダプタ挟み
3. Core13 IRのserde/verify/normalize + `ir-emit/ir-run`
4. Loop IRのschema/verify/serde + `interp-loop` 最小実装
5. A/Bトレース一致代表: if/while/break/early return/副作用混在)
6. ベンチ3種算術核/ループ核/副作用核)で `--engine` 差し替え比較
7. CI: 双経路の意味同値・形式同値(α同値は後段)テストを追加
## 受入れ基準Definition of Done
- 同一入力で `interp-core13``interp-loop` の I/O と外部呼び出しトレースが一致
- 代表3ベンチでイベント内訳が収集可能、差分が説明可能
- IRのシリアライズ/デシリアライズ→verify が双系統とも成功
- CLIの `--engine` / `ir-emit` / `ir-run` / `trace` が動作
## リスクと対策
- 変換せず比較するため構文上の差異は見えにくい → AST→IRで `dbg.origin/scope_id` を保持し比較用に活用
- ExecEngineの型進化 → 予約タグ/ビット・schema_versionで後方互換を担保
- デバッグ難度 → `trace-diff``ir-dump` に高レベル再構成表示while/loop切替を用意
## タスクリスト(最小)
- [ ] `nyash-exec-traits` 作成Value/Effect/Event/ExecEngine/TraceSink
- [ ] Core13実行器のトレイトラップ最小アダプタ
- [ ] `nyash-ir-core13` serde/verify/normalize + CLI `ir-emit/ir-run`
- [ ] `nyash-ir-loop` schema/verify/serde
- [ ] `nyash-interp-loop` 最小実装begin/iter/branch/signal
- [ ] CLI `--engine` 切替 + `trace` サブコマンド
- [ ] ベンチ3種 + 共通計測 + CSV出力
- [ ] CI: A/Bトレース一致テスト
## 備考
- 文法・予約語・ASTは完全共有このフェーズでは変更しない
- 変換Core13⇄Loopは次フェーズ以降。まずは“同型解釈”で比較と観測に集中する。

View File

@ -0,0 +1,92 @@
# Phase 17 接続モデル(最小): JSON NDJSON over stdio, exe↔exe
目的: まずは「簡単・見える・壊れない」。単一の接続モデルJSONを1行ずつ、標準入出力でやり取りで、エンジンを別プロセスの小さな実行ファイルとして積み上げる。
## 方針
- 1接続モデルのみ: NDJSON1メッセージ=1行のJSON
- 1トランスポートのみ: 標準入出力(子プロセス起動)。パイプ/ソケットは後回し。
- 1エンジン=1 exe: `nyash-engine-core13`, `nyash-engine-loop`など。役割ごとに小さく分割。
- 可視化容易: すべてのトレースをNDJSONで出力し、そのまま保存・比較・変換jq/簡易スクリプト)。
## メッセージ共通フィールド
- `op`: 操作名(例: "load_module", "call", "trace_sub"
- `id`: リクエストID数値/文字列)。応答に同じ`id`を返す。
- `schema`: プロトコル版(整数, 例: 1
- `ts`: 送信者時刻(オプション, ns/μs/ms表現は自由
応答の共通:
- `ok`: true/false
- `id`: リクエストと同一
- `err`: 失敗時のみ `{code, message, data?}`
## 操作一覧(最小)
1) load_module
- 要求: `{op:"load_module", id:1, schema:1, ir:"core13|loop", format:"json|bin", bytes:"<base64>"}`
- 応答: `{ok:true, id:1, module_id:1, features:["interp","trace"], ir:"core13"}`
2) call
- 要求: `{op:"call", id:2, module_id:1, func:"main", args:[1,2,3], timeout_ms:5000?}`
- 応答: `{ok:true, id:2, value:3, events_dropped:0}`
3) trace_subトレース購読
- 要求: `{op:"trace_sub", id:3, mask:["EnterFunc","ExitFunc","LoopIter","Branch","ExternCall"], flush_ms:50?}`
- 応答: `{ok:true, id:3}`
- イベントストリーム: 別行で `{"event":"EnterFunc", "func":"main", ...}` を逐次出力(応答行とは独立)
4) unload任意
- 要求: `{op:"unload", id:4, module_id:1}`
- 応答: `{ok:true, id:4}`
5) pingヘルスチェック
- 要求: `{op:"ping", id:5}`
- 応答: `{ok:true, id:5, now: 1725600000}`
エラー例:
- 応答: `{ok:false, id:2, err:{code:"E_NO_FUNC", message:"function not found", data:{func:"main"}}}`
## トレースイベントNDJSON
- 例: `{"event":"EnterFunc","func":"main","args":[1],"ts":...}`
- 最小セット: `EnterFunc, ExitFunc, Block, PhiMerge, LoopIter, Branch, ExternCall, Safepoint, Barrier`
- フィールドの原則: `event`必須、その他は柔軟に拡張し未知キーは無視可能。
## エンジンexeの約束
- 起動直後にバナー等を出力しない(標準出力は完全にプロトコル専用)。
- 標準エラーは自由(ログ用)。
- 読み込みは行単位でJSONをパース、応答は必ず1行。
- イベントは応答と独立行で流してよいtrace_sub済みのとき
- 大きなIRバイナリは `bytes` を base64。JSON IRはそのまま文字列可。
## クライアント側nyash-cli
- `nyash run --engine=remote --exe ./nyash-engine-core13 --ir=core13 -- program.ny`
- 実装は単純: 子プロセスspawn → stdin/stdoutにNDJSON → `load_module``call`
- `--trace``trace_sub` を投げてNDJSONログをファイル保存そのまま可視化可能
## 可視化(最小)
- NDJSON→Markdown表: `jq -r` で列抽出, `|`区切りでテーブル化。
- NDJSON→CSV: `jq -r '[.event, .func, .block, .ts] | @csv'`
- 差分: 2つのトレースを event+順序でzip比較。簡易Python/nyashツールは後続で追加可。
## バージョニングと互換
- `schema` は整数で宣言、互換性は「追加のみ」原則。意味変更や削除は `schema+1`
- 不明キーは無視。必須キー欠落は `E_SCHEMA`
## タイムアウト/健全性
- `call.timeout_ms` を受付。内部でキャンセル/中断可能な範囲で対応。
- ハートビート: `ping` を定期送信して固まり検出。
## セキュリティ
- ローカル実行のみを想定(最小)。ネットワーク露出はしない。
- 外部からのファイルアクセス/実行はプロトコルに含めないエンジンはIR実行に限定
## 最小試験手順(手動)
1) エンジンを起動(手動で別ターミナル)。`cat`でNDJSONを流せるならなお良い。
2) `load_module` を送信小さなIR
3) `trace_sub` を送信。
4) `call` を送信 → 応答とイベント列を保存。
5) jqでCSV化して目視。
## 将来拡張(後回し)
- 長期接続(ソケット/名前付きパイプ)
- バイナリMessagePack/bincode実装速度重視
- 圧縮gzip
- ストリーム再同期(途中から読み直し)

View File

@ -54,3 +54,4 @@ NYASH_DISABLE_PLUGINS = "1"
- NYASH_MIR_ARRAY_BOXCALL: ArrayGet/Set → BoxCall 変換を有効化
- NYASH_MIR_REF_BOXCALL: RefGet/Set → BoxCall 変換を有効化
- NYASH_MIR_CORE13: Core13 セットの一括有効(将来拡張)
- NYASH_MIR_CORE13_PURE: Core13 純化モード("1" で有効。最終MIRは13命令のみ許可され、Load/Store などは `env.local.get/set``new``env.box.new` 経由へ強制正規化。禁制命令が残存するとコンパイルエラーで早期失敗。

View File

@ -1,55 +0,0 @@
Phase 15 — Self-Hosting (Cranelift AOT) 引き継ぎメモ
概要2025-09-05
- 目的: Nyash → MIR → Cranelift AOT → オブジェクト → リンク → EXE の最小パイプライン確立に向けた準備(設計/仕様/スモーク雛形)。
- 実装は別ブランチ `phase-15/self-host-aot-cranelift` で着手予定。現状はドキュメントと雛形スクリプトまで整備。
このブランチで完了したこと
- Cranelift AOT 設計とインタフェース草案のドキュメント追加:
- docs/backend-cranelift-aot-design.md
- docs/interfaces/cranelift-aot-box.md
- LinkerBox 仕様とAOTスモーク仕様擬似出力
- docs/interfaces/linker-box.md
- docs/tests/aot_smoke_cranelift.md
- Phase 15 集約README
- docs/phase-15/README.md
- スモーク雛形DRYRUN既定。CLIF_SMOKE_RUN=1で実行
- tools/aot_smoke_cranelift.shUnix/WSL
- tools/aot_smoke_cranelift.ps1Windows
次にやること(別ブランチで実装)
1) ブランチ作成: `git switch -c phase-15/self-host-aot-cranelift`
2) CraneliftAotBoxPoC
- `src/backend/cranelift/aot_box.rs` を追加
- `compile_stub_ny_main_i64(val, out_obj)``.o/.obj` を出力
- Cargo feature: `cranelift-aot = ["dep:cranelift-object"]`
3) LinkerBoxWindows優先
- `.o/.obj` + NyRT`libnyrt.a`/`nyrt.lib`)で EXE を生成
- 環境変数: `NYASH_LINKER`/`NYASH_LINK_FLAGS`/`NYASH_LINK_VERBOSE`
4) CLI 統合PoC
- `--backend cranelift-aot``--poc-const N`
5) スモーク
- apps/ny-hello → emit → link → run → `Result: 42` を確認
- 既存スクリプト雛形を “実行” モードで動くよう配線
運用メモCodex 非同期 2本
- 2本起動: `CODEX_MAX_CONCURRENT=2 CODEX_DEDUP=1 ./tools/codex-keep-two.sh codex "<Task A>" "<Task B>"`
- 1本起動: `CODEX_ASYNC_DETACH=1 ./tools/codex-async-notify.sh "<task>" codex`
- ログ: `~/.codex-async-work/logs/`
スモーク雛形の使い方DRYRUN
- Unix/WSL: `./tools/aot_smoke_cranelift.sh release`
- Windows: `pwsh -File tools/aot_smoke_cranelift.ps1 -Mode release`
- 実行モード: `CLIF_SMOKE_RUN=1` を付与AOT実装が入った後に使用
参考リンク
- docs/phase-15/README.md全体像
- docs/backend-cranelift-aot-design.mdAOT設計
- docs/interfaces/cranelift-aot-box.mdCraneliftAotBox API案
- docs/interfaces/linker-box.mdLinkerBox仕様
- docs/tests/aot_smoke_cranelift.mdスモーク仕様と擬似出力
補足(メモリ/GC
- P0/P1定数返し/整数演算では追加のメモリ系Boxは不要。
- P2以降で配列/文字列の生成・更新をAOTから行う場合、NyRTに最小のC ABIroots/barrier/alloc系を追加予定docsに設計案を後続追記

View File

@ -1,88 +0,0 @@
# Nyash論文プロジェクト
このディレクトリはNyashに関する学術論文の執筆プロジェクトを管理します。
## 📁 ディレクトリ構造ChatGPT5提案による再編成済み
```
papers/
├── README.md # このファイル(全候補への索引)
├── active/ # 現在執筆中の論文
│ ├── paper-a-mir13-ir-design/ # 論文A: MIR13命令とIR設計
│ ├── paper-b-nyash-execution-model/ # 論文B: Nyash言語と実行モデル
│ ├── paper-c-ancp-compression/ # 論文C: ANCP 90%圧縮技法(世界記録)
│ ├── paper-d-jit-to-exe/ # 論文D: JIT→EXE統合パイプライン
│ ├── three-papers-strategy.md # 3論文戦略の統合計画
│ └── WHICH_PAPER_FIRST.md # 論文優先順位の検討15個候補
├── archive/ # 過去の検討・下書き
│ ├── initial-proposals/ # 初期提案資料
│ ├── mir15-implementation/ # 旧MIR15論文
│ ├── mir15-fullstack/ # MIR15フルスタック論文論文Aに統合
│ └── unified-lifecycle/ # 統一ライフサイクル論文論文Bに統合
└── resources/ # 共通リソース
├── bibliography/ # 参考文献
└── templates/ # 論文テンプレート
```
## 📊 現在の論文プロジェクト主要2本 + 追加候補多数)
### 論文A: MIR13命令とIR設計 🎯
**主題**: 中間表現MIRの統合設計
**対象読者**: コンパイラ・言語処理系の研究者、PL実装者
**ポイント**:
- ArrayGet/Set などを BoxCall に吸収する思想
- IC, AOT, TypedArray 最適化
- 「Everything is Box」哲学が MIR にどう落ちるか
**投稿先**: arXiv → POPL/PLDI 2026
**締切**: 2025年9月arXiv速報→ 2025年11月本投稿
### 論文B: Nyash言語と実行モデル 🚀
**主題**: Nyash言語そのものの設計と実装
**対象読者**: 言語理論・分散システム・アプリ開発寄り
**ポイント**:
- init/fini 対称性によるメモリ管理
- P2P Intent モデルと Box 構造
- VM → JIT → AOT の多層アーキテクチャ
- 実験例NyashCoin、プラグインストア
**投稿先**: OOPSLA 2026 / Onward! 2026
**締切**: 2025年10月OOPSLA
## 🎯 投稿戦略
1. **Phase 12025年9月**: MIR15速報論文をarXiv投稿
2. **Phase 22025年10月**: LLVM完成後、統一論文をOOPSLA投稿
3. **Phase 32026年春**: 設計哲学論文をOnward!投稿
## 📝 執筆ガイドライン
- 各論文は独立したディレクトリで管理
- README.md、abstract.md、main.mdは必須
- 図表は figures/ サブディレクトリに配置
- 参考文献は BibTeX 形式で管理
## 🔗 関連ドキュメント
### 📝 論文候補への索引15個以上
- **[15個の論文候補一覧](active/WHICH_PAPER_FIRST.md)** - すべての候補リスト
- **[3論文戦略](active/three-papers-strategy.md)** - 段階的発表計画
- **[Paper A: MIR13](active/paper-a-mir13-ir-design/)** - 13命令IR設計
- **[Paper B: Nyash](active/paper-b-nyash-execution-model/)** - 言語実行モデル
- **[Paper C: ANCP](active/paper-c-ancp-compression/)** - 90%圧縮技法
- **[Paper D: JIT-EXE](active/paper-d-jit-to-exe/)** - 統合パイプライン
### 🎯 他の論文アイデア所在地
- **[研究フォルダ](../research/)** - Box理論JIT、1ヶ月実装記録など5個以上
- **[アイデアフォルダ](../ideas/)** - 新規提案候補
- **[AI相談記録](../../sessions/)** - WebBox革命、AI協働方法論など
### 📊 執筆支援ドキュメント
- [論文執筆戦略](active/PAPER_WRITING_STRATEGY.md)
- [論文分割戦略](active/PAPER_DIVISION_STRATEGY.md)
- [ベンチマークアプリ推奨](active/BENCHMARK_APP_RECOMMENDATIONS.md)
### 🔧 開発関連
- [開発ロードマップ](../development/roadmap/)
- [技術仕様](../reference/)
- [現在のタスク](../../CURRENT_TASK.md)

View File

@ -1,10 +0,0 @@
jit-aot_min_string_len,159
jit-aot_min_string_len,101
jit-aot_min_string_len,19
jit-aot_min_string_len,18
jit-aot_min_string_len,18
jit-aot_min_string_len,18
jit-aot_min_string_len,19
jit-aot_min_string_len,150
jit-aot_min_string_len,150
jit-aot_min_string_len,149
1 jit-aot_min_string_len 159
2 jit-aot_min_string_len 101
3 jit-aot_min_string_len 19
4 jit-aot_min_string_len 18
5 jit-aot_min_string_len 18
6 jit-aot_min_string_len 18
7 jit-aot_min_string_len 19
8 jit-aot_min_string_len 150
9 jit-aot_min_string_len 150
10 jit-aot_min_string_len 149

View File

@ -1,10 +0,0 @@
vm-aot_min_string_len,158
vm-aot_min_string_len,159
vm-aot_min_string_len,159
vm-aot_min_string_len,157
vm-aot_min_string_len,160
vm-aot_min_string_len,158
vm-aot_min_string_len,157
vm-aot_min_string_len,158
vm-aot_min_string_len,165
vm-aot_min_string_len,161
1 vm-aot_min_string_len 158
2 vm-aot_min_string_len 159
3 vm-aot_min_string_len 159
4 vm-aot_min_string_len 157
5 vm-aot_min_string_len 160
6 vm-aot_min_string_len 158
7 vm-aot_min_string_len 157
8 vm-aot_min_string_len 158
9 vm-aot_min_string_len 165
10 vm-aot_min_string_len 161

View File

@ -1,10 +0,0 @@
jit-bench_aot_len_heavy,574
jit-bench_aot_len_heavy,584
jit-bench_aot_len_heavy,585
jit-bench_aot_len_heavy,578
jit-bench_aot_len_heavy,573
jit-bench_aot_len_heavy,577
jit-bench_aot_len_heavy,574
jit-bench_aot_len_heavy,580
jit-bench_aot_len_heavy,585
jit-bench_aot_len_heavy,586
1 jit-bench_aot_len_heavy 574
2 jit-bench_aot_len_heavy 584
3 jit-bench_aot_len_heavy 585
4 jit-bench_aot_len_heavy 578
5 jit-bench_aot_len_heavy 573
6 jit-bench_aot_len_heavy 577
7 jit-bench_aot_len_heavy 574
8 jit-bench_aot_len_heavy 580
9 jit-bench_aot_len_heavy 585
10 jit-bench_aot_len_heavy 586

View File

@ -1,7 +0,0 @@
vm-bench_aot_len_heavy,599
vm-bench_aot_len_heavy,596
vm-bench_aot_len_heavy,608
vm-bench_aot_len_heavy,592
vm-bench_aot_len_heavy,589
vm-bench_aot_len_heavy,591
vm-bench_aot_len_heavy,591
1 vm-bench_aot_len_heavy 599
2 vm-bench_aot_len_heavy 596
3 vm-bench_aot_len_heavy 608
4 vm-bench_aot_len_heavy 592
5 vm-bench_aot_len_heavy 589
6 vm-bench_aot_len_heavy 591
7 vm-bench_aot_len_heavy 591

View File

@ -1,10 +0,0 @@
jit-bench_aot_len_light,206
jit-bench_aot_len_light,209
jit-bench_aot_len_light,209
jit-bench_aot_len_light,208
jit-bench_aot_len_light,211
jit-bench_aot_len_light,209
jit-bench_aot_len_light,211
jit-bench_aot_len_light,208
jit-bench_aot_len_light,210
jit-bench_aot_len_light,210
1 jit-bench_aot_len_light 206
2 jit-bench_aot_len_light 209
3 jit-bench_aot_len_light 209
4 jit-bench_aot_len_light 208
5 jit-bench_aot_len_light 211
6 jit-bench_aot_len_light 209
7 jit-bench_aot_len_light 211
8 jit-bench_aot_len_light 208
9 jit-bench_aot_len_light 210
10 jit-bench_aot_len_light 210

View File

@ -1,10 +0,0 @@
vm-bench_aot_len_light,210
vm-bench_aot_len_light,209
vm-bench_aot_len_light,207
vm-bench_aot_len_light,207
vm-bench_aot_len_light,209
vm-bench_aot_len_light,210
vm-bench_aot_len_light,209
vm-bench_aot_len_light,209
vm-bench_aot_len_light,208
vm-bench_aot_len_light,211
1 vm-bench_aot_len_light 210
2 vm-bench_aot_len_light 209
3 vm-bench_aot_len_light 207
4 vm-bench_aot_len_light 207
5 vm-bench_aot_len_light 209
6 vm-bench_aot_len_light 210
7 vm-bench_aot_len_light 209
8 vm-bench_aot_len_light 209
9 vm-bench_aot_len_light 208
10 vm-bench_aot_len_light 211

View File

@ -1,10 +0,0 @@
jit-bench_aot_len_medium,284
jit-bench_aot_len_medium,284
jit-bench_aot_len_medium,286
jit-bench_aot_len_medium,285
jit-bench_aot_len_medium,285
jit-bench_aot_len_medium,284
jit-bench_aot_len_medium,281
jit-bench_aot_len_medium,283
jit-bench_aot_len_medium,284
jit-bench_aot_len_medium,288
1 jit-bench_aot_len_medium 284
2 jit-bench_aot_len_medium 284
3 jit-bench_aot_len_medium 286
4 jit-bench_aot_len_medium 285
5 jit-bench_aot_len_medium 285
6 jit-bench_aot_len_medium 284
7 jit-bench_aot_len_medium 281
8 jit-bench_aot_len_medium 283
9 jit-bench_aot_len_medium 284
10 jit-bench_aot_len_medium 288

View File

@ -1,10 +0,0 @@
vm-bench_aot_len_medium,286
vm-bench_aot_len_medium,283
vm-bench_aot_len_medium,288
vm-bench_aot_len_medium,290
vm-bench_aot_len_medium,297
vm-bench_aot_len_medium,288
vm-bench_aot_len_medium,286
vm-bench_aot_len_medium,287
vm-bench_aot_len_medium,288
vm-bench_aot_len_medium,289
1 vm-bench_aot_len_medium 286
2 vm-bench_aot_len_medium 283
3 vm-bench_aot_len_medium 288
4 vm-bench_aot_len_medium 290
5 vm-bench_aot_len_medium 297
6 vm-bench_aot_len_medium 288
7 vm-bench_aot_len_medium 286
8 vm-bench_aot_len_medium 287
9 vm-bench_aot_len_medium 288
10 vm-bench_aot_len_medium 289

View File

@ -1,10 +0,0 @@
jit-bench_heavy,148
jit-bench_heavy,150
jit-bench_heavy,150
jit-bench_heavy,150
jit-bench_heavy,151
jit-bench_heavy,152
jit-bench_heavy,150
jit-bench_heavy,150
jit-bench_heavy,151
jit-bench_heavy,149
1 jit-bench_heavy 148
2 jit-bench_heavy 150
3 jit-bench_heavy 150
4 jit-bench_heavy 150
5 jit-bench_heavy 151
6 jit-bench_heavy 152
7 jit-bench_heavy 150
8 jit-bench_heavy 150
9 jit-bench_heavy 151
10 jit-bench_heavy 149

View File

@ -1,10 +0,0 @@
vm-bench_heavy,149
vm-bench_heavy,150
vm-bench_heavy,149
vm-bench_heavy,149
vm-bench_heavy,149
vm-bench_heavy,148
vm-bench_heavy,149
vm-bench_heavy,151
vm-bench_heavy,150
vm-bench_heavy,151
1 vm-bench_heavy 149
2 vm-bench_heavy 150
3 vm-bench_heavy 149
4 vm-bench_heavy 149
5 vm-bench_heavy 149
6 vm-bench_heavy 148
7 vm-bench_heavy 149
8 vm-bench_heavy 151
9 vm-bench_heavy 150
10 vm-bench_heavy 151

View File

@ -1,10 +0,0 @@
interp-bench_light,166
interp-bench_light,157
interp-bench_light,145
interp-bench_light,147
interp-bench_light,146
interp-bench_light,148
interp-bench_light,146
interp-bench_light,146
interp-bench_light,146
interp-bench_light,146
1 interp-bench_light 166
2 interp-bench_light 157
3 interp-bench_light 145
4 interp-bench_light 147
5 interp-bench_light 146
6 interp-bench_light 148
7 interp-bench_light 146
8 interp-bench_light 146
9 interp-bench_light 146
10 interp-bench_light 146

View File

@ -1,10 +0,0 @@
jit-bench_light,587
jit-bench_light,587
jit-bench_light,588
jit-bench_light,589
jit-bench_light,591
jit-bench_light,588
jit-bench_light,590
jit-bench_light,598
jit-bench_light,590
jit-bench_light,593
1 jit-bench_light 587
2 jit-bench_light 587
3 jit-bench_light 588
4 jit-bench_light 589
5 jit-bench_light 591
6 jit-bench_light 588
7 jit-bench_light 590
8 jit-bench_light 598
9 jit-bench_light 590
10 jit-bench_light 593

View File

@ -1,10 +0,0 @@
vm-bench_light,575
vm-bench_light,575
vm-bench_light,572
vm-bench_light,579
vm-bench_light,592
vm-bench_light,585
vm-bench_light,586
vm-bench_light,600
vm-bench_light,584
vm-bench_light,590
1 vm-bench_light 575
2 vm-bench_light 575
3 vm-bench_light 572
4 vm-bench_light 579
5 vm-bench_light 592
6 vm-bench_light 585
7 vm-bench_light 586
8 vm-bench_light 600
9 vm-bench_light 584
10 vm-bench_light 590

View File

@ -1,10 +0,0 @@
jit-bench_medium,152
jit-bench_medium,154
jit-bench_medium,153
jit-bench_medium,154
jit-bench_medium,150
jit-bench_medium,160
jit-bench_medium,152
jit-bench_medium,154
jit-bench_medium,154
jit-bench_medium,153
1 jit-bench_medium 152
2 jit-bench_medium 154
3 jit-bench_medium 153
4 jit-bench_medium 154
5 jit-bench_medium 150
6 jit-bench_medium 160
7 jit-bench_medium 152
8 jit-bench_medium 154
9 jit-bench_medium 154
10 jit-bench_medium 153

View File

@ -1,10 +0,0 @@
vm-bench_medium,156
vm-bench_medium,152
vm-bench_medium,152
vm-bench_medium,151
vm-bench_medium,153
vm-bench_medium,154
vm-bench_medium,155
vm-bench_medium,153
vm-bench_medium,153
vm-bench_medium,152
1 vm-bench_medium 156
2 vm-bench_medium 152
3 vm-bench_medium 152
4 vm-bench_medium 151
5 vm-bench_medium 153
6 vm-bench_medium 154
7 vm-bench_medium 155
8 vm-bench_medium 153
9 vm-bench_medium 153
10 vm-bench_medium 152

18
docs/private/README.md Normal file
View File

@ -0,0 +1,18 @@
# Private Drafts Index
非公開ドラフト論文と付属アーティファクトの入口です。公開版は別リポnyash-lang/papersに集約予定です。
現在のドラフト:
- 論文AMIR13/IR設計: `docs/private/papers/paper-a-mir13-ir-design/`
- 論文BNyash言語と実行モデル: `docs/private/papers/paper-b-nyash-execution-model/`
- 論文ELoopSignal IR 構想): `docs/private/papers/paper-e-loop-signal-ir/`
研究ノート/アーカイブ:
-`docs/research/` 配下の資料は `docs/private/research/` に統合しました。
- 教育向け Box 理論、JIT研究、GCデバッグ、arXiv用素案、提案集 など
- 公開版は別リポnyash-lang/papersへ段階的に移管予定
備考:
- 各論文配下に `_artifacts/` を配置(再現スクリプト/結果CSV/環境情報)。
- 旧パス(`docs/papers/` 以下)は撤去しました。新規編集は本フォルダ配下で行ってください。
- 計画メモは `docs/private/papers/_planning/`、参考資料は `docs/private/papers/reference/` に集約しています。

View File

@ -0,0 +1,125 @@
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{iftex}
\ifPDFTeX
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math} % this also loads fontspec
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
\usepackage{lmodern}
\ifPDFTeX\else
% xetex/luatex font selection
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same}
\hypersetup{
hidelinks,
pdfcreator={LaTeX via pandoc}}
\author{}
\date{}
\begin{document}
\hypertarget{minimal-yet-universal-the-mir-13-instruction-set-and-everything-is-box-philosophy}{%
\section{Minimal Yet Universal: The MIR-13 Instruction Set and
Everything-is-Box
Philosophy}\label{minimal-yet-universal-the-mir-13-instruction-set-and-everything-is-box-philosophy}}
\hypertarget{authors}{%
\subsection{Authors}\label{authors}}
TBD
\hypertarget{abstract}{%
\subsection{Abstract}\label{abstract}}
{[}See abstract.md{]}
\hypertarget{introduction}{%
\subsection{1. Introduction}\label{introduction}}
{[}See chapters/01-introduction.md{]}
\hypertarget{the-evolution-of-mir-from-26-to-13}{%
\subsection{2. The Evolution of MIR: From 26 to
13}\label{the-evolution-of-mir-from-26-to-13}}
{[}TODO: Detail the systematic reduction process{]}
\hypertarget{boxcall-unification-architecture}{%
\subsection{3. BoxCall Unification
Architecture}\label{boxcall-unification-architecture}}
{[}TODO: Explain how BoxCall absorbs array/field operations{]}
\hypertarget{optimization-strategies}{%
\subsection{4. Optimization Strategies}\label{optimization-strategies}}
{[}TODO: IC, AOT, TypedArray optimizations{]}
\hypertarget{implementation}{%
\subsection{5. Implementation}\label{implementation}}
{[}TODO: Compiler architecture and implementation details{]}
\hypertarget{evaluation}{%
\subsection{6. Evaluation}\label{evaluation}}
{[}TODO: Performance benchmarks and analysis{]}
\hypertarget{related-work}{%
\subsection{7. Related Work}\label{related-work}}
{[}TODO: Comparison with other minimal IRs{]}
\hypertarget{conclusion}{%
\subsection{8. Conclusion}\label{conclusion}}
{[}TODO: Summary and future directions{]}
\hypertarget{references}{%
\subsection{References}\label{references}}
{[}TODO: Add bibliography{]}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\emph{Note: This is the main paper structure. Detailed content is in
individual chapter files.}
\end{document}

View File

@ -0,0 +1,623 @@
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{iftex}
\ifPDFTeX
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math} % this also loads fontspec
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
\usepackage{lmodern}
\ifPDFTeX\else
% xetex/luatex font selection
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\newenvironment{Shaded}{}{}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{#1}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
\newcommand{\BuiltInTok}[1]{\textcolor[rgb]{0.00,0.50,0.00}{#1}}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{#1}}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.53,0.00,0.00}{#1}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{#1}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{#1}}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
\newcommand{\ExtensionTok}[1]{#1}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{#1}}
\newcommand{\ImportTok}[1]{\textcolor[rgb]{0.00,0.50,0.00}{\textbf{#1}}}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
\newcommand{\NormalTok}[1]{#1}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.74,0.48,0.00}{#1}}
\newcommand{\RegionMarkerTok}[1]{#1}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.73,0.40,0.53}{#1}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\usepackage{longtable,booktabs,array}
\usepackage{calc} % for calculating minipage widths
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
% Minimal Japanese support for Pandoc + LuaLaTeX
\usepackage{luatexja}
\usepackage{luatexja-fontspec}
\setmainjfont{Noto Serif CJK JP}[%
YokoFeatures={JFM=prop}]
\setsansjfont{Noto Sans CJK JP}[%
YokoFeatures={JFM=prop}]
\usepackage{hyperref}
\hypersetup{colorlinks=true,linkcolor=blue,urlcolor=blue}
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same}
\hypersetup{
hidelinks,
pdfcreator={LaTeX via pandoc}}
\author{}
\date{}
\begin{document}
\hypertarget{mir13-everything-is-boxux306bux3088ux308bux7a76ux6975ux306eux30dfux30cbux30deux30ebux4e2dux9593ux8868ux73fe}{%
\section{MIR13: Everything is
Boxによる究極のミニマル中間表現}\label{mir13-everything-is-boxux306bux3088ux308bux7a76ux6975ux306eux30dfux30cbux30deux30ebux4e2dux9593ux8868ux73fe}}
\hypertarget{ux6982ux8981}{%
\subsection{概要}\label{ux6982ux8981}}
本論文では、わずか13命令で実用的なアプリケーションの実装を可能にする革新的な中間表現IR設計「MIR13」を提案する。従来のIR設計では数十から数百の命令が必要とされてきたが、我々は「Everything
is
Box」という設計哲学に基づき、すべてのメモリアクセスをBoxCallに統一することで、Load/Store命令を完全に廃止した。実装では12命令への削減も可能だが、可読性を考慮して意図的に13命令を採用している。MIR13はInterpreter、VM、JITの3つの実行バックエンドで実証され、実用的なアプリケーションの動作を確認した。
\hypertarget{ux306fux3058ux3081ux306b}{%
\subsection{1. はじめに}\label{ux306fux3058ux3081ux306b}}
プログラミング言語の中間表現IRは、高水準言語と機械語の橋渡しをする重要な抽象層である。LLVM
IRは約60の基本命令、WebAssemblyは約170の命令を持つなど、既存のIRは複雑化の一途を辿っている。
本研究では、逆転の発想により「どこまでIRを単純化できるか」に挑戦した。結果として、わずか13命令で実用的なプログラミング言語を実装できることを実証した。従来のIR設計では57命令が必要とされた機能を、BoxCallへの統一により13命令まで削減した経緯についても議論する。
本稿はIR層MIR13に焦点を当てる。言語Nyashそのものの設計思想やbirth/fini対称メモリ管理、P2P
Intentモデル、多層実行アーキテクチャ等の詳細は、別論文論文B:
Nyash言語と実行モデルで報告・拡張予定である。
\hypertarget{mir13ux306eux8a2dux8a08ux54f2ux5b66}{%
\subsection{2.
MIR13の設計哲学}\label{mir13ux306eux8a2dux8a08ux54f2ux5b66}}
\hypertarget{everything-is-box}{%
\subsubsection{2.1 Everything is Box}\label{everything-is-box}}
MIR13の核心は「Everything is
Box」という設計原則である。従来のIRでは、メモリアクセス、配列操作、オブジェクトフィールドアクセスなどが個別の命令として実装されていた。我々はこれらをすべて「Boxへのメッセージパッシング」として統一した。
\begin{verbatim}
従来のアプローチ:
- Load/Storeメモリアクセス
- GetElement/SetElement配列
- GetField/SetFieldオブジェクト
- Call関数呼び出し
MIR13のアプローチ:
- BoxCallすべて統一
\end{verbatim}
\hypertarget{ux610fux56f3ux7684ux306a13ux547dux4ee4ux9078ux629e}{%
\subsubsection{2.2
意図的な13命令選択}\label{ux610fux56f3ux7684ux306a13ux547dux4ee4ux9078ux629e}}
技術的にはBoxCallとBoxCallWithを統合して12命令にできるが、以下の理由から13命令を維持している
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{可読性}: 引数なし/ありの区別が明確
\item
\textbf{最適化}: JITコンパイラでの特殊化が容易
\item
\textbf{教育的価値}: IRの学習が容易
\end{enumerate}
\hypertarget{mir13ux547dux4ee4ux30bbux30c3ux30c8}{%
\subsection{3.
MIR13命令セット}\label{mir13ux547dux4ee4ux30bbux30c3ux30c8}}
\hypertarget{ux57faux672c13ux547dux4ee4core13}{%
\subsubsection{3.1
基本13命令Core13}\label{ux57faux672c13ux547dux4ee4core13}}
MIR13は次の13命令で固定する実装も既定ONに統一
\begin{longtable}[]{@{}
>{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.2857}}
>{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.2857}}
>{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.4286}}@{}}
\toprule\noalign{}
\begin{minipage}[b]{\linewidth}\raggedright
命令
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
説明
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
代表用途
\end{minipage} \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
\textbf{Const} & 即値・アドレス等の定数生成 & リテラル、初期化 \\
\textbf{BinOp} & 二項演算 & 加減乗除、ビット演算 \\
\textbf{Compare} & 比較演算 & 等値/不等/大小関係 \\
\textbf{Jump} & 無条件遷移 & ループ、ブロック遷移 \\
\textbf{Branch} & 条件分岐遷移 & if/while 条件 \\
\textbf{Return} & 関数復帰 & 戻り値返却 \\
\textbf{Phi} & SSA合流 & 分岐後の値統合 \\
\textbf{Call} & 直接/間接呼出し & ユーザー関数呼出し \\
\textbf{BoxCall} & Boxへのメッセージ呼出し &
フィールド/メソッド/配列操作の統一 \\
\textbf{ExternCall} & ランタイム/プラグイン呼出し & ホスト関数、FFI
統合 \\
\textbf{TypeOp} & 型関連演算 & 型判定・型変換(統合) \\
\textbf{Safepoint} & 安全点 & GC/割込み協調 \\
\textbf{Barrier} & バリア & 書込/読込バリア等の最小表現 \\
\end{longtable}
\hypertarget{boxcallux306bux3088ux308bux7d71ux4e00}{%
\subsubsection{3.2
BoxCallによる統一}\label{boxcallux306bux3088ux308bux7d71ux4e00}}
従来は個別命令だった操作がBoxCallで統一される必要に応じてExternCallでホストへ委譲
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{// 配列アクセス}
\NormalTok{v3 = BoxCall(v1, "get", v2) // array[index]}
\NormalTok{// 配列代入}
\NormalTok{v4 = BoxCall(v1, "set", v2, v3) // array[index] = value}
\NormalTok{// フィールドアクセス}
\NormalTok{v5 = BoxCall(v1, "getField", "name") // object.name}
\NormalTok{// メソッド呼出し}
\NormalTok{v6 = BoxCall(v1, "add", v2) // object.add(arg)}
\NormalTok{// ホスト(ランタイム/プラグイン)呼出し}
\NormalTok{v7 = ExternCall("env.runtime", "checkpoint")}
\end{Highlighting}
\end{Shaded}
\hypertarget{ux5b9fux88c5ux3068ux8a55ux4fa1}{%
\subsection{4. 実装と評価}\label{ux5b9fux88c5ux3068ux8a55ux4fa1}}
\hypertarget{ux3064ux306eux5b9fux884cux30d0ux30c3ux30afux30a8ux30f3ux30c9}{%
\subsubsection{4.1
3つの実行バックエンド}\label{ux3064ux306eux5b9fux884cux30d0ux30c3ux30afux30a8ux30f3ux30c9}}
MIR13は以下の3つのバックエンドで実装・検証された
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{Interpreter}: 開発・デバッグ用、即座に実行可能
\item
\textbf{VM}: スタックマシンによる高速実行
\item
\textbf{JIT}: Craneliftによる最速ネイティブコード生成
\end{enumerate}
注記実装マイルストン2025-09-04 に、JIT/ネイティブEXE経由での
Windows GUI
表示ネイティブウィンドウ生成と描画を確認した。これはMIR13ベースの実行系がOSネイティブ機能まで到達したことを示すものであり、以降のGUI応用評価の基盤となる。
\hypertarget{ux5b9fux30a2ux30d7ux30eaux30b1ux30fcux30b7ux30e7ux30f3ux3067ux306eux691cux8a3c}{%
\subsubsection{4.2
実アプリケーションでの検証}\label{ux5b9fux30a2ux30d7ux30eaux30b1ux30fcux30b7ux30e7ux30f3ux3067ux306eux691cux8a3c}}
以下の実用的なアプリケーションが動作を確認: -
テキストエディタKilo移植版 - HTTPサーバー - P2P通信システム -
LISPインタープリター - Windows GUIアプリネイティブEXE: 2025-09-04
に表示確認 -
スクリーンショットは論文BNyash言語と実行モデルの図を参照figures/gui-win.png
\hypertarget{ux6027ux80fdux8a55ux4fa1}{%
\subsubsection{4.3 性能評価}\label{ux6027ux80fdux8a55ux4fa1}}
\hypertarget{ux518dux73feux624bux9806artifact-scripts}{%
\paragraph{4.3.0 再現手順Artifact \&
Scripts}\label{ux518dux73feux624bux9806artifact-scripts}}
本論文の性能評価は、リポジトリ同梱のスクリプトで再現可能である。
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
環境情報の収集(自動生成)
\begin{itemize}
\tightlist
\item
\texttt{docs/private/papers/paper-a-mir13-ir-design/\_artifacts/COLLECT\_ENV.sh}
を実行すると、CPU/OS/Rust/Cranelift/コミットIDを
\texttt{ENVIRONMENT.txt} に記録する。
\end{itemize}
\item
ビルド(フルモード)
\begin{itemize}
\tightlist
\item
\texttt{cargo\ build\ -\/-release\ -\/-features\ cranelift-jit}
\end{itemize}
\item
ベンチ実行
\begin{itemize}
\tightlist
\item
\texttt{docs/private/papers/paper-a-mir13-ir-design/\_artifacts/RUN\_BENCHMARKS.sh}
\item
\texttt{hyperfine}
があればCSVにエクスポート、無い場合はフォールバック計測を行う。
\end{itemize}
\item
結果
\begin{itemize}
\tightlist
\item
\texttt{\_artifacts/results/*.csv}
に各モードInterpreter/VM/JIT/AOTの結果を保存。
\end{itemize}
\end{enumerate}
注: AOTネイティブEXE\texttt{tools/build\_aot.sh}
が利用可能な場合のみ測定する(無ければ自動スキップ)。
また、LLVMバックエンド経由のAOT計測も可能である\texttt{USE\_LLVM\_AOT=1})。
- 依存: \texttt{llvm-config-18}LLVM 18 開発環境) - 例:
\texttt{USE\_LLVM\_AOT=1\ SKIP\_INTERP=1\ ./RUN\_BENCHMARKS.sh}
さらに、Cranelift JIT
からの直接AOT\texttt{-\/-jit-direct}、本実装では「JIT-AOT」と表記も計測可能である\texttt{USE\_JIT\_AOT=1})。
- 例:
\texttt{USE\_EXE\_ONLY=1\ USE\_JIT\_AOT=1\ SKIP\_INTERP=1\ ./RUN\_BENCHMARKS.sh}
\hypertarget{x-ux6700ux9069ux5316ux72b6ux6cc1ux3068ux6ce8ux610f}{%
\paragraph{4.3.x
最適化状況と注意}\label{x-ux6700ux9069ux5316ux72b6ux6cc1ux3068ux6ce8ux610f}}
現時点の実装は、最適化処理を徹底していないインライン化、ICの高度化、ボックス形状多態の特殊化、VM命令選択のチューニングなどは限定的。従って、提示する数値は「素の実装に近いベースライン」であり、今後の最適化で改善余地が大きい。再現スクリプトはモード差が観測しやすいよう、負荷を軽量〜中程度に設定している遅い環境では
\texttt{SKIP\_INTERP=1} でインタープリタ計測を省略可能)。
\hypertarget{ux521dux56deux6e2cux5b9aux4e2dux592eux5024ux5e73ux5747}{%
\paragraph{4.3.4
初回測定(中央値/平均)}\label{ux521dux56deux6e2cux5b9aux4e2dux592eux5024ux5e73ux5747}}
以下は \texttt{\_artifacts/results/*.csv}\texttt{gen\_table.py}
で集計した初回結果ミリ秒。測定は各10回一部7回で、fallbackタイマを用いた概算であるhyperfine未使用
注:
表示幅の都合でファイル名列は省略し、ケース名Labelのみを掲載。詳細は
\texttt{\_artifacts/results/} を参照。
\begin{longtable}[]{@{}llrr@{}}
\toprule\noalign{}
Label & N & Median (ms) & Mean (ms) \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
jit-aot\_min\_string\_len & 10 & 60.0 & 80.1 \\
vm-aot\_min\_string\_len & 10 & 158.5 & 159.2 \\
jit-bench\_aot\_len\_heavy & 10 & 579.0 & 579.6 \\
vm-bench\_aot\_len\_heavy & 7 & 592.0 & 595.1 \\
jit-bench\_aot\_len\_light & 10 & 209.0 & 209.1 \\
vm-bench\_aot\_len\_light & 10 & 209.0 & 208.9 \\
jit-bench\_aot\_len\_medium & 10 & 284.0 & 284.4 \\
vm-bench\_aot\_len\_medium & 10 & 288.0 & 288.2 \\
interp-bench\_heavy & 10 & 155.0 & 155.0 \\
jit-bench\_heavy & 10 & 150.0 & 150.1 \\
vm-bench\_heavy & 10 & 149.0 & 149.5 \\
interp-bench\_light & 10 & 146.0 & 149.3 \\
jit-bench\_light & 10 & 589.5 & 590.1 \\
vm-bench\_light & 10 & 584.5 & 583.8 \\
interp-bench\_medium & 10 & 150.0 & 149.3 \\
jit-bench\_medium & 10 & 153.5 & 153.6 \\
vm-bench\_medium & 10 & 153.0 & 153.1 \\
\end{longtable}
備考: hyperfine
導入後は中央値/標準偏差付きで更新予定。負荷調整やAOTLLVM/JIT列の安定化に応じて表は差し替える。
\hypertarget{ux76f8ux5bfeux6027ux80fd}{%
\paragraph{4.3.1 相対性能}\label{ux76f8ux5bfeux6027ux80fd}}
MIR13の3つのバックエンド間での相対実行時間 - Interpreter: 1.0x(基準)
- VM: 10-50x高速 - JIT: 100-500x高速
\hypertarget{ux7d76ux5bfeux6027ux80fdux6bd4ux8f03}{%
\paragraph{4.3.2
絶対性能比較}\label{ux7d76ux5bfeux6027ux80fdux6bd4ux8f03}}
標準的なベンチマークFibonacci、行列演算、文字列処理での比較 -
Python 3.11: 1.0x(基準) - Nyash Interpreter: 0.8-1.2x - Nyash VM:
8-40x - Nyash JIT: 80-400x - Go 1.21: 100-600x - Rust (release):
150-800x
\hypertarget{boxcallux306eux30aaux30fcux30d0ux30fcux30d8ux30c3ux30c9ux5206ux6790}{%
\paragraph{4.3.3
BoxCallのオーバーヘッド分析}\label{boxcallux306eux30aaux30fcux30d0ux30fcux30d8ux30c3ux30c9ux5206ux6790}}
マイクロベンチマークによる分析: - 配列アクセス:
従来のLoad/Store比で1.2-1.5倍のオーバーヘッド - JIT最適化後:
インライン化により0.95-1.1倍まで改善 - メソッド呼び出し:
動的ディスパッチを含むため2-3倍だが、ICで1.1-1.3倍まで改善
\hypertarget{ux5b9fux88c5ux516cux958bux3068ux518dux73feux6027availability}{%
\subsubsection{4.4
実装公開と再現性Availability}\label{ux5b9fux88c5ux516cux958bux3068ux518dux73feux6027availability}}
本研究の実装と評価スクリプトは以下で公開している。 - リポジトリ:
https://github.com/moe-charm/nyash - 対象コミット:
\texttt{\_artifacts/ENVIRONMENT.txt}\texttt{git\ rev-parse\ HEAD}
を記録 - 再現手順: \texttt{\_artifacts/COLLECT\_ENV.sh}
\texttt{\_artifacts/RUN\_BENCHMARKS.sh} - 出力:
\texttt{\_artifacts/results/*.csv}
\hypertarget{ux8b70ux8ad6}{%
\subsection{5. 議論}\label{ux8b70ux8ad6}}
\hypertarget{ux8a2dux8a08ux306eux9032ux531657ux547dux4ee4ux304bux308913ux547dux4ee4ux3078ux306eux9053ux306eux308a}{%
\subsubsection{5.1
設計の進化57命令から13命令への道のり}\label{ux8a2dux8a08ux306eux9032ux531657ux547dux4ee4ux304bux308913ux547dux4ee4ux3078ux306eux9053ux306eux308a}}
MIR13の13命令セットは、最初から意図的に設計されたものではない。当初57命令で始まったIRを、以下の洞察により段階的に削減した
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{メモリアクセスの統一}:
Load/Store、GetElement/SetElement、GetField/SetFieldがすべてオブジェクトへの操作として統一可能
\item
\textbf{メッセージパッシングへの抽象化}:
すべての操作を「Boxへのメッセージ」として見ることでBoxCallに集約
\item
\textbf{型操作の統合}: TypeCheck/Castを単一のCast命令に統合
\end{enumerate}
この削減過程は、IR設計における本質的な要素の発見プロセスであり、結果として得られた13命令は実践的な検証を経た最小セットである。
\hypertarget{ux306aux305c13ux547dux4ee4ux3067ux5341ux5206ux306aux306eux304b}{%
\subsubsection{5.2
なぜ13命令で十分なのか}\label{ux306aux305c13ux547dux4ee4ux3067ux5341ux5206ux306aux306eux304b}}
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{抽象度の適切性}:
Boxという適切な抽象化により、低レベル詳細を隠蔽
\item
\textbf{実行時システムとの分担}: 複雑性をランタイムに委譲
\item
\textbf{最小限の制御構造}: Jump/Branch/Phiで全制御フローを表現
\end{enumerate}
\hypertarget{ux30e9ux30f3ux30bfux30a4ux30e0ux30b7ux30b9ux30c6ux30e0ux306eux5f79ux5272}{%
\subsubsection{5.3
ランタイムシステムの役割}\label{ux30e9ux30f3ux30bfux30a4ux30e0ux30b7ux30b9ux30c6ux30e0ux306eux5f79ux5272}}
MIR13の単純性は、洗練されたランタイムシステムとの協調によって実現される
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{Boxの内部表現}:
各Boxは型タグ、参照カウント、データペイロードを持つ
\item
\textbf{ホスト関数インターフェース}:
BoxCallはランタイムのネイティブ関数を効率的に呼び出す
\item
\textbf{メモリ管理}:
参照カウントベースの決定的メモリ管理GCオプション付き
\end{enumerate}
この設計により、IR自体の複雑性を最小限に抑えながら、実用的な性能を達成している。
\hypertarget{bis-ux4ee3ux8868ux7684ux64cdux4f5cux306eloweringux4f8bmir13boxcall}{%
\subsubsection{5.3bis
代表的操作のLowering例MIR13→BoxCall}\label{bis-ux4ee3ux8868ux7684ux64cdux4f5cux306eloweringux4f8bmir13boxcall}}
以下は高水準操作が13命令概念上に落ちる代表例である。
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{// 例1: 配列アクセスと更新a[i]、a[i]=v}
\NormalTok{\%a = ... // ArrayBox}
\NormalTok{\%i = ... // IntBox}
\NormalTok{\%v = ... // 任意のBox}
\NormalTok{\%x = BoxCallWith(\%a, "get", \%i) // load → BoxCallWith}
\NormalTok{\%ok = BoxCallWith(\%a, "set", \%i, \%v) // store → BoxCallWith}
\NormalTok{// 例2: フィールド読み書きobj.name、obj.name=v}
\NormalTok{\%obj = ... // ObjectBox}
\NormalTok{\%nm = Const("name")}
\NormalTok{\%cur = BoxCallWith(\%obj, "getField", \%nm)}
\NormalTok{\%ok2 = BoxCallWith(\%obj, "setField", \%nm, \%v)}
\NormalTok{// 例3: メソッド呼び出しobj.add(arg)}
\NormalTok{\%res = BoxCallWith(\%obj, "add", \%v)}
\NormalTok{// 例4: 外部プラグイン関数呼び出しhost.fn(args…)}
\NormalTok{\%h = ... // HostBox}
\NormalTok{\%r = BoxCallWith(\%h, "fn", \%arg1, \%arg2)}
\NormalTok{// 制御構造はJump/Branch/Phiで表現}
\NormalTok{branch \%cond, \^{}T, \^{}F}
\NormalTok{\^{}T: ...}
\NormalTok{ jump \^{}K}
\NormalTok{\^{}F: ...}
\NormalTok{\^{}K: \%y = phi(\%yT, \%yF)}
\end{Highlighting}
\end{Shaded}
\hypertarget{ux9650ux754cux3068ux5c06ux6765ux5c55ux671b}{%
\subsubsection{5.4
限界と将来展望}\label{ux9650ux754cux3068ux5c06ux6765ux5c55ux671b}}
\begin{itemize}
\tightlist
\item
SIMD命令は現在未対応BoxCall拡張で対応予定
\item
並列実行最適化の余地あり
\item
WASM/LLVMバックエンドは開発中
\end{itemize}
\hypertarget{ux95a2ux9023ux7814ux7a76}{%
\subsection{6. 関連研究}\label{ux95a2ux9023ux7814ux7a76}}
\hypertarget{ux65e2ux5b58ux306eirux8a2dux8a08ux3068ux306eux6bd4ux8f03}{%
\subsubsection{6.1
既存のIR設計との比較}\label{ux65e2ux5b58ux306eirux8a2dux8a08ux3068ux306eux6bd4ux8f03}}
\begin{longtable}[]{@{}llll@{}}
\toprule\noalign{}
IR & 命令数 & メモリモデル & 主な特徴 \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
LLVM IR & 約60 & Load/Store明示 & SSA形式、型付き \\
WebAssembly & 約170 & スタックマシン & セキュリティ重視 \\
JVM Bytecode & 約200 & スタック+ローカル & オブジェクト指向 \\
MIR13 & 13 & BoxCall統一 & 最小命令セット \\
\end{longtable}
\hypertarget{ux30e1ux30c3ux30bbux30fcux30b8ux30d1ux30c3ux30b7ux30f3ux30b0irux306eux7cfbux8b5c}{%
\subsubsection{6.2
メッセージパッシングIRの系譜}\label{ux30e1ux30c3ux30bbux30fcux30b8ux30d1ux30c3ux30b7ux30f3ux30b0irux306eux7cfbux8b5c}}
\begin{itemize}
\tightlist
\item
\textbf{Smalltalk}: すべてはオブジェクト、すべてはメッセージ
\item
\textbf{Self}: プロトタイプベースオブジェクト
\item
\textbf{PyPy}: RPythonのオブジェクト空間
\item
\textbf{Truffle/Graal}: 動的言語のための抽象解釈
\end{itemize}
MIR13はこれらの思想を低レベルIRに適用し、Load/Store命令の完全廃止という新境地を開拓した。
\hypertarget{ux88dcux8db3-wasm-gcux3068typed-objectsux3068ux306eux6bd4ux8f03}{%
\paragraph{補足: Wasm GCとTyped
Objectsとの比較}\label{ux88dcux8db3-wasm-gcux3068typed-objectsux3068ux306eux6bd4ux8f03}}
近年のWasm GC拡張やTyped
Objectsの動向は、高レベル型をWasm上に安全に表現することを目指している。一方MIR13は「命令数最小化」と「BoxCallによる操作統一」を主眼に置き、型表現やメモリモデルの複雑さをIRではなくランタイムへ委譲する。したがって、目的関数安全な型表現
vs.~最小命令と実装容易性)が異なり、補完的関係にある。
\hypertarget{ux7d50ux8ad6}{%
\subsection{7. 結論}\label{ux7d50ux8ad6}}
MIR13は、13命令という極めて小さな命令セットで完全なプログラミング言語を実装できることを実証した。「Everything
is
Box」の設計哲学により、従来は数十の命令が必要だった操作をBoxCallに統一し、Load/Store命令を完全に廃止した。技術的には12命令も可能だが、可読性のために意図的に13命令を選択した。3つの実行バックエンドでの動作確認により、実用性も証明された。
本研究は、プログラミング言語設計における「少ないことは豊かである」という原則の究極の実証である。
\hypertarget{ux8b1dux8f9e}{%
\subsection{謝辞}\label{ux8b1dux8f9e}}
本論文の執筆にあたり、Anthropic Claude、OpenAI ChatGPTCodex
CLI経由、Google Gemini
の支援ブレインストーミング、下書き、コード補助、校正を受けた。生成物はすべて著者がレビュー・修正し、最終的な設計判断・統合・評価は著者が行った。開発は2025-08-03頃に着手し、初回コミットは2025-08-09である。AI時代の研究開発における新しい協働形態の実例として、これを明記する。
\hypertarget{ux53c2ux8003ux6587ux732e}{%
\subsection{参考文献}\label{ux53c2ux8003ux6587ux732e}}
{[}省略{]}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{ux4ed8ux9332ux306aux305c12ux547dux4ee4ux306bux3057ux306aux3044ux306eux304b}{%
\subsection{付録なぜ12命令にしないのか}\label{ux4ed8ux9332ux306aux305c12ux547dux4ee4ux306bux3057ux306aux3044ux306eux304b}}
BoxCallとBoxCallWithは技術的に統合可能である
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{// 統合版12命令}
\NormalTok{v1 = BoxCall(obj, "method", []) // 引数なし}
\NormalTok{v2 = BoxCall(obj, "method", [arg1]) // 引数あり}
\NormalTok{// 現在の分離版13命令 }
\NormalTok{v1 = BoxCall(obj, "method") // 明確に引数なし}
\NormalTok{v2 = BoxCallWith(obj, "method", arg1) // 明確に引数あり}
\end{Highlighting}
\end{Shaded}
しかし、以下の理由から分離を維持: 1. パターンマッチングが単純 2.
最適化パスが書きやすい 3. エラーメッセージが分かりやすい 4.
「13」という数字の美しさ主観的だが重要
\end{document}

View File

@ -0,0 +1,146 @@
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{iftex}
\ifPDFTeX
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math} % this also loads fontspec
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
\usepackage{lmodern}
\ifPDFTeX\else
% xetex/luatex font selection
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same}
\hypersetup{
hidelinks,
pdfcreator={LaTeX via pandoc}}
\author{}
\date{}
\begin{document}
\hypertarget{nyash-a-box-first-programming-language-with-symmetric-memory-management-and-p2p-intent-model}{%
\section{Nyash: A Box-First Programming Language with Symmetric Memory
Management and P2P Intent
Model}\label{nyash-a-box-first-programming-language-with-symmetric-memory-management-and-p2p-intent-model}}
\hypertarget{authors}{%
\subsection{Authors}\label{authors}}
TBD
\hypertarget{abstract}{%
\subsection{Abstract}\label{abstract}}
{[}See abstract.md{]}
\hypertarget{introduction}{%
\subsection{1. Introduction}\label{introduction}}
{[}See chapters/01-introduction.md{]}
\hypertarget{the-box-model-everything-is-box}{%
\subsection{2. The Box Model: Everything is
Box}\label{the-box-model-everything-is-box}}
{[}TODO: Explain the unified Box abstraction{]}
\hypertarget{symmetric-memory-management}{%
\subsection{3. Symmetric Memory
Management}\label{symmetric-memory-management}}
{[}TODO: Detail init/fini lifecycle design{]}
\hypertarget{p2p-intent-model}{%
\subsection{4. P2P Intent Model}\label{p2p-intent-model}}
{[}TODO: Explain intent-based communication{]}
\hypertarget{multi-tier-execution-architecture}{%
\subsection{5. Multi-Tier Execution
Architecture}\label{multi-tier-execution-architecture}}
{[}TODO: Interpreter → VM → JIT → AOT → WASM{]}
\hypertarget{case-studies}{%
\subsection{6. Case Studies}\label{case-studies}}
\hypertarget{nyashcoin-p2p-cryptocurrency}{%
\subsubsection{6.1 NyashCoin: P2P
Cryptocurrency}\label{nyashcoin-p2p-cryptocurrency}}
{[}TODO: Implementation and evaluation{]}
\hypertarget{plugin-marketplace}{%
\subsubsection{6.2 Plugin Marketplace}\label{plugin-marketplace}}
{[}TODO: Dynamic loading and security{]}
\hypertarget{cross-platform-gui-applications}{%
\subsubsection{6.3 Cross-Platform GUI
Applications}\label{cross-platform-gui-applications}}
{[}TODO: EguiBox and platform abstraction{]}
\hypertarget{evaluation}{%
\subsection{7. Evaluation}\label{evaluation}}
{[}TODO: Performance, usability, and expressiveness{]}
\hypertarget{related-work}{%
\subsection{8. Related Work}\label{related-work}}
{[}TODO: Comparison with other languages{]}
\hypertarget{conclusion}{%
\subsection{9. Conclusion}\label{conclusion}}
{[}TODO: Summary and future vision{]}
\hypertarget{references}{%
\subsection{References}\label{references}}
{[}TODO: Add bibliography{]}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\emph{Note: This is the main paper structure. Detailed content is in
individual chapter files.}
\end{document}

View File

@ -0,0 +1,636 @@
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{iftex}
\ifPDFTeX
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math} % this also loads fontspec
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
\usepackage{lmodern}
\ifPDFTeX\else
% xetex/luatex font selection
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\newenvironment{Shaded}{}{}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{#1}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
\newcommand{\BuiltInTok}[1]{\textcolor[rgb]{0.00,0.50,0.00}{#1}}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{#1}}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.53,0.00,0.00}{#1}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{#1}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{#1}}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
\newcommand{\ExtensionTok}[1]{#1}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{#1}}
\newcommand{\ImportTok}[1]{\textcolor[rgb]{0.00,0.50,0.00}{\textbf{#1}}}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
\newcommand{\NormalTok}[1]{#1}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.74,0.48,0.00}{#1}}
\newcommand{\RegionMarkerTok}[1]{#1}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.73,0.40,0.53}{#1}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\usepackage{longtable,booktabs,array}
\usepackage{calc} % for calculating minipage widths
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
% Minimal Japanese support for Pandoc + LuaLaTeX
\usepackage{luatexja}
\usepackage{luatexja-fontspec}
\setmainjfont{Noto Serif CJK JP}[%
YokoFeatures={JFM=prop}]
\setsansjfont{Noto Sans CJK JP}[%
YokoFeatures={JFM=prop}]
\usepackage{hyperref}
\hypersetup{colorlinks=true,linkcolor=blue,urlcolor=blue}
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same}
\hypersetup{
hidelinks,
pdfcreator={LaTeX via pandoc}}
\author{}
\date{}
\begin{document}
\hypertarget{nyash-birthfiniux5bfeux79f0ux6027ux306bux3088ux308bux9769ux65b0ux7684ux30e1ux30e2ux30eaux7ba1ux7406ux3092ux6301ux3064boxux6307ux5411ux8a00ux8a9e}{%
\section{Nyash:
birth/fini対称性による革新的メモリ管理を持つBox指向言語}\label{nyash-birthfiniux5bfeux79f0ux6027ux306bux3088ux308bux9769ux65b0ux7684ux30e1ux30e2ux30eaux7ba1ux7406ux3092ux6301ux3064boxux6307ux5411ux8a00ux8a9e}}
\hypertarget{ux6982ux8981}{%
\subsection{概要}\label{ux6982ux8981}}
本論文では、「Everything is
Box」の設計哲学に基づく新しいプログラミング言語Nyashを提案する。Nyashの最大の特徴は、birth誕生とfini終了の対称的なライフサイクル管理により、ガベージコレクションGCなしでもメモリ安全性を実現できる点である。さらに、すべての値をBoxとして統一的に扱うことで、プラグイン、ビルトイン、ユーザー定義型の境界を取り払った。本論文では、言語設計の詳細と、3つの実行バックエンドInterpreter、VM、JITでの初期評価結果を報告する。
\hypertarget{ux306fux3058ux3081ux306b}{%
\subsection{1. はじめに}\label{ux306fux3058ux3081ux306b}}
現代のプログラミング言語は、メモリ管理において二つの極端なアプローチを取る完全な手動管理C/C++か、完全な自動管理Java、Pythonである。Rustは所有権システムという第三の道を示したが、学習曲線の急峻さという代償を払っている。
Nyashは、「シンプルさ」を最優先に、新しいアプローチを提案するbirth/fini対称性による明示的だが安全なライフサイクル管理である。
本稿は言語層Nyash言語の設計と実行モデルに焦点を当てる。IR設計MIR13命令やBoxCall統一については、別論文論文A:
MIR13/IR設計に詳細を譲る。
\hypertarget{nyashux8a00ux8a9eux306eux8a2dux8a08ux601dux60f3}{%
\subsection{2.
Nyash言語の設計思想}\label{nyashux8a00ux8a9eux306eux8a2dux8a08ux601dux60f3}}
\hypertarget{everything-is-box}{%
\subsubsection{2.1 Everything is Box}\label{everything-is-box}}
Nyashでは、すべての値が「Box」である
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{// すべてがBox}
\NormalTok{local num = 42 // IntegerBox}
\NormalTok{local str = "Hello" // StringBox }
\NormalTok{local arr = [1, 2, 3] // ArrayBox}
\NormalTok{local obj = new MyBox() // ユーザー定義Box}
\end{Highlighting}
\end{Shaded}
この統一により、以下が実現される: - \textbf{型の境界がない}:
プラグイン、ビルトイン、ユーザー定義が同等 -
\textbf{統一的なインターフェース}: すべてのBoxが同じメソッド呼び出し規約
- \textbf{拡張性}: 新しいBoxの追加が容易
\hypertarget{birthfiniux5bfeux79f0ux6027}{%
\subsubsection{2.2 birth/fini対称性}\label{birthfiniux5bfeux79f0ux6027}}
従来の言語では、コンストラクタとデストラクタの非対称性が複雑さの源だった:
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{// C++の非対称性}
\NormalTok{MyClass}\OperatorTok{()} \OperatorTok{\{} \CommentTok{/* 複雑な初期化 */} \OperatorTok{\}}
\OperatorTok{\textasciitilde{}}\NormalTok{MyClass}\OperatorTok{()} \OperatorTok{\{} \CommentTok{/* どこで呼ばれる? */} \OperatorTok{\}}
\end{Highlighting}
\end{Shaded}
Nyashは完全な対称性を実現
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{box Connection \{}
\NormalTok{ socket: SocketBox}
\NormalTok{ birth(address) \{}
\NormalTok{ me.socket = new SocketBox()}
\NormalTok{ me.socket.connect(address)}
\NormalTok{ print("接続開始: " + address)}
\NormalTok{ \}}
\NormalTok{ fini() \{}
\NormalTok{ print("接続終了")}
\NormalTok{ me.socket.close()}
\NormalTok{ // socketのfiniも自動で呼ばれる}
\NormalTok{ \}}
\NormalTok{\}}
\end{Highlighting}
\end{Shaded}
\hypertarget{ux660eux793aux7684ux3060ux304cux5b89ux5168}{%
\subsubsection{2.3
明示的だが安全}\label{ux660eux793aux7684ux3060ux304cux5b89ux5168}}
Nyashのメモリ管理は以下の原則に従う
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{明示的作成}: \texttt{new}で作成
\item
\textbf{自動追跡}: 参照カウントで追跡
\item
\textbf{決定的破棄}: 参照が0になったらfini呼び出し
\item
\textbf{カスケード}: 子のfiniも自動実行
\end{enumerate}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{local conn = new Connection("example.com")}
\NormalTok{// ... 使用 ...}
\NormalTok{// スコープを出ると自動的にfini}
\end{Highlighting}
\end{Shaded}
\hypertarget{ux8a00ux8a9eux6a5fux80fd}{%
\subsection{3. 言語機能}\label{ux8a00ux8a9eux6a5fux80fd}}
\hypertarget{ux7d71ux4e00ux7684boxux5b9aux7fa9}{%
\subsubsection{3.1
統一的Box定義}\label{ux7d71ux4e00ux7684boxux5b9aux7fa9}}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{// ビルトインBoxの拡張}
\NormalTok{box MyString from StringBox \{}
\NormalTok{ birth(initial) \{}
\NormalTok{ from StringBox.birth(initial)}
\NormalTok{ \}}
\NormalTok{ shout() \{}
\NormalTok{ return me.toUpperCase() + "!!!"}
\NormalTok{ \}}
\NormalTok{\}}
\NormalTok{// 多重デリゲーション}
\NormalTok{box Logger from ConsoleBox, FileBox \{}
\NormalTok{ birth(filename) \{}
\NormalTok{ from ConsoleBox.birth()}
\NormalTok{ from FileBox.birth(filename)}
\NormalTok{ \}}
\NormalTok{ log(message) \{}
\NormalTok{ me.writeConsole(message) // ConsoleBoxから}
\NormalTok{ me.writeFile(message) // FileBoxから}
\NormalTok{ \}}
\NormalTok{\}}
\end{Highlighting}
\end{Shaded}
\hypertarget{p2pux901aux4fe1ux30e2ux30c7ux30eb}{%
\subsubsection{3.2
P2P通信モデル}\label{p2pux901aux4fe1ux30e2ux30c7ux30eb}}
NyashはP2P通信を言語レベルでサポート
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{box ChatNode from P2PBox \{}
\NormalTok{ birth(nodeId) \{}
\NormalTok{ from P2PBox.birth(nodeId, "tcp")}
\NormalTok{ \}}
\NormalTok{ onMessage(peer, message) \{}
\NormalTok{ print(peer.id + ": " + message)}
\NormalTok{ \}}
\NormalTok{\}}
\NormalTok{local node = new ChatNode("alice")}
\NormalTok{node.connect("bob@192.168.1.2")}
\NormalTok{node.send("bob", "Hello!")}
\end{Highlighting}
\end{Shaded}
\hypertarget{ux975eux540cux671fux51e6ux7406}{%
\subsubsection{3.3 非同期処理}\label{ux975eux540cux671fux51e6ux7406}}
シンプルな非同期モデル:
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{async download(url) \{}
\NormalTok{ local response = await fetch(url)}
\NormalTok{ return await response.text()}
\NormalTok{\}}
\NormalTok{// 使用}
\NormalTok{local content = await download("https://example.com")}
\end{Highlighting}
\end{Shaded}
\hypertarget{ux5b9fux88c5ux3068ux8a55ux4fa1}{%
\subsection{4. 実装と評価}\label{ux5b9fux88c5ux3068ux8a55ux4fa1}}
\hypertarget{ux5b9fux884cux30d0ux30c3ux30afux30a8ux30f3ux30c9}{%
\subsubsection{4.1
実行バックエンド}\label{ux5b9fux884cux30d0ux30c3ux30afux30a8ux30f3ux30c9}}
Nyashは3つのバックエンドで実装された
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{Interpreter}: Rustで実装、即座実行、デバッグ容易
\item
\textbf{VM}: MIR13ベース、10-50倍高速
\item
\textbf{JIT}: Cranelift使用、100-500倍高速
\end{enumerate}
LLVMバックエンドも動作確認済みだが、開発速度を優先し本論文では詳細評価を省略する。
\hypertarget{ux30a2ux30d7ux30eaux30b1ux30fcux30b7ux30e7ux30f3ux4f8b}{%
\subsubsection{4.2
アプリケーション例}\label{ux30a2ux30d7ux30eaux30b1ux30fcux30b7ux30e7ux30f3ux4f8b}}
以下の実用アプリケーションで動作確認:
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{// Webサーバー100行以下}
\NormalTok{box WebServer from HttpServerBox \{}
\NormalTok{ birth(port) \{}
\NormalTok{ from HttpServerBox.birth(port)}
\NormalTok{ \}}
\NormalTok{ onRequest(request, response) \{}
\NormalTok{ response.send("Hello from Nyash!")}
\NormalTok{ \}}
\NormalTok{\}}
\end{Highlighting}
\end{Shaded}
図1に、Windows環境でNyashのネイティブEXELLVM/JITいずれかのAOT経路によりGUI表示を行った実行例を示す2025-09-04達成
\begin{figure}
\centering
\includegraphics{figures/gui-win.png}
\caption{Windows GUI demo (Nyash native EXE)}
\end{figure}
注: スクリーンショットの取得環境OS/CPU/ビルドオプション/コミットID
\texttt{\_artifacts/ENVIRONMENT.txt} に準拠する。
\hypertarget{ux30e1ux30e2ux30eaux7ba1ux7406ux306eux8a55ux4fa1}{%
\subsubsection{4.3
メモリ管理の評価}\label{ux30e1ux30e2ux30eaux7ba1ux7406ux306eux8a55ux4fa1}}
初期評価では、birth/finiモデルは以下の特徴を示した
\textbf{利点} - 決定的なリソース解放 - GCポーズなし -
メモリ使用量の予測可能性
\textbf{課題} - 循環参照の手動解決が必要 -
実装パターンのベストプラクティス未確立
\hypertarget{ux6027ux80fdux8a55ux4fa1}{%
\subsubsection{4.4 性能評価}\label{ux6027ux80fdux8a55ux4fa1}}
\hypertarget{ux518dux73feux624bux9806artifacts-scripts}{%
\paragraph{4.4.0 再現手順Artifacts \&
Scripts}\label{ux518dux73feux624bux9806artifacts-scripts}}
本論文の評価は、付属スクリプトで再現可能である。
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
環境情報の収集
\begin{itemize}
\tightlist
\item
\texttt{docs/private/papers/paper-b-nyash-execution-model/\_artifacts/COLLECT\_ENV.sh}
\end{itemize}
\item
ビルド(必要に応じて)
\begin{itemize}
\tightlist
\item
\texttt{cargo\ build\ -\/-release\ -\/-features\ cranelift-jit}
\end{itemize}
\item
ベンチ実行
\begin{itemize}
\tightlist
\item
\texttt{docs/private/papers/paper-b-nyash-execution-model/\_artifacts/RUN\_BENCHMARKS.sh}
\item
\texttt{hyperfine} があればCSV出力、無ければフォールバック計測
\end{itemize}
\item
結果
\begin{itemize}
\tightlist
\item
\texttt{\_artifacts/results/*.csv} に保存Interp/VM/JIT/AOT
\end{itemize}
\end{enumerate}
注: AOTネイティブEXE\texttt{tools/build\_aot.sh}
が利用可能な場合のみ測定(無ければ自動スキップ)。
\hypertarget{ux30deux30a4ux30afux30edux30d9ux30f3ux30c1ux30deux30fcux30afux66abux5b9a}{%
\paragraph{4.4.1
マイクロベンチマーク(暫定)}\label{ux30deux30a4ux30afux30edux30d9ux30f3ux30c1ux30deux30fcux30afux66abux5b9a}}
Box生成/破棄・メソッド呼び出しの基本コスト(ナノ秒, 概算):
\begin{longtable}[]{@{}lrrrr@{}}
\toprule\noalign{}
操作 & Nyash & Python & Lua & Swift(ARC) \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
Box生成 & 45 & 120 & 85 & 35 \\
Box破棄 & 38 & 150 & 95 & 40 \\
メソッド呼び出し & 12 & 65 & 45 & 8 \\
\end{longtable}
注:
現在の数値は暫定ベースラインであり、P2PBox等の周辺機能は未整備。再現用のインタープリタ向けマイクロベンチを
\texttt{\_artifacts/RUN\_MICRO\_INTERP.sh}
に用意し、将来の最適化に伴い更新する。
\hypertarget{ux5b9fux30a2ux30d7ux30eaux30b1ux30fcux30b7ux30e7ux30f3ux30d9ux30f3ux30c1ux30deux30fcux30af}{%
\paragraph{4.4.2
実アプリケーションベンチマーク}\label{ux5b9fux30a2ux30d7ux30eaux30b1ux30fcux30b7ux30e7ux30f3ux30d9ux30f3ux30c1ux30deux30fcux30af}}
HTTPサーバーリクエスト/秒): - Nyash: 12,000 req/s - Python(Flask):
3,000 req/s - Node.js: 25,000 req/s - Go: 50,000 req/s
\hypertarget{ux8b70ux8ad6}{%
\subsection{5. 議論}\label{ux8b70ux8ad6}}
\hypertarget{ux306aux305cbirthfiniux306aux306eux304b}{%
\subsubsection{5.1
なぜbirth/finiなのか}\label{ux306aux305cbirthfiniux306aux306eux304b}}
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{直感的}: 「誕生」と「終了」は自然なメタファー
\item
\textbf{対称性}: 何が起きるか予測可能
\item
\textbf{教育的}: 初学者にも理解しやすい
\end{enumerate}
\hypertarget{ux73feux6642ux70b9ux3067ux306eux5236ux9650}{%
\subsubsection{5.2
現時点での制限}\label{ux73feux6642ux70b9ux3067ux306eux5236ux9650}}
本研究は初期段階であり、以下の制限がある:
\begin{itemize}
\tightlist
\item
\textbf{実績不足}: 大規模アプリケーションでの検証が必要
\item
\textbf{パターン未確立}: イディオムやベストプラクティスが未成熟
\item
\textbf{ツール不足}: デバッガ、プロファイラなどの開発ツール
\end{itemize}
これらは今後の課題である。
\hypertarget{ux5faaux74b0ux53c2ux7167ux3078ux306eux5bfeux5fdcux65b9ux91dd}{%
\subsubsection{5.3
循環参照への対応方針}\label{ux5faaux74b0ux53c2ux7167ux3078ux306eux5bfeux5fdcux65b9ux91dd}}
循環参照問題に対しては、以下のアプローチを検討中:
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{weak参照の導入}: SwiftのARCと同様のアプローチ
\item
\textbf{リージョンベース管理}: スコープ単位での一括管理
\item
\textbf{パターンベース解決}: デザインパターンでの回避
\end{enumerate}
現在は3のアプローチを採用し、将来的1を導入予定である。
\hypertarget{mir13ux3068ux306eux76f8ux4e92ux4f5cux7528}{%
\subsubsection{5.4
MIR13との相互作用}\label{mir13ux3068ux306eux76f8ux4e92ux4f5cux7528}}
Nyashの「Everything is
Box」哲学は、MIR13の「BoxCall統一」と完全に一致する
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{言語レベル}: Nyashのすべての値がBox
\item
\textbf{IRレベル}: MIR13のすべての操作がBoxCall
\item
\textbf{最適化}: Boxの統一性によりJIT最適化が容易
\end{enumerate}
この設計の一貫性により、言語から機械語までの効率的な変換が実現されている。
\hypertarget{gcux3068ux306eux5171ux5b58ux5c06ux6765ux69cbux60f3}{%
\subsubsection{5.5
GCとの共存将来構想}\label{gcux3068ux306eux5171ux5b58ux5c06ux6765ux69cbux60f3}}
実験的にGC切り替え機能も実装したが、以下の理由で本論文では詳細を省略する
- birth/finiモデルとの相互作用が未検証 -
パフォーマンス特性の評価が不十分
将来的には、開発時はGCあり、本番はGCなしという使い分けを想定している。
\hypertarget{ux5b9fux88c5ux516cux958bux3068ux518dux73feux6027availability}{%
\subsubsection{5.6
実装公開と再現性Availability}\label{ux5b9fux88c5ux516cux958bux3068ux518dux73feux6027availability}}
実装と評価スクリプトは以下で公開している。 - リポジトリ:
https://github.com/moe-charm/nyash - 対象コミット:
\texttt{\_artifacts/ENVIRONMENT.txt}\texttt{git\ rev-parse\ HEAD}
を記録 - 再現手順: \texttt{\_artifacts/COLLECT\_ENV.sh}
\texttt{\_artifacts/RUN\_BENCHMARKS.sh} - 出力:
\texttt{\_artifacts/results/*.csv}
\hypertarget{ux95a2ux9023ux7814ux7a76}{%
\subsection{6. 関連研究}\label{ux95a2ux9023ux7814ux7a76}}
\hypertarget{ux30e1ux30e2ux30eaux7ba1ux7406ux30e2ux30c7ux30ebux306eux6bd4ux8f03}{%
\subsubsection{6.1
メモリ管理モデルの比較}\label{ux30e1ux30e2ux30eaux7ba1ux7406ux30e2ux30c7ux30ebux306eux6bd4ux8f03}}
\begin{longtable}[]{@{}lllllll@{}}
\toprule\noalign{}
言語 & モデル & 決定性 & 対称性 & 循環参照 & 安全性 & 学習曲線 \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
C++ & RAII && × & 手動 &&\\
Rust & 所有権 && × & 不可 &&\\
Swift & ARC & × & × & weak &&\\
Java & GC & × & × & 自動 &&\\
Nyash & birth/fini &&& 手動/weak(予定) &&\\
\end{longtable}
\hypertarget{birthfiniux306eux72ecux81eaux6027}{%
\subsubsection{6.2
birth/finiの独自性}\label{birthfiniux306eux72ecux81eaux6027}}
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{完全な対称性}: 誕生と終了が明確なペア
\item
\textbf{直感的メタファー}: プログラマの理解を助ける
\item
\textbf{明示的だが安全}: 参照カウントで自動追跡
\end{enumerate}
Nyashはこれらの中間を狙うZigの明示性とSwiftの安全性の両立。
\hypertarget{ux7d50ux8ad6}{%
\subsection{7. 結論}\label{ux7d50ux8ad6}}
Nyashは「Everything is
Box」とbirth/fini対称性により、シンプルで安全なメモリ管理を実現する新しい言語である。初期評価では、GCなしでも実用的なアプリケーションが記述できることを確認した。
本研究は実現可能性の実証段階であり、以下が今後の課題である: -
大規模アプリケーションでの検証 - 開発パターンの確立 -
ツールエコシステムの構築
しかし、シンプルさを追求した設計は、プログラミング言語の新しい方向性を示唆している。
\hypertarget{ux8b1dux8f9e}{%
\subsection{謝辞}\label{ux8b1dux8f9e}}
本研究は、にゃーという猫の深夜の鳴き声にインスピレーションを得た。
本論文の執筆にあたり、ChatGPT、Claude、Geminiによる校正・推敲支援を受けた。AI時代の研究開発における新しい協働形態の実例として、これを明記する。
\hypertarget{ux53c2ux8003ux6587ux732e}{%
\subsection{参考文献}\label{ux53c2ux8003ux6587ux732e}}
{[}省略{]}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{ux4ed8ux9332ux306aux305cbirthux306aux306eux304b}{%
\subsection{付録なぜ「birth」なのか}\label{ux4ed8ux9332ux306aux305cbirthux306aux306eux304b}}
多くの言語が「constructor」「init」「new」を使う中、なぜ「birth」を選んだのか
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{メタファーの一貫性}: 誕生→生存→終了という自然なライフサイクル
\item
\textbf{感情的つながり}: プログラマがオブジェクトに愛着を持てる
\item
\textbf{記憶しやすさ}: birth/finiは韻を踏んでいて覚えやすい
\end{enumerate}
些細に見えるが、言語設計において名前は本質である。
\end{document}

View File

@ -0,0 +1,20 @@
# Private Papers Index
- Paper A: MIR13 / Core13 IR
- main: papers/paper-a-mir13-ir-design/main-paper-jp.md
- spec: papers/paper-a-mir13-ir-design/MIR13_CORE13_SPEC.md
- artifacts: papers/paper-a-mir13-ir-design/_artifacts/
- Paper B: Nyash 言語と実行モデルLifeBox/birthfini
- main: papers/paper-b-nyash-execution-model/main-paper-jp.md
- artifacts: papers/paper-b-nyash-execution-model/_artifacts/
- figures: papers/paper-b-nyash-execution-model/figures/
- Paper E: LifeBox Model / LoopForm IRLoopSignal
- main: papers/paper-e-loop-signal-ir/main-paper-jp.md
- appendix: papers/paper-e-loop-signal-ir/appendix-rewrites.md, appendix-effects.md
- reviews: papers/paper-e-loop-signal-ir/claude_output.md, gemini_output.md, synthesis.md
Build (Pandoc):
- bash tools/papers/build.sh a-jp # or b-jp / all
- output: docs/private/out/

View File

@ -0,0 +1,10 @@
# papers/active は private に移動しました
ドラフト論文は `docs/private/papers/` 配下に移動しました。
- 論文AMIR13/IR設計: `docs/private/papers/paper-a-mir13-ir-design/`
- 論文BNyash言語と実行モデル: `docs/private/papers/paper-b-nyash-execution-model/`
- 論文ELoopSignal IR 構想): `docs/private/papers/paper-e-loop-signal-ir/`
既存の参照・スクリプトは順次更新予定です。新規作業は private 側でお願いします。

View File

@ -0,0 +1,10 @@
% Minimal Japanese support for Pandoc + LuaLaTeX
\usepackage{luatexja}
\usepackage{luatexja-fontspec}
\setmainjfont{Noto Serif CJK JP}[%
YokoFeatures={JFM=prop}]
\setsansjfont{Noto Sans CJK JP}[%
YokoFeatures={JFM=prop}]
\usepackage{hyperref}
\hypersetup{colorlinks=true,linkcolor=blue,urlcolor=blue}

View File

@ -0,0 +1,88 @@
# MIR13 Core13 Specification (Draft)
本メモは、MIR13Core13命令体系の確定仕様と、将来のLoopFormLoopSignal IRとの整合、およびレガシー命令の廃止方針をまとめる。実装は“Core13既定ON・forbidlegacy”を前提とする。
## 1. Core13 命令一覧(最小・固定)
| 区分 | 命令 | 役割(要点) |
|------|------|---------------|
| 値 | Const | 即値・アドレス等の定数生成(副作用なし) |
| 演算 | BinOp | 加減乗除/ビット演算(純粋) |
| 演算 | Compare | 比較演算(純粋) |
| 制御 | Jump | 無条件遷移(終端) |
| 制御 | Branch | 条件分岐遷移(終端) |
| 制御 | Return | 関数復帰(終端) |
| 形状 | Phi | SSA合流純粋 |
| 呼出 | Call | 直接/間接呼出(ユーザー関数) |
| 呼出 | BoxCall | Boxへのメッセージ呼出配列/フィールド/メソッドの統一) |
| 呼出 | ExternCall | ランタイム/プラグインへの呼出FFI境界 |
| 型 | TypeOp | 型判定・型変換(型関連演算の統合) |
| 実行 | Safepoint | 安全点GC/割込み協調) |
| 実行 | Barrier | 書込/読込バリア等の最小表現 |
注:
- Branch/Jump/Return は終端命令。Phi は構文木上で合流点にのみ出現。
- BoxCall は自由可変長引数receiverメソッド名/操作名args...を標準とし、BoxCallWithは廃止。
## 2. IR規約Invariants
- SSA: すべての値は一度だけ定義。Phiは支配関係に従い配置。
- 終端整合: Blockの末尾は {Return|Jump|Branch} のいずれか1つ。
- 副作用モデル:
- 純粋: Const/BinOp/Compare/Phi
- 効果あり: Call/BoxCall/ExternCall/Safepoint/Barrier効果種別はEffect Maskで注釈可
- Safepoint配置: ループヘッダ/長期待機前/FFI直後などに挿入最小限
- Barrier: write/read バリアはCore13で抽象化し、下位で最適化。
## 3. 高位→Core13 への標準Lowering
- 配列/フィールド/メソッド: すべて BoxCall で統一。
- 例) `a[i]``BoxCall(a, "get", i)`
- 例) `o.name``BoxCall(o, "getField", "name")`
- 例) `o.add(x)``BoxCall(o, "add", x)`
- ランタイム/プラグイン: `ExternCall("iface", "method", args...)` による一貫表現。
- 型操作: `TypeOp(kind, value[, type])`(型判定/変換を単一路に集約)。
- 制御構造: if/loop は Branch/Jump/Phi で表現。
### 3.1 記法方針(表記と内部の二層)
- 表記: 従来の if / while / for / return などの構文を維持(ユーザフレンドリ)。
- 内部: LoopForm IRloop.begin/iter/branch/endに正規化。
- 最終: LoopForm → Core13 へ逆LoweringBranch/Jump/Phi/Return へ落とす)。
これにより、言語表記の自由度とIRの直交性正規形を両立する。
## 4. LoopFormLoopSignal IRとの整合
- LoopForm は“中間正規形”として `loop.begin/iter/branch/end` を導入Core13の上位層
- 逆Lowering: LoopForm → Core13 は以下の基本変換で常時可能:
- `loop.begin` → ヘッダBlock生成Phi配置
- `loop.iter` → 条件/stepコードをヘッダ/ボディに分配
- `loop.branch``switch/Branch` + `Jump`
- `loop.end` → 合流先にReturn/JumpSignal種別に応じる
- Safepoint/Barrier は Core13 層で維持。LoopFormは制御の正規化に専念。
## 5. レガシー命令の廃止マップ
- Load/Store / ArrayGet/ArraySet / RefGet/RefSet / WeakNew/WeakLoad → BoxCall必要時Barrier/Safepoint併用
- TypeCheck/Cast → TypeOp
- PluginInvoke → ExternCall / BoxCallABIに応じて
- Nop/Copy/UnOp 等の補助命令 → 最適化/ビルダ内部に吸収表面APIから排除
## 6. ExternCall の階層化(境界の明示)
- iface例:
- `env.runtime`: ランタイム内部APIcheckpoint等
- `env.gc`: GC操作将来
- `plugin.*`: プラグイン提供のFFI群
- 指針: BoxCallで表現可能な操作は BoxCall を優先抽象度維持。どうしてもhost境界を越える必要がある場合のみ ExternCall。
## 7. 妥当性検査Lint/Verify
- Phi配置の正当性支配木チェック
- 終端命令の整合
- EffectとSafepointの整合長期ループでの安全点確保
- レガシー命令検出forbidlegacy がONであること
## 8. 移行計画(段階導入)
1) フラグ: Core13 既定ON/forbidlegacy を実装側で保証nyash.tomlも同値
2) レガシー→Core13 置換を段階実施(ビルダ/最適化/バックエンドを横断)
3) LoopForm任意を導入し、while/for/scope から正規化→逆LoweringでCore13へ落とす
4) 検証: 既存スイート + 再現ベンチAOT/VM/JIT + Lint で差分監視
---
この文書は“仕様の真実の源泉single source of truth”として、Core13 と上位LoopFormの整合と廃止路線を明示する。実装の進捗に合わせて更新する。

View File

@ -18,8 +18,12 @@ mkdir -p "$RES_DIR"
NYASH_BIN=${NYASH_BIN:-"$ROOT_DIR/target/release/nyash"}
SKIP_INTERP=${SKIP_INTERP:-0} # 1: skip interpreter遅い環境向け
USE_LLVM_AOT=${USE_LLVM_AOT:-0} # 1: LLVM backendでAOTも計測
SKIP_AOT=${SKIP_AOT:-0} # 1: tools/build_aot.sh 経由のAOT計測をスキップ
RUNS=${RUNS:-10} # 計測回数
USE_EXE_ONLY=${USE_EXE_ONLY:-0} # 1: measure AOT exe only
HYPERFINE=$(command -v hyperfine || true)
TIMEOUT_SECS=${TIMEOUT_SECS:-0} # >0 なら各コマンドをtimeoutでラップ
TIMEOUT_BIN=$(command -v timeout || true)
BENCH_DIR="$ROOT_DIR/benchmarks"
FILES=(
@ -30,12 +34,20 @@ FILES=(
"$BENCH_DIR/bench_aot_len_medium.nyash"
"$BENCH_DIR/bench_aot_len_heavy.nyash"
"$ROOT_DIR/examples/aot_min_string_len.nyash"
# Pure arithmetic (no plugins)
"$BENCH_DIR/bench_arith_pure_light.nyash"
"$BENCH_DIR/bench_arith_pure_medium.nyash"
"$BENCH_DIR/bench_arith_pure_heavy.nyash"
)
FILTER_REGEX=${FILTER:-}
echo "[INFO] NYASH_BIN=$NYASH_BIN"
echo "[INFO] USE_EXE_ONLY=$USE_EXE_ONLY (1=EXE only)"
echo "[INFO] hyperfine=${HYPERFINE:-not found}"
echo "[INFO] USE_LLVM_AOT=$USE_LLVM_AOT (1=measure LLVM AOT)"
echo "[INFO] SKIP_AOT=$SKIP_AOT (1=skip AOT via tools/build_aot.sh)"
echo "[INFO] RUNS=$RUNS"
if [[ ! -x "$NYASH_BIN" && "$USE_EXE_ONLY" -eq 0 ]]; then
echo "[INFO] Building nyash (release, with JIT feature)"
@ -54,15 +66,19 @@ fi
run_cmd() {
local cmd="$1" label="$2" csv="$3"
local cmd_wrap="$cmd"
if [[ -n "$TIMEOUT_BIN" && "$TIMEOUT_SECS" -gt 0 ]]; then
cmd_wrap="$TIMEOUT_BIN ${TIMEOUT_SECS}s $cmd"
fi
if [[ -n "$HYPERFINE" ]]; then
# 10 runs, warmup 2, export CSV append
$HYPERFINE -w 2 -r 10 --export-csv "$csv" --show-output --min-runs 10 "$cmd"
# runs configurable, warmup 1, export CSV
$HYPERFINE -w 1 -r "$RUNS" --export-csv "$csv" --show-output "$cmd_wrap"
else
# Simple fallback: run 10 times and record naive timing (ms)
: > "$csv"
for i in {1..10}; do
for i in $(seq 1 "$RUNS"); do
local t0=$(python3 - <<<'import time; print(int(time.time()*1000))')
bash -lc "$cmd" >/dev/null 2>&1 || true
bash -lc "$cmd_wrap" >/dev/null 2>&1 || true
local t1=$(python3 - <<<'import time; print(int(time.time()*1000))')
echo "$label,$((t1-t0))" >> "$csv"
done
@ -71,6 +87,12 @@ run_cmd() {
# Measure modes
for f in "${FILES[@]}"; do
if [[ -n "$FILTER_REGEX" ]]; then
if [[ ! "$f" =~ $FILTER_REGEX ]]; then
echo "[INFO] FILTER: skip $f"
continue
fi
fi
[[ -f "$f" ]] || { echo "[WARN] Skip missing $f"; continue; }
base=$(basename "$f" .nyash)
@ -88,7 +110,7 @@ for f in "${FILES[@]}"; do
fi
# AOT (if tool available)
if [[ $have_build_aot -eq 1 ]]; then
if [[ $have_build_aot -eq 1 && "$SKIP_AOT" -eq 0 ]]; then
out="/tmp/ny_${base}_aot"
bash "$ROOT_DIR/tools/build_aot.sh" "$f" -o "$out" >/dev/null 2>&1 || true
if [[ -x "$out" ]]; then
@ -97,9 +119,13 @@ for f in "${FILES[@]}"; do
else
echo "[WARN] AOT build failed for $f"
fi
else
if [[ "$SKIP_AOT" -eq 1 ]]; then
echo "[INFO] SKIP_AOT=1: skipping AOT for $f"
else
echo "[INFO] AOT tool not found; skipping AOT for $f"
fi
fi
done
# LLVM AOT-only targets (optional)

View File

@ -0,0 +1,41 @@
#!/usr/bin/env python3
import sys, os, csv, statistics
def scan_results(path):
rows = []
for name in sorted(os.listdir(path)):
if not name.endswith('.csv'):
continue
fpath = os.path.join(path, name)
with open(fpath, newline='') as f:
rdr = csv.reader(f)
vals = []
label = None
for r in rdr:
if not r:
continue
label = r[0]
try:
vals.append(float(r[1]))
except Exception:
pass
if label and vals:
rows.append((name, label, len(vals), statistics.median(vals), statistics.mean(vals)))
return rows
def main():
if len(sys.argv) < 2:
print("usage: gen_table.py <results_dir>", file=sys.stderr)
sys.exit(1)
res = scan_results(sys.argv[1])
if not res:
print("no CSVs found", file=sys.stderr)
sys.exit(2)
print("| File | Label | N | Median (ms) | Mean (ms) |")
print("|------|-------|---|-------------:|----------:|")
for name, label, n, med, mean in res:
print(f"| {name} | {label} | {n} | {med:.1f} | {mean:.1f} |")
if __name__ == '__main__':
main()

View File

@ -0,0 +1,3 @@
interp-aot_min_string_len,138
interp-aot_min_string_len,134
interp-aot_min_string_len,138
1 interp-aot_min_string_len 138
2 interp-aot_min_string_len 134
3 interp-aot_min_string_len 138

View File

@ -0,0 +1,3 @@
jit-aot_min_string_len,89
jit-aot_min_string_len,90
jit-aot_min_string_len,89
1 jit-aot_min_string_len 89
2 jit-aot_min_string_len 90
3 jit-aot_min_string_len 89

View File

@ -0,0 +1,3 @@
vm-aot_min_string_len,617
vm-aot_min_string_len,624
vm-aot_min_string_len,674
1 vm-aot_min_string_len 617
2 vm-aot_min_string_len 624
3 vm-aot_min_string_len 674

View File

@ -0,0 +1,10 @@
jit-aot-array_p0,15
jit-aot-array_p0,16
jit-aot-array_p0,15
jit-aot-array_p0,15
jit-aot-array_p0,16
jit-aot-array_p0,16
jit-aot-array_p0,14
jit-aot-array_p0,14
jit-aot-array_p0,14
jit-aot-array_p0,15
1 jit-aot-array_p0 15
2 jit-aot-array_p0 16
3 jit-aot-array_p0 15
4 jit-aot-array_p0 15
5 jit-aot-array_p0 16
6 jit-aot-array_p0 16
7 jit-aot-array_p0 14
8 jit-aot-array_p0 14
9 jit-aot-array_p0 14
10 jit-aot-array_p0 15

View File

@ -0,0 +1 @@
interp-bench_aot_len_heavy,29036
1 interp-bench_aot_len_heavy 29036

View File

@ -0,0 +1,3 @@
jit-bench_aot_len_heavy,79
jit-bench_aot_len_heavy,80
jit-bench_aot_len_heavy,80
1 jit-bench_aot_len_heavy 79
2 jit-bench_aot_len_heavy 80
3 jit-bench_aot_len_heavy 80

View File

@ -0,0 +1,3 @@
vm-bench_aot_len_heavy,1173
vm-bench_aot_len_heavy,1148
vm-bench_aot_len_heavy,1181
1 vm-bench_aot_len_heavy 1173
2 vm-bench_aot_len_heavy 1148
3 vm-bench_aot_len_heavy 1181

View File

@ -0,0 +1 @@
interp-bench_aot_len_light,7107
1 interp-bench_aot_len_light 7107

View File

@ -0,0 +1,3 @@
jit-bench_aot_len_light,81
jit-bench_aot_len_light,82
jit-bench_aot_len_light,82
1 jit-bench_aot_len_light 81
2 jit-bench_aot_len_light 82
3 jit-bench_aot_len_light 82

View File

@ -0,0 +1,3 @@
vm-bench_aot_len_light,727
vm-bench_aot_len_light,720
vm-bench_aot_len_light,708
1 vm-bench_aot_len_light 727
2 vm-bench_aot_len_light 720
3 vm-bench_aot_len_light 708

View File

@ -0,0 +1 @@
interp-bench_aot_len_medium,28965
1 interp-bench_aot_len_medium 28965

View File

@ -0,0 +1,3 @@
jit-bench_aot_len_medium,82
jit-bench_aot_len_medium,82
jit-bench_aot_len_medium,81
1 jit-bench_aot_len_medium 82
2 jit-bench_aot_len_medium 82
3 jit-bench_aot_len_medium 81

View File

@ -0,0 +1,3 @@
vm-bench_aot_len_medium,808
vm-bench_aot_len_medium,749
vm-bench_aot_len_medium,740
1 vm-bench_aot_len_medium 808
2 vm-bench_aot_len_medium 749
3 vm-bench_aot_len_medium 740

View File

@ -0,0 +1,3 @@
jit-bench_arith_pure_heavy,89
jit-bench_arith_pure_heavy,91
jit-bench_arith_pure_heavy,89
1 jit-bench_arith_pure_heavy 89
2 jit-bench_arith_pure_heavy 91
3 jit-bench_arith_pure_heavy 89

View File

@ -0,0 +1,3 @@
vm-bench_arith_pure_heavy,19
vm-bench_arith_pure_heavy,19
vm-bench_arith_pure_heavy,21
1 vm-bench_arith_pure_heavy 19
2 vm-bench_arith_pure_heavy 19
3 vm-bench_arith_pure_heavy 21

View File

@ -0,0 +1,3 @@
interp-bench_arith_pure_light,1840199
interp-bench_arith_pure_light,1854295
interp-bench_arith_pure_light,1857949
1 interp-bench_arith_pure_light 1840199
2 interp-bench_arith_pure_light 1854295
3 interp-bench_arith_pure_light 1857949

View File

@ -0,0 +1,3 @@
jit-bench_arith_pure_light,183
jit-bench_arith_pure_light,185
jit-bench_arith_pure_light,184
1 jit-bench_arith_pure_light 183
2 jit-bench_arith_pure_light 185
3 jit-bench_arith_pure_light 184

View File

@ -0,0 +1,3 @@
vm-bench_arith_pure_light,183
vm-bench_arith_pure_light,184
vm-bench_arith_pure_light,185
1 vm-bench_arith_pure_light 183
2 vm-bench_arith_pure_light 184
3 vm-bench_arith_pure_light 185

View File

@ -0,0 +1,3 @@
jit-bench_arith_pure_medium,93
jit-bench_arith_pure_medium,91
jit-bench_arith_pure_medium,89
1 jit-bench_arith_pure_medium 93
2 jit-bench_arith_pure_medium 91
3 jit-bench_arith_pure_medium 89

View File

@ -0,0 +1,3 @@
vm-bench_arith_pure_medium,21
vm-bench_arith_pure_medium,22
vm-bench_arith_pure_medium,20
1 vm-bench_arith_pure_medium 21
2 vm-bench_arith_pure_medium 22
3 vm-bench_arith_pure_medium 20

View File

@ -0,0 +1,3 @@
jit-bench_heavy,178
jit-bench_heavy,176
jit-bench_heavy,176
1 jit-bench_heavy 178
2 jit-bench_heavy 176
3 jit-bench_heavy 176

View File

@ -0,0 +1,3 @@
vm-bench_heavy,178
vm-bench_heavy,177
vm-bench_heavy,178
1 vm-bench_heavy 178
2 vm-bench_heavy 177
3 vm-bench_heavy 178

View File

@ -0,0 +1,3 @@
interp-bench_light,166
interp-bench_light,165
interp-bench_light,164
1 interp-bench_light 166
2 interp-bench_light 165
3 interp-bench_light 164

View File

@ -0,0 +1,3 @@
jit-bench_light,182
jit-bench_light,160
jit-bench_light,159
1 jit-bench_light 182
2 jit-bench_light 160
3 jit-bench_light 159

Some files were not shown because too many files have changed in this diff Show More