Code Monkey home page Code Monkey logo

modiscript's Introduction

ModiScript

Acche din aa gaye
Try the script in the ModiScript web UI

Vision

A Programming language is a wonderful medium of communication between man and machine. Many such languages are created, keeping in mind the comfort of the programmer. Such languages fulfill the computational needs of the world and serve their purpose. Somewhere in the midst of all this, the “fun” side of programming is lost.
Our project, “Modi Script” is one such esoteric language created with the sole intention of making use of quotes by our beloved PM Narendra Modi. The star feature of this language is that the language consists entirely of remarkable statements made by the PM. The language is dynamically typed and turing complete, sprinkled with words of wisdom by our PM!

Features

This scripting language includes some "ideas" of Shri Narendra Modi.

  • No import of code is allowed, we have to support him in Make in India.
  • No comments are allowed in code, everything should be clean as per Swachh Bharat Abhiyaan.
  • No redundant variables allowed, 'less government more governance.'
  • Like his speeches, all codes should start with mitrooon
  • All codes should end with acche din aa gaye, otherwise it's congress rule error.
  • The programming language is totally case insensitive because we should not believe discrimination based on higher or lower castes/cases.
  • No floating point numbers allowed, you can either be right front or left front, there is no mid-way.
  • you can use the --help flag for very discreet help.

Installation

To install, download the repo using:

git clone https://github.com/VPanjeta/ModiScript

Then add ModiScript to your PATH as:

  1. Temporary: Write export PATH=$PATH:/path/to/ModiScript to terminal.
  2. Permanent: Append export PATH=$PATH:/path/to/ModiScript to the end of your ~/.bashrc file.
    And then type
source ~/.bashrc

Execution

Write code in file with extension .chai
For execution type MODI filename.chai

Syntax and Grammar

Arithmetic, relational and logical operators can be used in their raw form as defined in c/c++ (i.e. '+' for addition '-' for subtraction '&&' for logical and '||' for logical or and so on..)
Modi-fied operators

  • sach for True
  • jhoot for False
  • plus for addition
  • substract for subtraction
  • taimes for multiplication
  • break for division
  • modi for mod
  • kam for less than
  • zyada for greater than
  • barabar for equal to
  • aur for logical AND
  • ya for logical OR

Flow of Control

  • { } define a block as in any other programming language.
  • if is defined as agar and else as nahi toh. if else ladder can be defined as agar (condition) { } nahi toh agar (condition) { } nahi toh{ }.
  • Looping constructs can be defined using jab tak condition hai { } (be careful here, we have been going according to hindi grammar that dictates the loop will exit when the condition is true, thus the loop executes till the condition is false not true)

General Syntax

  • Any quote in double or single inverted commas is taken as a string constant. eg "Modiji ka seena 56 inch ka hai".
  • Assignments to a variable can be done using hai keyword, x = y can be depicted as x y hai, or congress scamster hai .
  • The use of the word "hai" is optional so the statement can be defined as BJP winner which translates to BJP = winner and hai can be appended to end of any line to make it more grammarly suitable to hindi.
  • Output to STDOUT can be given using bhaiyo aur behno. bhaiyo aur behno "Hum UP me sarkaar bana chuke hai." will print "Hum UP me sarkaar bana chuke hai."
  • Input from STDIN can be taken using mann ki baat. mann ki baat RSS will take input into a variable named RSS.
  • Any excessive words defined in a line outside the scope of any operators or syntax will be neglected so you can write pure hindi codes and make them grammatically correct and give a pure Hindi Code demo in UN Assembly.

Example Code

Mitrooon
agar baat sach hai
    bhaiyo aur behno "Modi sabse achhe pradhan mantri hai."
nahi toh
    bhaiyo aur behno "Rahul Gandhi ko PM banaiye"
Achhe din aa gaye

Output: "modi sabse achhe pradhan mantri hai."

Example codes can be found in /example.

Creators

Ideas and Contributions for alpha version implemented by

Web UI over flask service implemented by

  • Daksh Miglani @DakshMiglani

  • You are welcome if you feel the need to contribute. Just clone the repo and send a pull request!

modiscript's People

Contributors

0xdaksh avatar abhyantrika avatar akashgosai avatar devparapalli avatar harshagarwal19 avatar meanmachin3 avatar narengogi avatar onlinejudge95 avatar pandawhocodes avatar parthshyara avatar sohilladhani avatar soumalya1857 avatar spazewalker avatar srirampura-kencha avatar stevemann2705 avatar vpanjeta avatar wryonik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modiscript's Issues

Feature to take audio/voice input

Some Mitra might want to simply input a recording of His speech or actually speak out his/her (mitra's) mann ki baat xD

Adding pyaudio and some NLP with the existing lexing and parsing should get this working!

Acche din aa gaye

Consider submitting to ESO

I think this language would qualify under the category of JokeLang on esolangs.org.

I'm not associated with esolangs.org in any way, although I do occasionally browse around that wiki for some sense of hilarity. Consider putting your work up there?

👍

Support for windows !

In Linux it's showing error ! MODI Command not found . I've exported $path
Also add support for poor windows nibbas

Online Demo Site

Hi, I just created a very basic (crappy really) but working website, that allows you to run modiscript code.

It is accessible on: https://modiscript.netlify.com/

PS: I know stdin doesn't work yet, i worked on it pretty late last night.

Provide zen of modiscript

How about providing a module named eif (Everything Is Fine) with a similar functioning as provided by this library in python. We can use it to showcase all features. Here is what seems like a good fit.

>>> import eif
No import of code is allowed, we have to support him in Make in India.
No comments are allowed in code, everything should be clean as per Swachh Bharat Abhiyaan.
No redundant variables allowed, 'less government more governance.'
Like his speeches, all codes should start with mitrooon
All codes should end with acche din aa gaye, otherwise it's congress rule error.
The programming language is totally case insensitive because we should not believe discrimination based on higher or lower castes/cases.
No floating point numbers allowed, you can either be right front or left front, there is no mid-way.
you can use the --help flag for very discreet help.

TypeError: required field "type_ignores" missing from Module

On executing .chai files with "MODI filename.chai", the following error is encountered:

user@ubuntu:~/Documents/ModiScript/examples$ MODI election.chai
Traceback (most recent call last):
  File "/home/user/Documents/ModiScript/MODI", line 32, in <module>
    main()
  File "/home/user/Documents/ModiScript/MODI", line 27, in main
    ms.execute(filename)
  File "/home/user/Documents/ModiScript/modiscript/api.py", line 23, in execute
    ast_module = self._compile_file(value, value_type)
  File "/home/user/Documents/ModiScript/modiscript/api.py", line 20, in _compile_file
    return compile(parse_out, "<ast>", "exec")
TypeError: required field "type_ignores" missing from Module

Environment

OS: Ubuntu 20.04.1 LTS

Python: 3.8.2

Throws RuntimeError when executed

All the sample examples in /examples folder, throws RuntimeError: generator raised StopIteration when tried to execute.
Here is the call trace
Traceback (most recent call last): File "/Users/sjaganatha/ModiScript/modiscript/MODI", line 50, in <module> main() File "/Users/sjaganatha/ModiScript/modiscript/MODI", line 46, in main execute(filename) File "/Users/sjaganatha/ModiScript/modiscript/MODI", line 28, in execute ast_module = compile_file(filename) File "/Users/sjaganatha/ModiScript/modiscript/MODI", line 15, in compile_file lex_out = Lexer(filename).analyze() File "/Users/sjaganatha/ModiScript/modiscript/lexer.py", line 75, in analyze lexemes = list(lexer)

Publish this to PyPI

I think we can publish this as a library on PyPI, with a cli entry point

So people can directly do,

❯ pip install ModiScript
❯ MODI program.chai

Then even the website can be put into a separate repo, with ModiScript as a dependency.

I have some experience and I can set up a PR if you like the idea.

Wrong boolean operators and recursion error

Sach should be for false and jhoot should be for true. "Recursion depth exceeded" should be renamed to "Hypocrisy ki bhi seema hoti hai"

When a civilian(array) goes out of bounds, AntiNationalError should be thrown instead of IndexOutOfBoundError

GDP.chai

Your GDP.chai broked when I entered the current GDP i.e. -24% 🤣.

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.