Logo Lanfrica

tallninja/Swlang

Domain:

natural language processing

Record type:

software
Creator:
tal
Host:
Swahili based programming language # Swlang A swahili based programming language ## Introduction Swlang is just another programming language that uses swahili keywords and actions. This is just a fun side project that will help anyone understand the inner workings of compilers and interpreters ## How it Works! ```text // This is my first swlang program sema("Salamu, Dunia!"); ``` Translation - sema -> say - Salamu -> Hello - Dunia -> World ### Features Swlang is a high-level dynamically typed programming language 1. **Dynamic Typing** - Variables can store values of any type, and a single variable can even store values of different types at different times. 2. **Automatic Memory Management** - Swlang uses a Garbage Collector (GC) for memory management. Therefore there is no need to stress yourself with memory leaks, the GC will take care of that for you ### Data Types #### 1. Boolean Swlang uses ```ukweli``` and ```uwongo``` which are Swahili words that translate to ```true``` and ```false``` respectively in English. ```text ukweli; //true uwongo; //false ``` #### 2. Numbers Swlang only features double-precision floating point numbers since they can represent a wide range of integers that covers a lot of teritory while keeping things simple. ```text 12; //integer 12.59; //decimal ``` #### 3. Strings String literals are enclosed in double quotes. ```text "Salamu, Dunia!"; // string literal "J"; // character ``` #### 4. Null ```hakuna``` represents "null"/"no value". ### Expressions There are various expressions supported in Swlang #### 1. Arithmetic Swlang features the basic arithmetic expressions from other popular language. ```text 1 + 2; //addition - kujumuisha a - b; //subtraction - kuondoa c * d; //multiplication - kuzidisha 4 / 2; //division - kugawa ``` #### 2. Comparison and Equality These operations always return a boolean ```text a a; //greater than a = a; //grater than or equal to a == b; // equal to ``` #### 3. Logical Operators ```text !ukweli; //equates t …

Languages