# Getting Started with Soplang
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Welcome to Soplang! This guide will help you install Soplang, set up your development environment, and write your first Soplang program.
1. Installation [#1-installation]
Before you can start programming with Soplang, you need to install it on your system. Choose the installation method that works best for you:
Option 1: Direct Download [#option-1-direct-download]
**soplang-installer**
```bash
soplang --install
```
*Welcome to the Soplang installer. Please select your operating system...*
Option 2: Package Managers [#option-2-package-managers]
**package-manager-install**
```bash
soplang --package-manager
```
*Choose your preferred package manager to install Soplang...*
For more detailed installation instructions, check out our [comprehensive installation guide](/docs/installation).
2. Your First Soplang Program [#2-your-first-soplang-program]
Now that you have Soplang installed, let's write a simple "Hello, World!" program:
Save this code in a file named `hello.sop`.
Running Your Program [#running-your-program]
To run your Soplang program, open a terminal or command prompt and navigate to the directory where you saved the file. Then run:
```bash
soplang hello.sop
```
You should see the following output:
```bash
Hello, World!
Welcome to Soplang version 1.2!
Hello, Developer!
```
Congratulations! You've just written and executed your first Soplang program.
3. Basic Concepts [#3-basic-concepts]
Variables and Data Types [#variables-and-data-types]
Soplang is dynamically typed, meaning you don't need to declare variable types. The language supports common data types like strings, numbers, booleans, lists, and dictionaries.
Control Flow [#control-flow]
Soplang uses indentation to define code blocks in control structures:
= 18 and age < 65:
print("You are an adult")
else:
print("You are a senior")
// For loop
for language in ["Somali", "JavaScript", "Soplang"]:
print(f"I like {language}")
// While loop
count = 5
while count > 0:
print(count)
count -= 1
print("Blast off!")`}
title="control_flow.sop"
/>
Functions [#functions]
Functions in Soplang are defined using the `def` keyword:
int:
return a + b`}
title="functions.sop"
/>
# Installing Soplang
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
This guide shows two easy ways to get started with **Soplang**: downloading a prebuilt release or using the official Docker image.
General Download (All Platforms) [#general-download-all-platforms]
1. **Download:** Grab the latest release for your platform from the [downloads page](/downloads).
2. **Extract / Install:** Unzip or install the package as provided by the release. If it’s a single binary, place it somewhere in your PATH (e.g., `~/bin` on UNIX-like systems).
3. **(Optional) Add to PATH:** Ensure the `soplang` binary is available on your PATH. For example (shell/zsh):
```shell
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.shellrc && source ~/.shellrc
```
4. **Verify:** Open your terminal and run:
```shell
soplang --version
```
Run Your First Program [#run-your-first-program]
**hello.sop**
Execute the file:
```bash
soplang hello.sop
```
Use Docker (No Local Install) [#use-docker-no-local-install]
If you already have Docker, you can run Soplang without installing anything else.
1) Pull the Image [#1-pull-the-image]
```shell
docker pull soplang/soplang:latest
```
2) Run an Interactive Session [#2-run-an-interactive-session]
```shell
docker run -it --rm soplang/soplang
```
3) Run a Local File [#3-run-a-local-file]
Mount your project directory and execute a file:
```shell
# from your project directory
docker run -it --rm -v "$PWD":/app -w /app soplang/soplang soplang hello.sop
```
Checksums & Offline Install [#checksums--offline-install]
* **Verify downloads:** Compare the file’s checksum with the one on the [downloads page](/downloads).
* **Offline:** Keep the extracted folder/binary and run directly—no internet required after download.
Troubleshooting [#troubleshooting]
“command not found” [#command-not-found]
Make sure `soplang` is on your PATH, or run it via Docker as shown above.
Permission denied (UNIX-like) [#permission-denied-unix-like]
If you downloaded a binary, grant execute permissions:
```shell
chmod +x /path/to/soplang
```
Still stuck? [#still-stuck]
Check the [downloads](/downloads) page notes or ask in [community support](/community).
# Soplang Syntax
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Soplang Syntax [#soplang-syntax]
Soplang syntax waxaa loo qaabeeyey in ay noqoto mid cad, kooban, oo si sahlan loogu fahmo af-Soomaali. Waxay isticmaashaa ereyo Soomaali ah si ay u metesho fikradaha barnaamijyada caanka ah, taas oo ka dhigaysa koodhku mid dabiici ah oo la akhrin karo.
Hello World [#hello-world]
Tani waa barnaamijka ugu fudud ee Soplang. Waxay adeegsanaysaa shaqada-dhexdeeda `qor()` si ay u muujiso wax soo saar.
**hello-world.sop**
Structure [#structure]
Barnaamijyada Soplang waxay ka kooban yihiin qaybahaan:
* **Declarations** – adigoo adeegsanaya `door`, `abn`, `jajab`, ama `madoor`
* **Functions** – adigoo adeegsanaya `hawl`, `celi`
* **Control flow** – adigoo adeegsanaya `haddii`, `ugudambeyn`, `celi`, iwm.
* **Built-ins** – sida `qor()`, `gelin()`, `nooc()`
Blocks waxaa lagu qeexaa laalaabyo (`{}`) koodhkuna wuxuu ku socdaa khad-khad.
Example Program [#example-program]
Tusaalahan waxa uu akhriyaa gelinta isticmaalaha kadibna wuu salaamaa. Waxa uu ka kooban yahay: *qeexid hawl (function)*, *doorsoome*, iyo *built-ins*.
**example.sop**
File Extension [#file-extension]
Faylasha il-koodhka Soplang waxay adeegsadaan kordhinta `.sop`. Waxaad ku ordi kartaa CLI ama REPL-ka Soplang:
**run.sh**
```shell
soplang file.sop
```
Syntax-kan waxa uu ku barayaa qulqulka iyo dareenka Soplang: fudayd, muujin, iyo Somali-first.
# Input and Output
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Input and Output in Soplang [#input-and-output-in-soplang]
Soplang waxay isticmaashaa shaqooyin-dhexdeed fudud si loo soo bandhigo wax soo saar iyo in lagu akhriyo gelinta isticmaalaha.
qor() – Print to Console [#qor--print-to-console]
Adeegso `qor()` si aad u muujiso qiimayaal ama xarfo (strings) shaashadda.
**print\_console.sop**
gelin() – Read from User Input [#gelin--read-from-user-input]
Adeegso `gelin()` si aad u weydiiso isticmaalaha gelin. Qiimaha wuxuu had iyo jeer kusoo noqdaa *string*.
**read\_input.sop**
Haddii aad u baahan tahay is-beddel nooc (type conversion), waxaad adeegsan kartaa `abn()` si aad ugu rogto tiro.
**type\_conversion.sop**
# Variables
import {
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "../../components/ui/table";
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Soplang Variables [#soplang-variables]
Soplang variables waxaa lagu qeexaa erayo Somali-first ah oo ka tarjumaya doorka ama nooca. Tani waxay ka dhigtaa koodhka mid muujin leh oo u fudud barayaasha Af-Soomaaliga.
Dynamic Variables – door [#dynamic-variables--door]
`door` waa soo gaabinta *doorsoome* oo loo adeegsado doorsoomayaal *dynamically typed*.
**dynamic\_variables.sop**
Static Variables [#static-variables]
Doorsoomayaasha *static* waa kuwa si cad loo noocqeeyo (explicit types) si loo helo hufnaan iyo badbaado nooc (type safety).
Type
Keyword
Stands for
Example
Integer
`abn`
*abyoone*
`abn tirada = 10`
Float
`jajab`
*jajab*
`jajab qiime = 3.14`
String
`qoraal`
*qoraal*
`qoraal magaca = "Soplang"`
Boolean
`bool`
*bool*
`bool sax = run`
List
`teed`
*teed*
`teed liis = [1, 2, 3]`
Object
`walax`
*walax*
`walax qof = {magac: "Ali"}`
Constants – madoor [#constants--madoor]
`madoor` (soo gaabinta *madoorsoome*) waxaa loo adeegsadaa qiyamka aan la beddeli karin (immutable).
**constants\_basic.sop**
Constants lama u wareejin karo (reassign):
**constants\_reassign\_error.sop**
# Type Conversion
import {
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "../../components/ui/table";
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Type Conversion in Soplang [#type-conversion-in-soplang]
Soplang waxa uu leeyahay shaqooyin-dhexdeed (built-ins) oo fudud oo lagu kala beddelo noocyada xogta. Kuwaas waxay kuu oggolaanayaan inaad si ammaan ah ugu beddesho u dhaxeysa integer, string, decimal, iyo boolean—adigoo ilaalinaya saxnaanta xogta.
nooc() – Type Checking [#nooc--type-checking]
Adeegso `nooc()` si aad u hubiso nooca qiime kasta.
**type\_checking.sop**
Type Conversion Functions [#type-conversion-functions]
Hoos waxaa ku qoran is-beddellada caanka ah iyo shaqada la adeegsado:
Conversion
Function
Example
Int → String
`qoraal()`
`qoraal(42)`
String → Int
`abn()`
`abn("123")`
Float → String
`qoraal()`
`qoraal(3.14)`
String → Float
`jajab()`
`jajab("3.14")`
Int → Float
`jajab()`
`jajab(5)`
Float → Int
`abn()`
`abn(4.9)`
→
`4`
*(truncates)*
Any → Bool
`bool()`
`bool(1)`
→
`run`
,
`bool(0)`
→
`been`
Example [#example]
Shaqooyinkan beddelka noocyadu waxay muhiim u yihiin dhismaha *input-handling* adag, tusaale ahaan marka aad akhrinayso gelinta isticmaalaha ama faylasha oo aad rabto inaad hubiso noocyo sax ah ka hor inta aanad xisaab samayn.
# Operators
import {
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "../../components/ui/table";
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Operators in Soplang [#operators-in-soplang]
Soplang waxa uu taageeraa operators caadi ah oo u eg kuwa luqadaha caanka ah: arithmetic, comparison, iyo logical—si fudud oo akhris-wanaagsan.
Arithmetic Operators [#arithmetic-operators]
Waxaa loo adeegsadaa xisaab tirooyin `abn` ama `jajab`.
Operator
Meaning
Example
`+`
Addition
`a + b`
`-`
Subtraction
`a - b`
`*`
Multiplication
`a * b`
`/`
Division
`a / b`
`%`
Modulo
`a % b`
Comparison Operators [#comparison-operators]
Lagu hubiyo isbarbar dhig ama sinnaansho u dhexeeya qiimeyaal.
Operator
Meaning
Example
`==`
Equal
`a == b`
`!=`
Not equal
`a != b`
`>`
Greater than
`a > b`
`<`
Less than
`a < b`
`>=`
Greater or equal
`a >= b`
`<=`
Less or equal
`a <= b`
Logical Operators [#logical-operators]
Waxaa loo adeegsadaa isku-darka xaaladaha (conditions) boolean.
Operator
Meaning
Example
`&&`
Logical AND
`(a > 5) && (b < 10)`
`||`
Logical OR
`(a < 5) || (b > 3)`
`!`
Logical NOT
`!(a == b)`
3) && (y < 15)
bool isMismatch = !(x == y)
qor("Is in range: " + isInRange)
qor("Mismatch: " + isMismatch)`}
/>
Operators-ka Soplang waxay kuu oggolaanayaan inaad dhisto muujiyeyo awood leh iyo xakamayn (control flow) nadiif ah.
# Conditional Statements
import {
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "../../components/ui/table";
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Conditional Statements [#conditional-statements]
Soplang waxay bixisaa fulin shuruudeed (conditional execution) iyadoo adeegsanaysa erayo Soomaali ah si ay u noqoto mid cad oo muujin leh.
If Statements – haddii, haddii_kale, ugudambeyn [#if-statements--haddii-haddii_kale-ugudambeyn]
Waxay u dhigmaan *if*, *else if*, iyo *else* luqadaha kale.
= 18) {
qor("Waad qaan gaadhay")
} haddii_kale (da >= 13) {
qor("Waxaad tahay dhallinyaro")
} ugudambeyn {
qor("Waad yar tahay")
}`}
/>
Block walba waxaa lagu xiraa `{}`. Waxaad isku xirin ama isku dhex dhigi kartaa (nest) sidaad u baahan tahay.
Boolean Conditions [#boolean-conditions]
Adeegso muujiyeyaasha `bool` iyo operators-ka `&&`, `||`, iyo `!`.
Summary [#summary]
Keyword
Meaning
`haddii`
if
`haddii_kale`
else if
`ugudambeyn`
else
Control flow ee Soplang wuxuu raacaa qaab akhris-wanaagsan oo Somali-first ah.
Switch-Case – dooro iyo xaalad [#switch-case--dooro-iyo-xaalad]
Loogu talagalay laanayn cad oo ku saleysan hal qiime: `dooro` (switch expression), `xaalad` (case), iyo `ugudambeyn` (default).
Tani waxay ku habboon tahay go'aan-qaadasho leh laamo badan oo ku saleysan qiime go'an.
Combined Usage [#combined-usage]
Waxaad isku dari kartaa `haddii`/`haddii_kale`/`ugudambeyn` iyo `dooro` si aad u dhisto logic adag oo weli akhris-wanaagsan.
# Loops
import {
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "../../components/ui/table";
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Loops in Soplang [#loops-in-soplang]
Soplang waxa uu taageeraa laba nooc oo loops ah: `intay (shuruud)` oo u dhiganta *while*, iyo `kuceli (bilow ilaa dhamaad)` oo u dhiganta *for*. Waxa kale oo jira `jooji` (break) iyo `soco` (continue) si aad u yeelato xakameyn faahfaahsan.
While Loop – intay [#while-loop--intay]
Koodhka ku jira block-ga wuu soconayaa inta shuruuddu tahay *run*:
**while\_basic.sop**
Waxay taageertaa `jooji` iyo `soco`:
**while\_break\_continue.sop**
For Loop – kuceli [#for-loop--kuceli]
**for\_basic.sop**
Talaabo (step) la doortay:
**for\_step.sop**
Loop Over List [#loop-over-list]
**loop\_over\_list.sop**
Nested Loops [#nested-loops]
**nested\_loops.sop**
0) {
qor("Nested example")
jooji
}
}`}
/>
Factorial with While [#factorial-with-while]
**factorial\_while.sop**
0) {
result = result * n
n = n - 1
}
qor(result)`}
/>
Summary [#summary]
Keyword
Meaning
`intay`
while loop
`kuceli`
for loop
`jooji`
break
`soco`
continue
Soplang loops waxay taageeraan labadaba ku-celcelin qaabaysan iyo socod ku saleysan shuruud.
# Functions
import {
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "../../components/ui/table";
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Functions in Soplang [#functions-in-soplang]
Functions (hawlo) waa qaybo koodh oo dib loo isticmaali karo. Soplang waxa lagu qeexaa `hawl` waxaana natiijo lagu soo celinayaa `celi`.
Define a Function – hawl [#define-a-function--hawl]
Hawl waxa ay bilaabataa `hawl` kadibna magac hawl iyo parameters (aan lahayn type annotations).
Call a Function [#call-a-function]
Marka aad qeexdo, ku wac magaceeda oo raaci doodaha (arguments):
Return Values – celi [#return-values--celi]
Adeegso `celi` si aad uga soo celiso hawl qiime.
Loops Inside Functions [#loops-inside-functions]
Hawluhu waxay ka kooban karaan loops iyo logic kale sida blocks-ka caadiga ah.
Summary [#summary]
Keyword
Meaning
`hawl`
function definition
`celi`
return value
Functions ee Soplang waxay ka dhigaan koodhka dib-u-isticmaal leh, nadiif, oo Somali-first.
# Data Types
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Data Types in Soplang [#data-types-in-soplang]
Soplang waxa uu leeyahay noocyo xog oo kala duwan si uu u metelo qiimeyaal kala geddisan. Boggan waxa uu daboolayaa noocyada aasaasiga ah (primitives) iyo ururinta (collections) iyo sida ugu habboon ee loo isticmaalo.
Primitive Types [#primitive-types]
Kuwaani waa noocyada ugu aasaasiga ah ee dhisaya noocyada kale ee adag.
Numbers [#numbers]
Soplang waxa uu taageeraa tirooyinka dhan iyo jajab. Waxa aad isticmaali kartaa `door` (dynamic) ama `abn` (static).
**numbers.sop**
Strings [#strings]
*Strings* waa taxane xarfo ah. Waxaad adeegsan kartaa q-double ama q-single, ka dibna ku shaqayn karaan habab kala duwan.
**strings.sop**
Booleans [#booleans]
Qiimayaasha run/been: `run` iyo `been`. Waxaad adeegsan kartaa `door` ama `bool`.
**booleans.sop**
y) // false
qor(x <= y) // true
qor(x == 10) // true
qor(x != y) // true`}
/>
Collection Types [#collection-types]
Ururinta waxa ay kuu oggolaanayaan in aad isku kaydiso qiimeyaal badan.
Lists [#lists]
Liisaska waa ururin leh amar (ordered). Waad abuuri kartaa adigoo adeegsanaya `teed` (static) ama `door` oo leh `[]`.
**lists.sop**
Objects (Dictionaries) [#objects-dictionaries]
*Objects* waa lammaane fure–qiime ah. Waxaad ku abuuri kartaa `door` adigoo adeegsanaya `{}` ama nooca static ee `walax`.
**objects.sop**
# Strings in Soplang
import {
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "../../components/ui/table";
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Strings in Soplang [#strings-in-soplang]
Soplang waxa uu taageeraa habab kala duwan oo *string* manipulation ah oo leh magacyo Soomaali u-dhega nugul. Strings waxaa lagu qeexaa `door` ama `qoraal`.
Declare a String [#declare-a-string]
String Methods [#string-methods]
Hababka hoose waxay ka tarjumayaan kuwa caanka ah ee luqadaha kale, balse magacyo Soomaali ah ayay leeyihiin:
Method
English Equivalent
Description
Example
`qeybi(xad)`
`split()`
Kala jabiso string iyadoo la adeegsanayo kala-sooc.
`door parts = text.qeybi(",")`
`leeyahay(sub)`
`includes()`
Hubi in uu ku jiro far-qoraal gaaban.
`haddii (text.leeyahay("search")) {...}`
`dhamaad(sub)`
`endsWith()`
Hubi in uu ku dhammaado far-qoraal.
`haddii (text.dhamaad("ing")) {...}`
`bilow(sub)`
`startsWith()`
Hubi in uu ku bilaabmo far-qoraal.
`haddii (text.bilow("http")) {...}`
`beddel(x, y)`
`replace()`
Beddel
*x*
adigoo u beddelaya
*y*
.
`door cusub = text.beddel("old", "new")`
`kudar(teed)`
`join()`
Ku xiro liis xarfo adigoo isticmaalaya kala-soocan.
`door text = ", ".kudar(names)`
`jar(bilow, dhamaad)`
`slice()`
Soo saar qayb ka timid
*bilow*
ilaa
*dhamaad*
.
`door sub = text.jar(0, 3)`
Example Usage [#example-usage]
Strings ee Soplang waa muujin iyo la-qabsan fudud, iyadoo magacyada hababka ay yihiin Soomaali-first si ay u noqdaan kuwo si dabiici ah loo fahmo.
# Numbers
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Numbers in Soplang [#numbers-in-soplang]
Soplang waxa uu leeyahay laba nooc oo tiro ah: **abn** (integers) iyo **jajab** (decimals). Boggan waxa uu muujinayaa sida loo qoro, loo xisaabiyo, loona is-beddelo labadan nooc.
Integers — abn [#integers--abn]
`abn` waxa uu metelaa tirooyin dhan (…,-2,-1,0,1,2,…). Waxaad qeexi kartaa si *dynamic* (`door`) ama si *static* (`abn`).
b) // run
qor(a == 10) // run
qor(a != b) // run`}
/>
Qaybintu (`/`) waxay bixin kartaa natiijo *jajab* haddii aysan si buuxda u qaybsamin—haddii aad rabto integer oo keliya, isticmaal `abn()` si aad u *truncation* sameyso.
Decimals — jajab [#decimals--jajab]
`jajab` waxa uu metelaa tirooyinka leh meel-dhaaf (floating/decimal). Waxaa ku habboon xisaab sax ah oo leh jajab.
3) // run
qor(2.0 == 2) // run (labaduba waxay loo turjumi karaa qiime isu eg)`}
/>
Haddii aad ka timid `door` oo aadan hubin nooca, waxaad ka fiirsan kartaa `nooc()` si aad u xaqiijiso.
Isku-darka abn & jajab [#isku-darka-abn--jajab]
Marka aad isku qasto `abn` iyo `jajab`, natiijadu inta badan waxay noqotaa `jajab`. Waxaad si cad u qasbi kartaa nooca adigoo adeegsanaya `abn()` ama `jajab()`.
Beddel & xaqiijin degdeg ah [#beddel--xaqiijin-degdeg-ah]
19
qor("Nooc: " + nooc(da)) // "abn"
// String → decimal
jajab qiime = jajab("12.75")
qor(qiime + 0.25) // 13.0
// Number → string
qoraal s = qoraal(2025)
qor("Sanad: " + s)`}
/>
# Arrays
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Arrays [#arrays]
Arrays waxa lagu qeexaa erayga `teed`. Waxay hayaan uruurin qiimayaal ah oo leh habab badan: maarayn, beddelid, iyo falanqayn.
Declaring Arrays [#declaring-arrays]
Core Array Methods [#core-array-methods]
dherer() – Get Length [#dherer--get-length]
kudar(x) – Add to End [#kudarx--add-to-end]
kasaar() – Remove Last [#kasaar--remove-last]
kudar(teed) – Concatenate [#kudarteed--concatenate]
leeyahay(x) – Contains Check [#leeyahayx--contains-check]
Utility Methods [#utility-methods]
nuqul() – Copy Array [#nuqul--copy-array]
rog() – Reverse [#rog--reverse]
nadiifi() – Clear [#nadiifi--clear]
habee() – Sort [#habee--sort]
Transform and Filter [#transform-and-filter]
aaddin(funk) – Map Items [#aaddinfunk--map-items]
shaandhee(funk) – Filter Items [#shaandheefunk--filter-items]
Indexing and Slicing [#indexing-and-slicing]
muuji(x) – Find Index [#muujix--find-index]
jar(a, b) – Slice Sublist [#jara-b--slice-sublist]
**Gunaanad:** `teed` waa qaab-dhismeed aasaasi ah oo Soo-maali-first ah, fududeynaaya maaraynta iyo ku celcelinta liisaska.
# Objects in Soplang
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Objects in Soplang [#objects-in-soplang]
Objects in Soplang are defined using the `walax` type. They store key–value pairs and provide Somali-first methods to inspect, modify, and copy structured data.
🧾 Declaring an Object – walax [#-declaring-an-object--walax]
**declare\_object.sop**
🔧 Core Object Methods [#-core-object-methods]
fure() – Get Keys [#fure--get-keys]
**keys.sop**
qiime() – Get Values [#qiime--get-values]
**values.sop**
lamaane() – Get Key-Value Pairs [#lamaane--get-key-value-pairs]
**pairs.sop**
leeyahay(x) – Has Key [#leeyahayx--has-key]
**has\_key.sop**
tir(x) – Delete Key [#tirx--delete-key]
**delete.sop**
kudar(obj) – Merge/Assign [#kudarobj--mergeassign]
**merge.sop**
nuqul() – Copy [#nuqul--copy]
**copy.sop**
nadiifi() – Clear All Properties [#nadiifi--clear-all-properties]
**clear.sop**
**Gunaanad:** `walax` waxay siisaa qaab awood badan oo lagu kaydiyo xog magacyo leh, iyadoo leh habab si buuxda ugu qoran Af-Soomaali.
# Soplang Keywords Reference
import {
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "../../components/ui/table";
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Soplang Keywords Reference [#soplang-keywords-reference]
Dukumeentigani waxa uu soo koobayaa ereyada (keywords) ee Soplang, macnahooda, u dhigmaha Ingiriisiga, iyo tusaalooyin isticmaal.
Variable Declaration Keywords [#variable-declaration-keywords]
Keyword
Meaning
English Equivalent
Example
`door`
Dynamic variable declaration
`var/let`
`door magac = "Sharafdin"`
`madoor`
Constant variable declaration
`const`
`madoor PI = 3.14159`
`abn`
Integer type
`int`
`abn da = 25`
`jajab`
Decimal/float type
`float/double`
`jajab qiimo = 3.14`
`qoraal`
String type
`string`
`qoraal magac = "Sharafdin"`
`bool`
Boolean type
`bool`
`bool waaRun = run`
`walax`
Object type
`object`
`walax person = { name: "Sharafdin" }`
`teed`
List/array type
`array`
`teed numbers = [1, 2, 3]`
`maran`
Null value
`null`
`door a = maran`
Control Flow Keywords [#control-flow-keywords]
Keyword
Meaning
English Equivalent
Example
`haddii`
If statement
`if`
`haddii (x > 10) { qor("Weyn") }`
`haddii_kale`
Else if statement
`else if`
`haddii_kale (x == 10) { qor("Dhexe") }`
`ugudambeyn`
Else statement
`else`
`ugudambeyn { qor("Yar") }`
`dooro`
Switch statement
`switch`
`dooro (x) { xaalad 1 { qor("Hal") } }`
`xaalad`
Case clause
`case`
`xaalad "A" { qor("Case A") }`
`kuceli`
For loop
`for`
`kuceli (i 1 ilaa 5) { qor(i) }`
`ilaa`
Loop range end
`to`
`kuceli (i 1 ilaa 5) { qor(i) }`
`::`
Loop increment
`step`
`kuceli (i 1 ilaa 10 :: 2) { qor(i) }`
`intay`
While loop
`while`
`intay (x < 5) { qor(x) }`
`jooji`
Break statement
`break`
`haddii (x == 3) { jooji }`
`soco`
Continue statement
`continue`
`haddii (x == 3) { soco }`
Function Keywords [#function-keywords]
Keyword
Meaning
English Equivalent
Example
`hawl`
Function declaration
`function`
`hawl isuGee(a, b) { celi a + b }`
`celi`
Return statement
`return`
`celi x * 2`
Special Values [#special-values]
Somali Value
English Equivalent
Description
Example
`run`
`true`
Boolean true value
`haddii (run) { ... }`
`been`
`false`
Boolean false value
`haddii (!been) { ... }`
`maran`
`null`
Empty/null value
`door val = maran`
Operators [#operators]
Somali Operator
English Equivalent
Description
Example
`+`
`+`
Addition
`x = a + b`
`-`
`-`
Subtraction
`x = a - b`
`*`
`*`
Multiplication
`x = a * b`
`/`
`/`
Division
`x = a / b`
`%`
`%`
Modulo
`x = a % b`
`==`
`==`
Equal to
`haddii (a == b) {...}`
`!=`
`!=`
Not equal to
`haddii (a != b) {...}`
`>`
`>`
Greater than
`haddii (a > b) {...}`
`<`
`<`
Less than
`haddii (a < b) {...}`
`>=`
`>=`
Greater than or equal to
`haddii (a >= b) {...}`
`<=`
`<=`
Less than or equal to
`haddii (a <= b) {...}`
`&&`
`&&`
Logical AND
`haddii (a && b) {...}`
`||`
`||`
Logical OR
`haddii (a || b) {...}`
`!`
`!`
Logical NOT
`haddii (!a) {...}`
Quick Examples [#quick-examples]
**keywords\_quick\_examples.sop**
= 18) { qor("Qof weyn") } ugudambeyn { qor("Ilmo") }
dooro (qora) {
xaalad "Salaan" { qor("Hello!") }
ugudambeyn { qor("Unknown") }
}
kuceli (i 1 ilaa 5 :: 2) { qor(i) }
abn x = 1
intay (x < 3) { qor(x); x = x + 1 }
// Functions
hawl isuGee(a, b) { celi a + b }
qor(isuGee(2, 3))`}
/>
# Built-in Functions in Soplang
import {
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "../../components/ui/table";
import SoplangCodeWindow from "../../components/SoplangCodeWindow";
Built-in Functions in Soplang [#built-in-functions-in-soplang]
Soplang waxa uu leeyahay hawlo muhiim ah oo si joogto ah u diyaar ah—daabacaad, akhris, beddel-nooc, leex-leexin tiro (rounding), abuuris liis/obj, iyo in ka badan—dhammaantood magacyo Soomaali ah.
📋 Built-in Function Reference [#-built-in-function-reference]
Function
Meaning
English Equivalent
Example
qor()
Print to console
print()
qor("Salaan, Adduunka!")
gelin()
Read user input
input()
door magac = gelin("Magacaaga geli: ")
nooc()
Get type of a value
typeof
qor(nooc(magac))
abn()
Convert to integer
int()
door n = abn("5")
jajab()
Convert to float
float()
door f = jajab("3.14")
qoraal()
Convert to string
str()
door s = qoraal(25)
bool()
Convert to boolean
bool()
door b = bool(1)
teed()
Create an array
list()
door liis = teed(1, 2, 3)
walax()
Create an object
object()
door obj = walax(magac: "Ali")
daji()
Round down
Math.floor()
door x = daji(4.9)
kor()
Round up
Math.ceil()
door x = kor(4.2)
dherer()
Length of string/list
len()/.length
door l = "text".dherer()
xul()
Pick random number
random()
door n = xul(1, 6)
🧪 Examples [#-examples]
**builtins\_examples.sop**
**Gunaanad:** built-ins-ka Soplang waxay ka dhigaan koodhka mid kooban, muujin leh, isla markaana si dabiici ah ugu qoran Af-Soomaali.
# Faq Quesions
General [#general]
What is Soplang? [#what-is-soplang]
Soplang is a programming language designed to be intuitive and powerful, with a focus on simplicity and readability. It allows you to write code in Somali.
Is it open source? [#is-it-open-source]
Yes, Soplang is open source and released under the MIT License.
Installation & Setup [#installation--setup]
How do I install Soplang? [#how-do-i-install-soplang]
You can install Soplang using npm or by downloading the binaries from our website.
Language Features [#language-features]
Does it support classes? [#does-it-support-classes]
Yes, Soplang supports object-oriented programming with classes and interfaces.
Community & Support [#community--support]
Where can I get help? [#where-can-i-get-help]
You can join our community discord or check the documentation for help.
# Introduction
Welcome to the Soplang documentation! Here you'll find everything you need to get started with Soplang, from installation to advanced features.
Getting Started [#getting-started]
* [Installation](/docs/00_installation) - Learn how to install Soplang
* [Getting Started](/docs/00_getting-started) - Write your first Soplang program
Language Basics [#language-basics]
* [Syntax Basics](/docs/01_syntax-basics) - Learn the fundamentals
* [Variables](/docs/03_variables) - Working with variables
* [Data Types](/docs/09_data-types) - Understanding data types
* [Operators](/docs/05_operators) - Using operators
* [Functions](/docs/08_functions) - Defining and using functions
Advanced Topics [#advanced-topics]
* [Arrays](/docs/12_arrays) - Working with arrays
* [Objects](/docs/13_objects) - Working with objects
* [Loops](/docs/07_loops) - Control flow with loops
* [Conditional Statements](/docs/06_conditional-statements) - Making decisions
Reference [#reference]
* [Keywords Reference](/docs/14_keywords-reference) - Complete keywords reference
* [Built-in Functions](/docs/15_built-in-functions) - Available built-in functions
* [FAQ](/docs/faq) - Frequently asked questions