OkLang is an interpreted Turing Complete programming language, created as a minor semester project. Ok_Lang is built as a minimalistic language with decent Runtime, Parsing and Syntax Error handling.
- Dynamic Type.
- Scalar values (Number, String, Boolean).
- Block variable scope.
- User-defined and Built-in functions with closure.
- Control Flow (Branching and Looping).
- Expression Evaluation as per standard precedence.
Use Latest JDK version for best support. (JDK 18.0.x used during development)
git clone https://github.com/gitKashish/ok_langBuild using the provided bash script or manually compile package.
bash ./build_ok.shRun the following command without source file to run REPL.
bash ./ok.sh source/code/file/path.ok- Variables are by default initialized to
nil. printandclockare the only two built-in functions at the moment.
Declaring variable
// This is a comment.
// It only works for a single line.Declaring variable
var myVariable;
myVariable = 10 * 20 + (10 - 10);Branching Control Flow
if (expression) { ... }Looping Control Flow
while (expression) { ... }
for (decl; expression; increment/decrement) { ... }Function Declaration
fun functionName (argument/s) {
...
return expression;
}