✨ 修正内容: • pkg/nyash_rust.js - WebAssembly JSバインディング • pkg/nyash_rust_bg.wasm - コンパイル済みWASM実行ファイル • TypeScript型定義ファイル 🎯 これでブラウザーでNyashが正常動作します! GitHub Pages完全対応完了
🐱 Nyash Programming Language
Everything is Box - Revolutionary Programming Language
✨ Key Features
- Everything is Box Philosophy: Every value is a unified Box object
- WebAssembly Ready: Run natively in browsers with zero setup
- Web Integration: Control HTML5 Canvas, DOM elements directly from code
- Self-Hosting: Written in itself using revolutionary Box architecture
- Modern Syntax: Clean, expressive syntax with powerful abstractions
🚀 Quick Start
Try in Browser (No Installation Required!)
Open Nyash Playground in your browser and start coding immediately!
Local Development
# Clone the repository
git clone https://github.com/user/nyash.git
cd nyash
# Build with Cargo
cargo build --release
# Run your first program
./target/release/nyash examples/hello_world.nyash
💡 Philosophy: Everything is Box
Nyash revolutionizes programming by treating everything as a Box:
// Traditional languages: different types, complex syntax
// Nyash: unified Box approach
greeting = new StringBox("Hello!") // Text is a Box
number = new IntegerBox(42) // Numbers are Boxes
display = new WebDisplayBox("output") // Even web elements are Boxes!
// Everything works the same way
display.print(greeting.toString())
display.print("The answer is: " + number)
🎮 Examples
Hello World
print("🐱 Hello, Nyash World!")
greeting = new StringBox("Welcome to Everything is Box!")
print(greeting.toString())
Web Canvas Graphics
canvas = new WebCanvasBox("my-canvas", 400, 300)
canvas.setFillStyle("red")
canvas.fillRect(50, 50, 100, 75)
canvas.fillText("Nyash WebCanvas", 150, 200)
Game of Life (Conway)
game = new GameOfLifeBox(50, 30)
game.randomize()
loop (game.generation < 100) {
game.step()
game.display()
}
📚 Documentation
- Getting Started - Your first steps with Nyash
- Language Guide - Complete language reference
- Technical Architecture - Deep dive into Box philosophy
- Philosophy - Everything is Box explained
🌐 Web Integration
Nyash provides seamless browser integration:
// Control web page elements directly
display = new WebDisplayBox("output")
display.setHTML("<h1>Generated by Nyash!</h1>")
// Draw on HTML5 Canvas
canvas = new WebCanvasBox("graphics", 800, 600)
canvas.drawScene()
// Interactive web apps in pure Nyash
button = new WebButtonBox("click-me")
button.onClick = new MethodBox(app, "handleClick")
🎯 Sample Projects
Explore our curated examples:
- Hello World - Basic syntax and philosophy
- Simple Calculator - Math operations with Boxes
- Conway's Game of Life - Complex algorithms made simple
- 2048 Game - Complete game implementation
- Dice RPG - Turn-based battle system
- Maze Generator - Procedural generation
- Web Canvas Demo - HTML5 Canvas control
- Web Display Demo - DOM manipulation
- Text Adventure - Multi-file project structure
- Lisp Interpreter - Meta-programming capabilities
⚡ Performance & Architecture
- Rust Backend: High-performance native execution
- WebAssembly Target: Zero-overhead browser deployment
- Box Unification: Simplified memory model, optimized for speed
- Self-Hosting: Bootstrap compiler written in Nyash itself
🛠 Building from Source
Prerequisites
- Rust 1.70+
- wasm-pack (for WebAssembly builds)
Commands
# Native build
cargo build --release
# WebAssembly build
wasm-pack build --target web --out-dir projects/nyash-wasm/pkg
# Run tests
cargo test
# Generate documentation
cargo doc --open
🤝 Contributing
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Add your changes and tests
- Ensure all tests pass (
cargo test) - Commit your changes (
git commit -m 'Add amazing feature') - Push to your branch (
git push origin feature/amazing-feature) - Open a Pull Request
See our Contributing Guidelines for detailed information.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🌟 Why Nyash?
- Unified Philosophy: No more juggling different types and paradigms
- Web-First: Built for the modern web development ecosystem
- Self-Documenting: Everything is Box makes code naturally readable
- Performance: Rust backend ensures native-level speed
- Innovation: Revolutionary approach to programming language design
Everything is Box. Everything is Simple. Everything is Nyash. 🐱