Git Product home page Git Product logo

gurulang's Introduction

Guru Lang

Build

Guru lang is a fun programming language forked from BhaiLang :)

Do checkout the online Guru Lang PlayGround.


Installation

npm i -g gurulang

Usage

Create a new file (test.guru)

Edit the file with a text editor.
namskara guru
  helu guru "Hello Guru";
aythu guru

Run

gurulang test.guru

Output

Hello Guru

Documentation

General

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


This will be ignored

namskara guru
// Write code here
aythu guru

This too

Variables

Variables can be declared using nodu guru.


namskara guru
  nodu guru a = 10;
  nodu guru b = "two";
  nodu guru c = 15;
  a = a + 1;
  b = 21;
  c *= 2;
aythu guru

Types

Numbers and strings are like other languages. Null values can be denoted using nalla. nija and sullu are the boolean values.


namskara guru
  nodu guru a = 10;
  nodu guru b = 10 + (15*20);
  nodu guru c = "two";
  nodu guru d = 'ok';
  nodu guru e = nalla;
  nodu guru f = nija;
  nodu guru g = sullu;
aythu guru

Built-ins

Use helu guru to print anything to console.


namskara guru
  helu guru "Hello World";
  nodu guru a = 10;
  {
    nodu guru b = 20;
    helu guru a + b;
  }
  helu guru 5, 'ok' , nija , sullu;
aythu guru

Conditionals

Gurulang supports simple if else construct , guru eega block will execute if condition is nija and illandre guru block will execute if condition is sullu.


namskara guru
  nodu guru a = 10;
  guru eega (a < 25) aadre{
   helu guru "a is less than 25";
  } illandre guru {
   helu guru "a is greater than or equal to 25";
  }
aythu guru

Loops

Statements inside guru ellivargu blocks are executed as long as a specified condition evaluates to nija. If the condition becomes sullu, statement within the loop stops executing and control passes to the statement following the loop. Use saak bidu guru to break the loop and mundhe nodu guru to continue within loop.


namskara guru
  nodu guru a = 0;
  guru ellivargu (a < 10) {
   a += 1;
   guru eega (a == 5) aadre{
    helu guru "olaginda helu guru ", a;
    mundhe nodu guru;
   }
   guru eega (a == 6) aadre{
    saak bidu guru;
   }
   helu guru a;
  }
  helu guru "done";
aythu guru

gurulang's People

Contributors

aniketsingh0104 avatar ristri avatar ankitchouhan1020 avatar dependabot[bot] avatar sheshavpd avatar lakhankumawat avatar madhus-1605 avatar deep-codes avatar shubh0107 avatar susmita-dey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.