DEV Community

CharmPic
CharmPic

Posted on

Making the Programming Language "Nyash" with an AI Partner

I'm creating a language called Nyash based on the "Everything is Box" philosophy.
https://github.com/moe-charm/nyash

Recently, I ran into a terrifying bug...

server = new SocketBox()
server.bind("127.0.0.1", 8080) // ✅ Success
server.isServer() // ❌ false !?!?

Why did the state disappear? The cause was a Rust double-locking hell.

What Was Happening

The design I created with AIs (Claude/Copilot) as a complete Rust beginner:
Rust

// Interpreter side (outer lock)
Arc>

// Inside SocketBox (inner lock)
struct SocketBox {
is_server: Arc>, // Another lock!
}

This led to a double-locking hell, causing a deadlock and state inconsistency.

Saved by Gemini-sensei

Gemini-sensei diagnosed it instantly as a "duplication of responsibility."

Solution:

Inside Box: Arc<Mutex> is completely forbidden

Interpreter: Centralized lock management
Enter fullscreen mode Exit fullscreen mode

Rust

// New design
struct SocketBox {
is_server: bool, // Simple!
}

Lessons Learned

AI writes correct code, but architectural decisions are up to the human.

The danger of not having enough language knowledge to properly evaluate AI's output.

The power of multiple AIs (Claude for design, Copilot for implementation, Gemini for diagnosis).
Enter fullscreen mode Exit fullscreen mode

Future of the Everything is Box Language

Currently, I'm overhauling 15 Box types in Phase 9.75...

Top comments (0)