About | How to use | Stack | Documentation of the language | Autor
KLN is an interpreted and minimalist programming language inspired by Haskell. It was designed to promote faster and more efficient development by using only operators to reduce the amount of code required. With a concise and powerful syntax, KLN is ideal for those who want to write code quickly and concisely.
The following tools were used in this project:
# Runs the code inside the file example.kln
$ make kn file=example.kln
Example of an addition:
# KLN Language
$ Num + Num # example 5 + 5
Example of a subtraction:
# KLN Language
$ Num - Num # example 5 - 5
Example of a multiplication:
# KLN Language
$ Num * Num # example 5 * 5
Example of a division:
# KLN Language
$ Num *|* Num # example 5 *|* 5
Example of a remainder of division:
# KLN Language
$ Num *%* Num # example 5 *%* 5
Example of an exponential:
# KLN Language
$ Num ^ Num # example 5 ^ 5
Example of an and:
# KLN Language
$ Bool and Bool # example True or True
Example of an or:
# KLN Language
$ Bool or Bool # example True or False
Example of a not:
# KLN Language
$ !Bool # example !True
Example of an if:
# KLN Language
$ ? exp ?! exp | exp # example ? 5 == 5 ?! 2 + 2 | 2 - 1
Example of a less than:
# KLN Language
$ Num < Num # example 2 < 3
Example of a greater than:
# KLN Language
$ Num > Num # example 3 > 2
Example of a less than or equal to:
# KLN Language
$ Num <= Num # example 2 <= 3
Example of a greater than or equal to:
# KLN Language
$ Num >= Num # example 3 >= 2
Example of an equal:
# KLN Language
$ Num == Num # example 3 == 3
Example of a not equal:
# KLN Language
$ Num != Num # example 3 != 2
Example of a lambda:
# KLN Language
$ (-\ Var : Type -> exp) e # example (-\ x :Num -> x + 1) 6
Example of a create (Let to Haskell):
# KLN Language
$ Create Var = Num in exp # example create x = 5 in x + 2
Example of a List:
# KLN Language
$ [exp] # example [1, 2, 3] o [2 + 2, 3 + 5] or [true, false, true]
Made by Pedrinhonitz in the Programming Languages classes - UFFS