Logo Lanfrica

j-waweru/kpl

Type de record:

software
Créateur:
J W
Hôte:
The kikuyu Programming Language # The Kikuyu Programming language Inspired by DreamBerd and based on the Monkey language. Welcome to the Kikuyu Programming language (abbr kpl), a not blazingly fast language written in python. Here are its features. Syntax is made to resemble the Kikuyu language as much as possible though sometimes I could not find equivalent translations. Once you are done reading through you can check out the examples --- ## Features Be fancy. In kpl every line ends with a dollar sign. ### Declarations Declarations are made using the Reka keyword. To see all the types make sure to read the examples. > [!NOTE] > All keywords are written in Title Case ```python Reka a = 10$ Reka b = a + 5$ Reka name = 'John'$ Reka arr = [10,20,30]$ Reka foobar = fn(x, y) ``` ### Strings You can declare strings using either single or double quotes. ```python 'Hello'$ "World"$ ``` Strings support the following operations: Concatenation using the + operator. ```python 'Hello' + ' ' + 'World!' # Hello World! ``` You can also perform deconcatenation using minus operator. ```python 'Hello' - 'World!$ # "HeWrd!" 'abcdef' - 'bd'$ # "acef" 'abc' - 'xyz'$ # "abcxyz" ``` ### Integers Integers support 5 equals comparison operators. ```python "1 == 1"$ # True : always true "1 === 1"$ # True : type of a is same as that of b "1 ==== 1"$ # True : value of a equal that of b "1 ===== 1"$ # True : a is b "1 ====== 1"$ # False : always false # And that means "1 == 2"$ # True "1 === 2"$ # True "1 ==== 2"$ # False "1 ===== 2"$ # False "1 ====== 2"$ # False ``` ### Floats Floats are a relic of an archaic programming past and don't even apply to real world objects. After all have you ever seen half a ng'ombe. Therefore Kpl has no support for them. ### Booleans Kpl supports two boolean operators: Ma and Maheni used as follows: ```python !5$ # False !Maheni$ # True (1 1) # if Anjiriria # other languages use start or { Akorwo (1 [!NOTE] > To i …

Languages