-
Notifications
You must be signed in to change notification settings - Fork 20
Home
Welcome to the rajini++ wiki! rajini++ (a.k.a rajiniPP, pronounced rajini plus plus) is a simple programming language created as a hobby project and dedicated to the one and only Superstar. The language, inspired by ArnoldC, has its syntax based on the iconic dialogues of Superstar Rajinikanth. This wiki acts as the official guide to the rajini++ programming language.
rajini++(a.k.a rajiniPP) is the programming language and rajinipp
is the interpreter for the rajini++ programming language.
This project develops the rajinipp
interpreter for the rajini++ language and is written written in python🐍. Simply put, the project parses the rajini++ code, converts it to its equivalent python code and executes it.
- currently, the only way to install the rajinipp interpreter is to clone the repo and build and install the wheel yourself. You need to have at least python 3.8 installed.
- clone project:
git clone https://github.com/aadhithya/rajiniPP.git
- change directory to rajiniPP:
cd rajiniPP
- We use poetry to manage dependencies. install poetry:
pip install poetry
- generate wheel:
poetry build
- install rajini++:
pip install dist/rajinipp-0.0.1-py3-none-any.whl
- test installation:
rajinipp version
The pre-built wheels will soon be made available on GitHub and elsewhere.
rajini++ programs are stored in files with the .rpp
extension.
the rajinipp
package needs to be installed in order to run rajini++ programs.
-
rajini++ programs can be run using the following commands:
-
rajinipp run path/to/program.rpp
(or) -
python -m rajinipp run path/to/program.rpp
where the program to run is stored in thepath/to/program.rpp
file.
-
-
The
rajinipp
package also allows users to see the the tokens from the lever. This can be achieved using the following command:-
rajinipp tokenize path/to/program.rpp
(or) python -m rajinipp tokenize path/to/program.rpp
-
-
More about the
rajinipp
package coming soon.
Every rajini++ program resides within the main method. The main method is of the form:
LAKSHMI START
[statements]
KATHAM KATHAM
where,
-
LAKSHMI START
: denotes the start of the main method. -
KATHAM KATHAM
: denotes the end of the main method.
- Every statement in the rajini++ language terminates with a semicolon(
;
).- Example:
DOT "Hello, world";
printHello, world
to the console.
- Example:
- Every command supported by rajini++ is capitalised.
rajini++ currently supports the following features:
The statement DOT
can be used to print variables, strings, etc.
- The hello world program:
LAKSHMI START
DOT "Hello, world!";
KATHAM KATHAM
will print Hello, world!
to the console.
- when printing an expression, rajini++ will automatically evaluate the expression before printing it.
- Example:
DOT 5*5;
will output25
to the console.
-
rajini++ also supports printing multiple variables/epressions using the same
DOT
statement. This can be done by specifying the expressions/variables one after the other separated by a space. -
Example:
DOT "Hello, world! 5 + 5 =" 5+5;
will outputHello, world! 5 + 5=10.0
to the console.
-
rajini++ supports variables of type
string
andnumber
. Akin to javascript, all numbers are implicitly represented asfloat
. -
A value has to be assigned to a variable whenever it is created.
-
NOTE: Variable names can only contain small letters!
-
Variables can be created using the following command:
AANDAVAN SOLLRAN <variable-name> ARUNACHALAM SEIYARAN <value>;
-
Example program:
LAKSHMI START
AANDAVAN SOLLRAN myvar ARUNACHALAM SEIYARAN 25;
DOT "myvar = " myvar;
KATHAM KATHAM
will output myvar = 25
to the console.
rajini++ supports all basic math ops: add(+
), subtract(-
), multiply(*
), divide(/
) and modulo(%
).
- Example: math ops between two numbers and assigning it to a variable:
LAKSHMI START
AANDAVAN SOLLRAN addvar ARUNACHALAM SEIYARAN 25 + 15;
AANDAVAN SOLLRAN subvar ARUNACHALAM SEIYARAN 25 - 15;
AANDAVAN SOLLRAN mulvar ARUNACHALAM SEIYARAN 5 * 5;
AANDAVAN SOLLRAN divvar ARUNACHALAM SEIYARAN 5 / 5;
AANDAVAN SOLLRAN modvar ARUNACHALAM SEIYARAN 51 / 5;
DOT "addvar = " addvar;
DOT "subvar = " subvar;
DOT "mulvar = " mulvar;
DOT "divvar = " divvar;
DOT "modvar = " modvar;
KATHAM KATHAM
will output the following to the console:
addvar = 40.0
subvar = 10.0
mulvar = 25.0
divvar = 1.0
modvar = 1.0
rajini++ • Created by Aadhithya Sankar • asankar.xyz