Skip to main content

REPL of a simple, interpreted and statically-typed programming language.

Reason this release was yanked:

Not supported on python <3.10

Project description

Banner


Vadi is a simple, interpreted and dynamically-typed programming language. It comes with its own tool called a REPL, which lets you try out code quickly.

The interpreter which is the part of Vadi that runs your code, uses a technique named "Recursive Descent Parsing." This technique helps the interpreter understand your high-level code by creating a data-structure called a parse tree. Then, the interpreter uses this parse tree to figure out what your code is asking it to do.You can check out the Vadi's Syntax Grammar in BNF for more information.

Installation

Use pip or pipx to install vadi's REPL.

[!TIP] We recommend using pipx for installing vadi on a global level.

pipx install vadi

OR

pip install vadi

Now, run the REPL.

vadi

Grammar

The grammar is written in BNF(Backus Naur Form) notation.

<Interpreter> ::= <binary_expression>
                | <unary_expression>
                | <statement>
                | <expression>
                | <VAR>
                | <FLT>
                | <INT>

<binary_expression> ::= <expression> "+" <expression>
                      | <expression> "-" <expression>
                      | <expression> "*" <expression>
                      | <expression> "/" <expression>
                      | <expression> "=" <expression>

<unary_expression> ::= "+" <expression>
                     | "-" <expression>

<statement> ::= "DECL" <variable> "=" <expression>

<expression> ::= <term> "+" <term>
               | <term> "-" <term>

<term> ::= <factor> "*" <factor>
         | <factor> "/" <factor>

<factor> ::= "INT"
           | "FLT"
           | "(" <expression> ")"
           | <VAR>

Syntax

  • Unary operations

    +1
    -5
    
  • Binary operations

    56+23
    
  • Complex arithmetic operations

    1*2(4+5(5/6))
    
  • Variable declarations

    var int = 89;
    var float = 3.1415;
    var difference = int - 20;
    
  • Conditionals: if-else

    TODO: issue#2

  • Conditionals: loops

    TODO: issue#2

Supported datatypes

  • Integer
  • Float

Contributing

Issues and Pull Requests are definitely welcome! Check out Contributing guidelines to get started. Everyone who interacts with the vadi project via codebase, issue tracker, chat rooms, or otherwise is expected to follow the Code of Conduct.

License

This project is licensed under the MIT License. See the LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vadi-0.0.5.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vadi-0.0.5-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file vadi-0.0.5.tar.gz.

File metadata

  • Download URL: vadi-0.0.5.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.8.2-arch2-1

File hashes

Hashes for vadi-0.0.5.tar.gz
Algorithm Hash digest
SHA256 8ecc5dabd127538427c8be44e0288c1260d66a5365d13a34ea961dc5de459b2f
MD5 59919f2d33884e7229ff7eb6102303f8
BLAKE2b-256 9f2cfb571004b6e0a221ed3e6976f60ae25966b9f3308b101bb7bbb7c9c9ba3d

See more details on using hashes here.

File details

Details for the file vadi-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: vadi-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.8.2-arch2-1

File hashes

Hashes for vadi-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c974b60dfe996fb3695cac118d16ae20ea95f259ac04f2692cd66ad042a9c855
MD5 c5065ae5239ca79d3204d280bc89d2c2
BLAKE2b-256 39cce1e3fc61a7fed67282bfacb935640ba619ba8f292f2bc4e0c69828af96fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page