Files
hakorune/docs/papers/archive/mir15-fullstack/chapters/01-introduction.md
Moe Charm e2e25f6615 論文フォルダ整理: 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に移動
2025-09-03 03:06:24 +09:00

3.6 KiB

Chapter 1: Introduction

The 15-Instruction Revolution

Imagine building a full-featured GUI application that runs on both Ubuntu and Windows using a programming language with only 15 intermediate representation (IR) instructions. This is not a thought experiment—we have done it with Nyash.

Why This Matters

Modern programming languages and their virtual machines have grown increasingly complex:

  • LLVM IR: ~500 instructions
  • JVM bytecode: ~200 instructions
  • WebAssembly: ~150 instructions
  • Lua VM: ~50 instructions

This complexity is justified by performance optimization, feature richness, and historical evolution. Yet, we must ask: Is this complexity truly necessary?

The Nyash Approach

Nyash takes a radically different approach based on a simple philosophy: "Everything is Box". Instead of adding specialized instructions for each feature, we:

  1. Define 15 atomic operations (MIR15)
  2. Encapsulate all complexity within Box abstractions
  3. Let composition handle the rest

The result? A language that can:

  • Run GUI applications on multiple operating systems
  • Support concurrent programming with async/await
  • Integrate with native plugins seamlessly
  • Compile to native executables via JIT/AOT
  • Target WebAssembly for browser deployment

All with just 15 instructions.

Contributions

This paper makes the following contributions:

  1. The Box Theory: A mathematical foundation showing how minimal atomic operations can compose into arbitrary complexity through systematic abstraction.

  2. MIR15 Design: The first practical IR with only 15 instructions that supports full-stack development, including GUI applications.

  3. Implementation Proof: A complete implementation including VM interpreter, JIT compiler, AOT compiler, and WebAssembly backend—all in 30 days with ~4,000 lines of code.

  4. Empirical Validation: Demonstration of real GUI applications running on Ubuntu and Windows, with performance comparable to languages with 10x more instructions.

  5. Paradigm Shift: Evidence that language complexity is a choice, not a necessity, opening new possibilities for language design, implementation, and education.

Paper Organization

The remainder of this paper is organized as follows:

  • Chapter 2 presents the Box Theory, our theoretical foundation for achieving complexity through composition rather than instruction proliferation.

  • Chapter 3 details the MIR15 design, explaining our process of reducing 26 instructions to 15 while maintaining full functionality.

  • Chapter 4 describes our implementation, including the unified architecture that enables four different backends to share the same minimal IR.

  • Chapter 5 evaluates our approach through GUI demonstrations, performance benchmarks, and instruction coverage analysis.

  • Chapter 6 discusses the implications of our findings and why this approach succeeds where conventional wisdom suggests it should fail.

  • Chapter 7 compares our work with related systems, highlighting the unique aspects of our minimalist approach.

  • Chapter 8 concludes with reflections on the future of minimal language design.

A Note on Simplicity

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
— Antoine de Saint-Exupéry

Nyash embodies this principle. By removing rather than adding, we have discovered that less truly can be more—not just philosophically, but practically. The GUI application running on your screen with 15 instructions is not a limitation overcome, but a validation of simplicity as a first-class design principle.

Welcome to the minimal instruction revolution.