haki-script

haki-script is a interpreter for a custom language called haki-script

Usage

To install dependencies:

bun install

To run: With file name

bun run index.ts <path to file>
  • use file .haki extension

To run: With code

bun run index.ts

Syntax

Variables

  • let variable_name = value ;
  • const variable_name = value ;
  • can use boolens and numbers

Functions

  • fn function_name ( arguments ) { function_body }

Objects

  • { key: value, key: value }

Operators

  • add: +
  • subtract: -
  • multiply: *
  • divide: /

sample code

fn foo(a) {
    let x = 12-a;
    let y = 10;
    let z = x / y *2 ;
    z

}
let foo_Val = foo(12+2);
print(foo_Val);