DEV Community

Crackanimador
Crackanimador

Posted on

Why I built a Bilingual Programming Language in Rust (from high-level Web to x86 Kernels)

The Motivation: Technological Sovereignty
Most modern languages rely on a mountain of dependencies. As a student, I wanted to build something different: a "sovereign" language. I wanted a single native binary that could do everything out of the box.

That’s how Mesa-LP was born. It started in Python, but for version 4.0.0, I decided to take the final leap: A full rewrite in Rust.

**
Why the rewrite?
**

  • Moving from Python to Rust wasn't just about speed (though it’s incredibly fast now). It was about:
  • Zero Dependencies: No more pip or npm. Everything is baked into the binary.
  • Memory Safety: Leveraging Rust's borrow checker to build a robust engine.
  • Native Power: Implementing a real HTTP server using TcpListener and a toolkit for x86 assembly.

A Bilingual AST
One of Mesa's core features is native bilingualism. It’s not a wrapper; the Lexer and Parser handle English and Spanish with total parity.

Whether you write say() or decir(), the AST treats them as the same. This makes programming more accessible to the Spanish-speaking community without losing the "standard" feel of English coding.

Show me the code!
Mesa-LP is a multi-level language. You can build a web server or a bootsector.

Fragmento de código
-- High-level: A simple web server
page("Mesa World", "dark")
navbar("Mesa", [["Home", "/"], ["Docs", "/docs"]])
title("Welcome to the Future")
serve_web(8080)

-- Or low-level: x86 Assembly
asm = x86_new()
start_boot(asm)
video_mode(asm, 0x13)
point(asm, 0x7C00, "Hello from Native MesaOS")
Enter fullscreen mode Exit fullscreen mode

The "Goat" 🐐 Factor
Mesa v4.0.0 now includes:

  • Native Engine: 100% Rust.
  • Built-in Packages: A system to create and share modules.
  • Standard Library: +200 native functions for Crypto, SQLite, and JSON.

Personal Note
I’m still in school and learning every day. I used AI as a "co-pilot" (This doesn't mean I did all the AI; I spent three whole months on the project, having to correct everything, so I see myself more as the architect.) to bridge the gap in my Rust knowledge during this rewrite. My next goal? Self-hosting: Writing the Mesa compiler in Mesa.

I’d love to get your feedback on the architecture!

Check out the Repo here: https://github.com/crackanimad0r/Mesa-LP

Top comments (0)