Replies: 2 comments
-
|
Making the decision to build a somali programming language wasn`t easy. but you did it. I am grateful for that decision, brother .😱🔥🫡 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Soplang is more than a project — it’s a bold step for Somali tech. Respect for making your idea real and handling the hard stuff like grammar and tools. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Have you ever dreamed of creating your own programming language? I did — and I followed through with it.
It’s called Soplang, and it’s a language designed with simplicity, education, and the Somali language in mind. But building a programming language isn't as mysterious as it seems — and you don't need to start from raw machine code.
In this post, I’ll walk you through:
🚀 What Is a Programming Language?
At its core, a programming language is just a way to give instructions to a computer. But computers only understand machine code — binary ones and zeros. So we create human-friendly languages that get translated into something the machine can actually execute.
A typical language has:
🧱 How Are Programming Languages Built?
Let’s break it down into the essential building blocks:
1. Lexing & Parsing
You take the raw code (
door x = 5) and turn it into tokens: words likedoor,x,=,5.Then, you parse those tokens into an Abstract Syntax Tree (AST) — a tree structure that represents what the code means.
2. Interpreting or Compiling
Once you have the AST, you can either:
3. Runtime / Standard Library
This is the toolbox for your language: math functions, file I/O, networking, etc. Without this, the language can’t do much.
4. Tooling
Once your language works, you still need:
For Soplang, the first version includes a Python-based interpreter, an extended standard library, and we’re building a Rust-based compiler and a browser version (
sopScript) next.🧠 Every Language Stands on the Shoulders of Another
So when I started Soplang, I used Python to build the first interpreter. It let me move fast, prototype quickly, and focus on language design. Later, we’re switching to a Rust-based compiler for better performance and safety.
📚 Lessons From Designing Soplang’s Grammar (It Was Painful)
One of the most surprising challenges I faced was choosing the right grammar and keywords — especially because Soplang is designed with Somali in mind.
At first, I used
keydfor variables — it means “storage.” Technically correct, but it didn’t feel natural.After some testing and feedback, I changed it to
door, a short form of doorsoome, meaning “something that changes.” That captured the real purpose of a variable better, and it was shorter and cleaner.But that process repeated for every keyword:
if,while,print,functionbe in Somali?🔮 The Future of Soplang
Soplang is still evolving. Here’s what’s coming in Soplang 2.0:
sop) to run and manage packages.sopScript: Soplang running in the browser.💬 Final Thoughts
You don’t need to be a compiler expert to start. You just need a goal, a little curiosity, and the patience to make a lot of design decisions.
Whether you're thinking about building your own language or just curious how it’s done — I hope Soplang inspires you.
Mr Sharafdin.
Beta Was this translation helpful? Give feedback.
All reactions