Introduction to the Tafat Programming Language
Tafat is a simple programming language designed for educational purposes. It uses a unique syntax inspired by the Amazigh Tifinagh script, making it a great tool for learning programming concepts in Tamazight language.
Features of Tafat
- Simple syntax for beginners.
- Support for variables, loops, and conditional statements.
- Integration of Tifinagh characters with Latin transliteration.
Fundamentals of the Tafat Language
The Tafat language has a straightforward syntax that is easy to learn. Below are some of the key constructs and keywords used in the language:
1. Variables
Variables are declared using the keyword ⴰⵊⵊ
. For example:
ⴰⵊⵊ x = 10; ⴰⵊⵊ y = "Hello"; ⴰⵊⵊ z = true;
2. Displaying Output
Use the ⴰⵔⴰ
keyword to display output. For example:
ⴰⵊⵊ name = "John"; ⴰⵔⴰ "Welcome to Tafat!"; ⴰⵔⴰ "Hello, " + name; // Will print: Hello, John ⴰⵔⴰ x;
String interpolation allows you to embed variable values directly in strings using the $
symbol followed by the variable name. This is more convenient than string concatenation:
ⴰⵊⵊ age = ⵓⴽⵛⵉⵎ_ⵓⵎⵎⵉⴷ; ⴰⵔⴰ age; // Will print: 25 (if age is 25) ⴰⵔⴰ "Your age is $age"; // Will print: Your age is 25 (if age is 25)
3. Conditional Statements
Conditional statements are written using the ⵎⴽ
keyword. For example:
ⵎⴽ x > 5 { ⴰⵔⴰ "x is greater than 5"; }
4. Loops
Loops are created using the ⴰⵍⵙ
keyword. For example:
ⴰⵍⵙ 5 ⵜⴽⴽⴰⵍ { ⴰⵔⴰ "This is a loop!"; }
5. Input
The Tafat language supports multiple types of input:
ⵓⴽⵛⵉⵎ_ⵓⵎⵎⵉⴷ
: Input as an integer.ⵓⴽⵛⵉⵎ_ⴰⵎⵔⴰⵡ
: Input as a floating-point number.ⵓⴽⵛⵉⵎ_ⴰⵣⵔⴰⵔ
: Input as a string (alternative keyword).
Examples:
ⴰⵊⵊ age = ⵓⴽⵛⵉⵎ_ⵓⵎⵎⵉⴷ; ⴰⵔⴰ "Your age is $age"; ⴰⵊⵊ height = ⵓⴽⵛⵉⵎ_ⴰⵎⵔⴰⵡ; ⴰⵔⴰ "Your height is $height meters.";
6. Operators
Tafat supports the following operators:
- Arithmetic:
+
,-
,*
,/
,%
- Comparison:
==
,!=
,>
,<
How to Use the Tafat Compiler
Follow these steps to get started with the Tafat compiler:
- Download the Compiler: Click here to download the Tafat Compiler.
-
Extract the downloaded
.rar
file to a folder on your computer. -
Add the path of the extracted folder to your system's environment variables:
- On Windows: Search for "Environment Variables" in the Start menu, edit the "Path" variable, and add the folder path.
- On Linux/Mac: Add the folder path to your
.bashrc
or.zshrc
file.
- Open a terminal or command prompt and navigate to the folder containing your Tafat code.
-
Write your Tafat code in a file with the
.tft
extension. For example:
ⴰⵊⵊ x = 10; ⴰⵔⴰ "Hello, Tafat!"; ⵎⴽ x > 5 { ⴰⵔⴰ "x is greater than 5"; }
-
Run the compiler using the following command:
tafc your_file.tft
- The compiler will execute the code, displaying the output of your Tafat program.
Example Output
For the above code, the output will be:
Hello, Tafat! x is greater than 5
Conclusion
Tafat is a fun and educational way to learn programming in Amazigh language. Download the compiler and start coding today!
ⴼⵍ ⴰⵖ ⴽⵔⴰ ⵏ ⵓⵖⴼⴰⵡⴰⵍ :)