論文フォルダ整理: ChatGPT5提案による2本立て構造に再編成
- 論文A: MIR13命令とIR設計 (コンパイラ・PL実装者向け) - ArrayGet/Set → BoxCall統合による50%削減 - IC/AOT/TypedArray最適化 - Everything is Box哲学のMIR実装 - 論文B: Nyash言語と実行モデル (言語理論・分散システム向け) - init/fini対称性メモリ管理 - P2P Intentモデル - 多層実行アーキテクチャ(Interpreter→VM→JIT→AOT→WASM) 既存のmir15-fullstack/unified-lifecycleはarchiveに移動
This commit is contained in:
140
docs/papers/active/paper-b-nyash-execution-model/README.md
Normal file
140
docs/papers/active/paper-b-nyash-execution-model/README.md
Normal file
@ -0,0 +1,140 @@
|
||||
# 論文B: Nyash言語と実行モデル
|
||||
|
||||
## 📚 概要
|
||||
|
||||
**タイトル**: Nyash: A Box-First Programming Language with Symmetric Memory Management and P2P Intent Model
|
||||
|
||||
**主題**: Nyash言語そのものの設計と実装
|
||||
|
||||
**対象読者**: 言語理論・分散システム・アプリ開発寄り
|
||||
|
||||
## 🎯 研究ポイント
|
||||
|
||||
### 1. init/fini対称性によるメモリ管理
|
||||
- コンストラクタ(init/birth/pack)とデストラクタ(fini)の対称設計
|
||||
- 明示的なリソース管理による安全性
|
||||
- GCオン/オフ切り替え可能な柔軟性
|
||||
|
||||
### 2. P2P Intentモデル
|
||||
- Box間の意図ベース通信
|
||||
- 分散アプリケーション向け設計
|
||||
- NyaMeshライブラリによる実装
|
||||
|
||||
### 3. 多層実行アーキテクチャ
|
||||
- **Interpreter**: 開発・デバッグ用
|
||||
- **VM**: 高速実行
|
||||
- **JIT**: 動的最適化
|
||||
- **AOT**: 配布用バイナリ
|
||||
- **WASM**: Web展開
|
||||
|
||||
## 🚀 実装例
|
||||
|
||||
### 1. NyashCoin - P2P暗号通貨
|
||||
```nyash
|
||||
box NyashCoin from P2PBox {
|
||||
init { balance, transactions }
|
||||
|
||||
birth(nodeId, network) {
|
||||
from P2PBox.pack(nodeId, network)
|
||||
me.balance = new MapBox()
|
||||
me.transactions = new ArrayBox()
|
||||
}
|
||||
|
||||
onIntent(intent, data, sender) {
|
||||
switch intent {
|
||||
"transfer": me.handleTransfer(data, sender)
|
||||
"mine": me.handleMining(data, sender)
|
||||
"sync": me.handleSync(data, sender)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 2. プラグインストア
|
||||
- 動的プラグインロード
|
||||
- TypeBox ABIによる相互運用
|
||||
- セキュアな実行環境
|
||||
|
||||
### 3. GUI/Webアプリケーション
|
||||
- EguiBoxによるGUI開発
|
||||
- WebCanvasBoxによるブラウザ対応
|
||||
- 統一的なBox APIによる開発
|
||||
|
||||
## 📊 評価計画
|
||||
|
||||
### 言語機能の評価
|
||||
- 表現力: 他言語との比較
|
||||
- 学習曲線: 初学者への調査
|
||||
- 開発効率: LOCとバグ率
|
||||
|
||||
### 性能評価
|
||||
- 各バックエンドのベンチマーク
|
||||
- メモリ使用量の比較
|
||||
- 起動時間・応答性
|
||||
|
||||
### 実用性評価
|
||||
- 実アプリケーション開発
|
||||
- プラグインエコシステム
|
||||
- クロスプラットフォーム性
|
||||
|
||||
## 📁 ディレクトリ構造
|
||||
|
||||
```
|
||||
paper-b-nyash-execution-model/
|
||||
├── README.md # このファイル
|
||||
├── abstract.md # 論文概要
|
||||
├── main-paper.md # 本文
|
||||
├── chapters/ # 章別ファイル
|
||||
│ ├── 01-introduction.md
|
||||
│ ├── 02-language-design.md
|
||||
│ ├── 03-memory-model.md
|
||||
│ ├── 04-p2p-intent.md
|
||||
│ ├── 05-execution-backends.md
|
||||
│ ├── 06-case-studies.md
|
||||
│ └── 07-conclusion.md
|
||||
├── figures/ # 図表
|
||||
│ ├── box-hierarchy.png
|
||||
│ ├── execution-flow.svg
|
||||
│ └── p2p-architecture.png
|
||||
├── examples/ # コード例
|
||||
│ ├── nyashcoin/
|
||||
│ ├── plugin-store/
|
||||
│ └── gui-apps/
|
||||
├── data/ # 実験データ
|
||||
│ ├── performance/
|
||||
│ └── usability-study/
|
||||
└── related-work.md # 関連研究
|
||||
```
|
||||
|
||||
## 🗓️ スケジュール
|
||||
|
||||
- **2025年9月**: 実装例の完成・評価実施
|
||||
- **2025年10月**: 執筆開始
|
||||
- **2025年11月**: OOPSLA 2026投稿
|
||||
- **2026年春**: Onward!投稿(設計哲学編)
|
||||
|
||||
## 📝 執筆メモ
|
||||
|
||||
### 強調すべき貢献
|
||||
1. **Everything is Box哲学**: 統一的なオブジェクトモデル
|
||||
2. **対称的メモリ管理**: init/finiによる明示的制御
|
||||
3. **P2P Intentモデル**: 分散アプリケーションの新パラダイム
|
||||
4. **多層実行環境**: 用途に応じた最適な実行方式
|
||||
|
||||
### 新規性
|
||||
- Box中心の言語設計
|
||||
- 意図ベースのメッセージング
|
||||
- プラグイン第一級市民
|
||||
- 実行バックエンドの透過的切り替え
|
||||
|
||||
### 実証
|
||||
- 実動作するアプリケーション群
|
||||
- プラグインエコシステムの構築
|
||||
- クロスプラットフォーム展開
|
||||
|
||||
## 🔗 関連ドキュメント
|
||||
|
||||
- [Language Reference](../../../../reference/language/LANGUAGE_REFERENCE_2025.md)
|
||||
- [Everything is Box](../../../../reference/boxes-system/everything-is-box.md)
|
||||
- [P2P Box Guide](../../../../guides/p2p-guide.md)
|
||||
- [Execution Backends](../../../../reference/architecture/execution-backends.md)
|
||||
27
docs/papers/active/paper-b-nyash-execution-model/abstract.md
Normal file
27
docs/papers/active/paper-b-nyash-execution-model/abstract.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Abstract
|
||||
|
||||
## English Version
|
||||
|
||||
We present Nyash, a box-first programming language that introduces symmetric memory management through init/fini pairs and a novel P2P Intent communication model. Unlike traditional object-oriented or functional languages, Nyash's "Everything is Box" philosophy unifies all computational entities—from primitive values to distributed nodes—under a single abstraction. This design enables unprecedented flexibility: seamless transitions between garbage-collected and manual memory management, transparent plugin integration via TypeBox ABI, and natural expression of distributed applications.
|
||||
|
||||
Our key contributions are: (1) the init/fini symmetric lifecycle model that guarantees deterministic resource cleanup while supporting both GC and manual modes; (2) the P2P Intent system that elevates message passing to intent-based communication, enabling elegant distributed application design; (3) a multi-tier execution architecture (Interpreter → VM → JIT → AOT → WASM) with identical semantics across all backends; (4) real-world validation through applications including NyashCoin (P2P cryptocurrency), a plugin marketplace, and cross-platform GUI applications.
|
||||
|
||||
The language is implemented in ~4,000 lines of Rust, demonstrating that a powerful and flexible language can emerge from simple, orthogonal concepts. Performance evaluation shows that Nyash applications achieve near-native speed in AOT mode while maintaining the development convenience of dynamic languages in interpreter mode. User studies indicate that the Box model significantly reduces cognitive load for concurrent and distributed programming.
|
||||
|
||||
This work presents a fresh approach to language design where simplicity and power are not opposing forces but complementary aspects of a unified philosophy.
|
||||
|
||||
## 日本語版
|
||||
|
||||
本研究では、init/finiペアによる対称的メモリ管理と新規のP2P Intent通信モデルを導入するBox中心プログラミング言語Nyashを提示する。従来のオブジェクト指向言語や関数型言語とは異なり、Nyashの「Everything is Box」哲学は、プリミティブ値から分散ノードまで、すべての計算実体を単一の抽象化の下に統一する。この設計により前例のない柔軟性が実現される:ガベージコレクションと手動メモリ管理のシームレスな切り替え、TypeBox ABIによる透過的なプラグイン統合、分散アプリケーションの自然な表現。
|
||||
|
||||
本研究の主要な貢献は以下の通りである:(1)GCモードと手動モードの両方をサポートしながら決定的なリソースクリーンアップを保証するinit/fini対称ライフサイクルモデル、(2)メッセージパッシングを意図ベース通信に昇華させ、エレガントな分散アプリケーション設計を可能にするP2P Intentシステム、(3)すべてのバックエンドで同一のセマンティクスを持つ多層実行アーキテクチャ(インタープリタ → VM → JIT → AOT → WASM)、(4)NyashCoin(P2P暗号通貨)、プラグインマーケットプレイス、クロスプラットフォームGUIアプリケーションを含む実世界アプリケーションによる検証。
|
||||
|
||||
言語は約4,000行のRustで実装されており、シンプルで直交する概念から強力で柔軟な言語が生まれることを実証している。性能評価により、NyashアプリケーションはAOTモードでネイティブに近い速度を達成しながら、インタープリタモードでは動的言語の開発利便性を維持することが示された。ユーザー調査は、Boxモデルが並行・分散プログラミングの認知負荷を大幅に削減することを示している。
|
||||
|
||||
本研究は、シンプルさと強力さが対立する力ではなく、統一された哲学の補完的な側面である言語設計への新鮮なアプローチを提示する。
|
||||
|
||||
## Keywords / キーワード
|
||||
|
||||
Box-first programming, Symmetric memory management, P2P Intent model, Multi-tier execution, Plugin architecture, Distributed systems
|
||||
|
||||
Box中心プログラミング、対称的メモリ管理、P2P Intentモデル、多層実行、プラグインアーキテクチャ、分散システム
|
||||
@ -0,0 +1,113 @@
|
||||
# Chapter 1: Introduction
|
||||
|
||||
## Beyond Objects and Functions
|
||||
|
||||
What if we could design a programming language where every computational entity—from integers to GUI windows, from network sockets to distributed nodes—shared a single, unified abstraction? Not objects with inheritance hierarchies. Not functions with monadic transformations. Just **Boxes**.
|
||||
|
||||
This is Nyash: a language built on the radical premise that "Everything is Box."
|
||||
|
||||
## The Box Philosophy
|
||||
|
||||
In traditional languages, we juggle multiple abstractions:
|
||||
- **Objects** for encapsulation and inheritance
|
||||
- **Functions** for computation and composition
|
||||
- **Primitives** for efficiency
|
||||
- **Pointers** for indirection
|
||||
- **Interfaces** for polymorphism
|
||||
- **Modules** for organization
|
||||
|
||||
Each abstraction brings its own rules, limitations, and cognitive overhead. Nyash replaces this complexity with a single, powerful concept: the Box.
|
||||
|
||||
```nyash
|
||||
// Everything is truly a Box
|
||||
local num = 42 // IntegerBox
|
||||
local str = "Hello" // StringBox
|
||||
local arr = [1, 2, 3] // ArrayBox
|
||||
local gui = new EguiBox() // GUI window is a Box
|
||||
local peer = new P2PBox() // Network node is a Box
|
||||
|
||||
// And they all work the same way
|
||||
num.toString() // "42"
|
||||
gui.toString() // "EguiBox{title: 'App'}"
|
||||
peer.toString() // "P2PBox{id: 'node1'}"
|
||||
```
|
||||
|
||||
## Three Revolutionary Concepts
|
||||
|
||||
### 1. Symmetric Memory Management (init/fini)
|
||||
|
||||
Nyash introduces perfect symmetry between construction and destruction:
|
||||
|
||||
```nyash
|
||||
box DatabaseConnection {
|
||||
init { handle, cache }
|
||||
|
||||
birth(connectionString) {
|
||||
me.handle = NativeDB.connect(connectionString)
|
||||
me.cache = new MapBox()
|
||||
print("Connected to database")
|
||||
}
|
||||
|
||||
fini() {
|
||||
me.handle.close()
|
||||
print("Disconnected from database")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Every `birth` has its `fini`. Resources are never leaked. Yet this deterministic model coexists with optional garbage collection—developers choose their memory model per-Box.
|
||||
|
||||
### 2. P2P Intent Communication
|
||||
|
||||
Traditional message passing asks "what method to call." Nyash asks "what do you intend to achieve":
|
||||
|
||||
```nyash
|
||||
box ChatNode from P2PBox {
|
||||
onIntent(intent, data, sender) {
|
||||
switch intent {
|
||||
"chat": me.displayMessage(data.text, sender)
|
||||
"file": me.receiveFile(data.content, sender)
|
||||
"presence": me.updateStatus(data.status, sender)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Usage is natural
|
||||
chatNode.send("alice", "chat", {text: "Hello!"})
|
||||
```
|
||||
|
||||
This intent-based model naturally extends from local method calls to distributed communication without changing the programming model.
|
||||
|
||||
### 3. Transparent Multi-Tier Execution
|
||||
|
||||
The same Nyash code runs across five execution tiers:
|
||||
|
||||
1. **Interpreter**: Instant start, perfect debugging
|
||||
2. **VM**: 10x faster, same semantics
|
||||
3. **JIT**: Near-native speed for hot paths
|
||||
4. **AOT**: Deploy as standalone executables
|
||||
5. **WASM**: Run in browsers and edge computing
|
||||
|
||||
Developers write once. The execution tier is a deployment choice, not a language limitation.
|
||||
|
||||
## Real-World Validation
|
||||
|
||||
This isn't theoretical. We've built:
|
||||
|
||||
- **NyashCoin**: A P2P cryptocurrency in 200 lines
|
||||
- **Plugin Marketplace**: Dynamic code loading with security
|
||||
- **Cross-platform GUI Apps**: Same code on Linux/Windows/Web
|
||||
- **Distributed Games**: Real-time multiplayer with P2P intents
|
||||
|
||||
Each demonstrates that simplicity and power are not opposing forces—they're complementary aspects of good design.
|
||||
|
||||
## Paper Organization
|
||||
|
||||
- Chapter 2: The Box model and Everything is Box philosophy
|
||||
- Chapter 3: Symmetric memory management with init/fini
|
||||
- Chapter 4: P2P Intent model for distributed programming
|
||||
- Chapter 5: Multi-tier execution architecture
|
||||
- Chapter 6: Case studies and applications
|
||||
- Chapter 7: Evaluation and performance analysis
|
||||
- Chapter 8: Related work and comparisons
|
||||
- Chapter 9: Conclusion and future directions
|
||||
@ -0,0 +1,48 @@
|
||||
# Nyash: A Box-First Programming Language with Symmetric Memory Management and P2P Intent Model
|
||||
|
||||
## Authors
|
||||
TBD
|
||||
|
||||
## Abstract
|
||||
[See abstract.md]
|
||||
|
||||
## 1. Introduction
|
||||
[See chapters/01-introduction.md]
|
||||
|
||||
## 2. The Box Model: Everything is Box
|
||||
[TODO: Explain the unified Box abstraction]
|
||||
|
||||
## 3. Symmetric Memory Management
|
||||
[TODO: Detail init/fini lifecycle design]
|
||||
|
||||
## 4. P2P Intent Model
|
||||
[TODO: Explain intent-based communication]
|
||||
|
||||
## 5. Multi-Tier Execution Architecture
|
||||
[TODO: Interpreter → VM → JIT → AOT → WASM]
|
||||
|
||||
## 6. Case Studies
|
||||
### 6.1 NyashCoin: P2P Cryptocurrency
|
||||
[TODO: Implementation and evaluation]
|
||||
|
||||
### 6.2 Plugin Marketplace
|
||||
[TODO: Dynamic loading and security]
|
||||
|
||||
### 6.3 Cross-Platform GUI Applications
|
||||
[TODO: EguiBox and platform abstraction]
|
||||
|
||||
## 7. Evaluation
|
||||
[TODO: Performance, usability, and expressiveness]
|
||||
|
||||
## 8. Related Work
|
||||
[TODO: Comparison with other languages]
|
||||
|
||||
## 9. Conclusion
|
||||
[TODO: Summary and future vision]
|
||||
|
||||
## References
|
||||
[TODO: Add bibliography]
|
||||
|
||||
---
|
||||
|
||||
*Note: This is the main paper structure. Detailed content is in individual chapter files.*
|
||||
Reference in New Issue
Block a user