What started as a deep-dive challenge into the mechanics of computer science ended up as a fully functional, lightweight interpreted language.
I want to introduce Pampa, a native, custom interpreted programming language written entirely in Go with zero external dependencies.
Most of us use high-level frameworks every day, but building an interpreter from scratch forces you to look under the hood and deal directly with state management, AST evaluation, and memory mapping.
Why did I build it this way?
Zero Overhead: It compiles down into a single native binary.
Turing-Complete: Supports standard linear arithmetic, variable bindings, if conditionals, and structured loop execution (while / for).
Clean Codebase: The core engine evaluates nodes dynamically, separating the evaluation logic from the user's script workspace.
The Syntax in Action:
Fragmento de cรณdigo
// Welcome to Pampa Language!
nombre = "Pampa Core"
print "Running {nombre}..."
// Loops & State Management
limite = 5
factorial = 1
i = 1
while i <= limite {
factorial = factorial * i
i = i + 1
}
print "Factorial result: {factorial}"
if factorial == 120 {
print "STATUS: Mathematical validation correct!"
}
Building this engine taught me a ton about preventing state leaks during nested loops and keeping evaluation scopes clean.
The project is fully open-source, features a complete bilingual documentation, and is ready for you to clone and play with.
๐ฆ Check out the repository here:
๐ github.com/alejandrofinkelberg62/pampaLang
I'd love to hear your thoughts or feedback on the evaluation architecture!
Top comments (0)