KPT is short for 'Kempense Programmeer Taal' and is a custom scripting language written in TypeScript.
Check examples for some functionalities.
Run using deno
deno run -A main.ts
To exit the repl use
deruit
deno run -A main.ts file.kpt
See installation guide.
kpt
kpt file.kpt
KPT Keyword | TypeScript Equivalent |
---|---|
efkes | let |
altij | const |
just | true |
nijust | false |
nikske | null |
pi | Math.PI |
zegt() | console.log() |
waduurist() | new Date(Date.now()) |
funkse | function |
as | if |
aans | else |
{array}.derbij() | {array}.push() |
{array}.deraf() | {array}.pop() |
{array}.draaitoem() | {array}.reverse() |
{array}.teerste() | {array}.shift() |
+
: Addition++
: Increment-
: Subtraction--
: Decrement*
: Multiplication/
: Division%
: Modulus**
: Exponentiation//
: Floor division
<
: Less than (only numbers)>
: Greater than (only numbers)<=
: Less than equals (only numbers)>=
: Greater than equals (only numbers)==
: Equal to!=
: Not equal to
+=
: Addition assignment-=
: Subtraction assignment*=
: Multiplication assignment/=
: Division assignment%=
: Modulo assignment**=
: Exponential assignment//=
: Floor division assignment
en
: Logical ANDof
: Logical ORni
: Logical NOT
- No need for
;
(but should be possible) - Functions return the last evaluated statement automatically
- Strings can be defined using
'
and"
- Place comments using
#