v2.0.0 is stable

The first Somali programming language

Write programs with Somali keywords. Soplang is free and open source, built for students, teachers, and developers who think in Somali.

230 stars on GitHub · 17 contributors · MIT license

salaan.sop
// Salaan, Adduunka!
qor("Salaan, Adduunka!")

door magac = "Hodan"
abn da = 21

hawl salaan(qof) {
    celi "Salaan, " + qof + "!"
}

haddii (da >= 18) {
    qor(salaan(magac))
} ugudambeyn {
    qor("Weli waad yar tahay")
}
$ soplang salaan.sop
Salaan, Adduunka!
Salaan, Hodan!

Supported by

Docker

Ereybixin

Somali keywords, plain meaning

Each keyword is an everyday Somali word. If you already know another language, this is the whole translation.

All keywords
qor
print
door
variable
hawl
function
celi
return
haddii
if
ugudambeyn
else
intay
while
kuceli
for
qaab
class
cusub
new
fasax
try
qabo
catch
keen
import
run
true
been
false
null
null

Why Soplang

A language that speaks Somali

Code that reads like Somali

Keywords say what they do. A learner can follow a loop before learning the English word for it.

liisas.sop
teed miro = ["moos", "liin", "canbe"]

kuceli (i 0 ilaa 2) {
    qor(i + ": " + miro[i])
}

door tiro = 3
intay (tiro > 0) {
    qor(tiro)
    tiro = tiro - 1
}
  • intay means while
  • kuceli counts from one value to another
  • qor prints to the screen

Start dynamic, add types when they help

Use door for quick scripts. Use abn, qoraal, or teed when you want the compiler to check your values before the program runs.

noocyo.sop
door magac = "Hodan"     // dynamic
abn da = 21              // static: abn

hawl laban(abn x): abn {
    celi x * 2
}

qor(laban(da))           // 42
qor(nooc(magac))         // qoraal
  • Typed parameters and return values
  • Type errors are caught before running
  • --strict requires a type on every variable

Classes and inheritance

qaab defines a class, cusub creates an instance, and dhaxal inherits from a parent class.

xayawaan.sop
qaab Xayawaan {
    hawl dhaw(magac) {
        nafta.magac = magac
    }
}

qaab Eey dhaxal Xayawaan {
    hawl cod() {
        celi nafta.magac + ": Waf!"
    }
}

door e = cusub Eey("Libaax")
qor(e.cod())             // Libaax: Waf!
  • dhaw is the constructor
  • nafta refers to the current instance
  • Child classes override parent methods

Error messages in Somali

Every error names the line and column, points at the problem, and suggests a fix. Catch runtime errors with fasax and qabo.

terminal
$ soplang luqad.sop
Khalad nooc: Ma bedeli kartid qiimaha doorsamaha madoor 'luqad' [E020] safka 2, tiirka 1
2 │ luqad = "English"
│ ^
└─ Doorsamaha madoor ma beddeli karaan qiimahooda. Isticmaal 'door' haddii aad rabto mid beddeli kara.
  • Errors are written in Somali
  • Each message shows the line it came from
  • fasax and qabo work like try and catch

Get started

From install to first program

  1. 01

    Install

    Download the installer for your system, or run Soplang with Docker.

    soplang --versionGo to downloads
  2. 02

    Write

    Create a file that ends in .sop and write your first line.

    qor("Salaan!")Read the guide
  3. 03

    Run

    Run the file from your terminal, or open the REPL to try ideas.

    soplang salaan.sopCLI and REPL

FAQ

Questions about Soplang

What is Soplang?

Soplang (Somali Programming Language) is a free, open-source programming language whose keywords are Somali words. qor prints to the screen, haddii means if, intay means while, and hawl defines a function. It supports both dynamic and static typing, classes and inheritance, modules, and error handling with fasax and qabo.

Who created Soplang?

Soplang was created by Sharafdin Yusuf and first released in October 2023. It is developed and maintained by Somast, with help from open-source contributors on GitHub.

Who is Soplang for?

Students, teachers, and developers who think in Somali. A beginner can read a Soplang program like a sentence before learning the English words most languages use, and error messages are written in Somali too.

Is Soplang free?

Yes. Soplang is released under the MIT license, so you can use it for learning, teaching, and commercial work. The source code is on GitHub.

Which systems does Soplang run on?

Windows has an installer and a winget package. On macOS and Linux you can install it with Cargo, and it runs on any system through Docker.

How do I write my first program?

Install Soplang, create a file called hello.sop containing qor("Salaan, Adduunka!"), and run soplang hello.sop in your terminal. The getting-started guide walks through each step.

“Dhis software adigoo adeegsanaya afkaaga hooyo.”
Build software in your mother tongue.

Soplang started in 2023 so that the first obstacle to learning code would be the idea, not the language it is written in.

Read our story

Ready to write your first line?

Install Soplang, open the guide, and run a program in Somali in a few minutes.