Git Product home page Git Product logo

zed-lang's Introduction

zed-lang

An simple and experimental programming language written in Python 3.

Roadmap

  • print statement
  • Variables
    • let statement
    • const statement (MAYBE)
    • del statement
  • Literals
    • Strings
    • Integers
    • Booleans
    • Floats
    • Undefined
  • Control structures
    • Conditionals
    • Loops

If you have an idea, open an issue or submit a pull request to add it on this roadmap.

Installation and usage

The language is written in pure Python and that's why is easy to install and use. Simple clone this repository and use python -m zed <filename> command to run a .zed file.

$ git clone https://github.com/nerdguyahmad/zed-lang
$ cd zed-lang
$ python -m zed test.zed

Documentation

Following is the documentation that documents current state of the language. This will be moved to a separate section when it gets big enough to get out of hand.

Statements

Statements are often referred as keywords. Each statement may or may not take one or more operands. For example, in print "Hello", print is the statement and "Hello" is the operand.

print <expr>

Prints the expr to the output.

  • expr can be anything printable such as a string literal or identifier.

let <id> = <value> // let <id>

Defines a new variable.

  • id is the name of variable
  • When a value is specified e.g let a = 1, the variable a gets the value of 1
  • When a value is NOT specified e.g let a, the variable a is defaulted to undefined sentinel

For example:

let a = 'Hello World'
let c
print a
print c

The output is:

Hello World
undefined

del <id>

Deletes a variable.

  • id is the name of variable to delete

For example:

let a = 'Hello World'
print a
del a
print a

The output is:

Hello World
On line 4, column 8, position 6:
error: identifer 'a' is not defined

Types

Strings

Strings are the most basic types. A string literal can be defined by wrapping the literal inside single or double quotes.

Undefined

Undefined (undefined) is a sentinel type used to represent undefined values. It can be referred to as simple undefined.

zed-lang's People

Contributors

izxxr avatar

Watchers

 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.