unit-language
·118 words·1 min
A small programming language with postfix notation using TypeScript and Deno.
Syntax #
Postfix #
In postfix for an operation of two arguments, you add two numbers to the stack, then the operator will pop the arguments off the stack. So adding 1 to 2 is the following.
1 2 +
Operators #
+addition-subtraction*multiply/divide
Built-in Functions #
sinsine functioncoscosine functiontantangent function
Built-in Constants #
eEuler’s numberpiPi
Equations #
Unit-language can evaluate more complicated expressions too.
2 3 + 9 - 8 * sin 5 -
Running #
deno run dev
Running Tests #
deno test
Running list #
deno lint
