feat: Phase 2.4 レガシーアーカイブ整理完了(151MB削減)

## 🎉 完了項目
-  plugin_box_legacy.rs削除(7.7KB、参照ゼロ確認済み)
-  REMOVEDコメント整理(encode.rs簡潔化)
-  venv削除(143MB節約、.gitignoreは既存)
-  llvm_legacyスタブ化(8KB、compile_error!による安全化)

## 🏆 成果
- **リポジトリサイズ改善**: 151MB削減
- **コード整理**: レガシーコード安全にアーカイブ
- **プラグインファースト**: StrictPluginFirst継続動作

##  検証完了
- cargo build --release --features llvm (警告のみ、エラーなし)
- LLVMハーネス実行: print出力正常
- プラグイン動作: StringBox等正常動作

codex先生の戦略に従った安全な段階的削除を実行

Co-Authored-By: codex <noreply@anthropic.com>
This commit is contained in:
Selfhosting Dev
2025-09-24 14:13:15 +09:00
parent f4fe548787
commit f0608e9bb1
42 changed files with 682 additions and 536 deletions

View File

@ -45,8 +45,26 @@ def lower_externcall(
bb_map = ctx.bb_map
except Exception:
pass
# Normalize extern target names
# Accept full symbol names (e.g., "nyash.console.log", "nyash.string.len_h").
# Also accept legacy/environment names and map them to kernel exports.
llvm_name = func_name
try:
if func_name.startswith("env.console."):
# Map env.console.* → nyash.console.* (kernel exports)
method = func_name.split(".")[-1]
# println maps to log for now
if method == "println":
method = "log"
llvm_name = f"nyash.console.{method}"
elif func_name == "println" or func_name == "print":
# Bare println/print fallback
llvm_name = "nyash.console.log"
elif func_name.startswith("nyash.console.") and func_name.endswith("println"):
# Normalize nyash.console.println → nyash.console.log
llvm_name = "nyash.console.log"
except Exception:
pass
i8 = ir.IntType(8)
i64 = ir.IntType(64)
@ -161,7 +179,8 @@ def lower_externcall(
except Exception:
pass
else:
aval = ir.Constant(expected_ty, None)
# used_string_h2p was true: keep the resolved pointer (do not null it)
pass
elif isinstance(expected_ty, ir.IntType) and expected_ty.width == 64:
# Need i64
if hasattr(aval, 'type'):