heluguru

0.1.1 • Public • Published

Helu Guru

Total alerts Language grade: JavaScript Build Build Build

Guru lang is a toy programming language written in Typescript.


Installation

npm i -g heluguru

Usage

Create a new file


Edit the file with a text editor. You can also try out your code on Helu Guru PlayGround

hi guru
  helu guru "Hello guru";
bye guru

Run

heluguru test.guru

Output

hello guru

Documentation

General

hi guru is the entrypoint for the program and all program must end with bye guru. Anything outside of it will be ignored.


This will be ignored

hi guru
// Write code here
bye guru

This too

Variables

Variables can be declared using guru idu.


hi guru
  guru idu a = 10;
  guru idu b = "two";
  guru idu c = 15;
  a = a + 1;
  b = 21;
  c *= 2;
bye guru

Types

Numbers and strings are like other languages. Null values can be denoted using khali. sari and tappu are the boolean values.


hi guru
  guru idu a = 10;
  guru idu b = 10 + (15*20);
  guru idu c = "two";
  guru idu d = 'ok';
  guru idu e = khali;
  guru idu f = sari;
  guru idu g = tappu;
bye guru

Built-ins

Use helu guru to print anything to console.


hi guru
  helu guru "Hello World";
  guru idu a = 10;
  {
    guru idu b = 20;
    helu guru a + b;
  }
  helu guru 5, 'ok', khali , sari , tappu;
bye guru

Conditionals

Heluguru supports simple if else construct , ond vele guru block will execute if condition is sari and illa andre guru block will execute if condition is tappu.


hi guru
  guru idu a = 10;
  ond vele guru (a < 25) {
   helu guru "a is less than 25";
  } illa andre guru {
   helu guru "a is greater than or equal to 25";
  }
bye guru

Loops

Statements inside guru yavaga blocks are executed as long as a specified condition evaluates to sari. If the condition becomes tappu, statement within the loop stops executing and control passes to the statement following the loop. Use nilsu guru to break the loop and mundhe nodu guru to continue within loop.


hi guru
  guru idu a = 0;
  guru yavaga (a < 10) {
   a += 1;
   ond vele guru (a == 5) {
    helu guru "andar se helu guru ", a;
    mundhe nodu guru;
   }
   ond vele guru (a == 6) {
    nilsu guru;
   }
   helu guru a;
  }
  helu guru "done";
bye guru

Package Sidebar

Install

npm i heluguru

Weekly Downloads

3

Version

0.1.1

License

MIT

Unpacked Size

7.95 kB

Total Files

3

Last publish

Collaborators

  • v1sh