Skip to main content
  1. Projects/

unit-language

·118 words·1 min
Jake Roggenbuck
Author
Jake Roggenbuck
I am currently studying Computer Science

unit lang dark mode
unit lang light mode

TypeScript
TypeScript
Deno JS

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 #

  • sin sine function
  • cos cosine function
  • tan tangent function

Built-in Constants #

  • e Euler’s number
  • pi Pi

Equations #

Unit-language can evaluate more complicated expressions too.

2 3 + 9 - 8 * sin 5 -

Running #

deno run dev

image

Running Tests #

deno test

Running list #

deno lint

Testings Running #

image