Skip to content

mohammadreza33/peylang

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peyman Language

A programming language to honor our beloved friend, Peyman.

Sample

-- in yek commente :D

-- ba chiz moteghayer tarif mikonim
chiz folan = 12;

-- injoori print mishe
chaap folan;

-- injoori voroodi migire
begir folan;

-- while loop ham dare
ta folan < 20 {
   -- if else ham dare
   agar folan % 2 == 0 {
      chaap 1;
   } vagarna {
      chaap 0;
   }
   
   folan += 1;
}

-- string
chaap 'salam donya!';

chiz esm = 'peyman';
chaap esm + ' khar ast';

-- string length
chaap andaze(esm);

-- string get item
chaap esm[0];
chaap esm[1];
chiz akhar = esm[andaze(esm)-1];
chaap akhar;

-- logical and or
agar (folan > 10 va folan < 20) ya folan == 40 {
    chaap 200;
}

You can find more samples here.

Syntax Highlighter

Installing Peylang

Windows

On Windows machines, you can use PeySetup.
Don't forget to restart your machine after installing. Then open cmd and type:

peyman your_file_name.pey

If it didn't recognize the command, add it manually to PATH variables and retry.

Linux

On linux machines, download this.
Don't forget chmod +x peyman

Docker

Also you can use docker to build and use Peylang!

git clone https://github.com/amiremohamadi/peylang.git
cd peylang
docker build -t peylang .
docker run -it peylang

From source

we use cmake as build system not anymore!

Building on a Unix-like system

  1. Make sure you have installed all the dependencies:

    • g++ 4.3 or later
    • GNU make
    • git
    • flex
    • bison

On an ubuntu machine You can install them like this (but make sure the required version is installing):

$ sudo apt-get -y install git-all build-essential cmake flex bison
  1. Clone the source with git:
$ git clone https://github.com/amiremohamadi/peylang.git
$ cd peylang
  1. Build & Run:
$ make
$ ./peyman

About

Peyman programming language

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 77.0%
  • Yacc 14.2%
  • Lex 5.3%
  • Makefile 1.9%
  • Vim Script 1.3%
  • Dockerfile 0.3%