Swahili Lang
kshncodes (10)

Swahili is a programming language that is designed to be written entirely in the Swahili language. This is to aid in helping native Swahili speakers (primarily in East Africa) learn to code without the language barrier - in more ways than one!

Team

Design

Its syntax is a lot like JavaScript (which is what my teammate and I are best at), and is even built in JavaScript (on Node). We built everything (lexer, parser and interpreter) from scratch and are continuing to add more functionality to the language.

Source Code

See the project repl or GitHub

Examples

We've written a few examples to illustrate the syntax, and tried our best to add comments in both Swahili and English. Here's links to a few:

// Tumia "Dunia" mtumizi asipoandika chochote
// (Use "Dunia" if the user doesn't input anything)
wacha jina = soma("Jina lako? ") || "Dunia"

// Onyesha ujumbe kwenye skrini
// (Write the message to the screen)
andika("Jambo, " + jina + "!")
shughuli fibonacci(nambari){
  kama (nambari <= 1) {
    rudisha 1;
  }

  rudisha fibonacci(nambari - 1) + fibonacci(nambari - 2);
}

// Mtumizi ataandika nambari ya vifaa anavyotaka kuonyeshwa
// The user enters the number of Fibonacci numbers to output
wacha nambari = somaNambari("Nambari? ")
kwa i = 0 mpaka nambari {
  andika(fibonacci(i))
}
shughuli chupa(nambari, ukutani) {
  wacha mwisho = kama (niTupu(ukutani)) { " ukutani" } sivyo { "" }
  kama (nambari > 1) {
    andika("Vyupa " + Jina(nambari) + " vya pombe" + mwisho)
  } au (nambari == 1) {
    andika("Chupa " + Jina(nambari) + " cha pombe" + mwisho)
  } sivyo {
    andika("Pombe imemalizika :(")
  }
}

shughuli ondoa() {
  andika("Ondoa kimoja, pitisha karibu")
}

shughuli aya(nambari) {
  kama (nambari == 0) { rudisha }
  
  chupa(nambari)
  chupa(nambari, kweli)
  ondoa()
  chupa(nambari - 1)

  andika("")
  aya(nambari - 1)
}

aya(99)

You can try out Swahili here

You are viewing a single comment. View All
apuck003 (1)

Halo, nazungumza Kiswahili mucho nzuri. Sina anwani ya IP kwa hivyo usiangalie tafadhali. Ninafanya Kiswahili kizuri. Itatumia. Asante.