Skip to main content

Programming Language

Project description



English - عربي - русский - 日本語 - 官话
español - हिंदी - italiano

KAGSA Programming Language

KAGSA is a new Interpreted programming language based on Python, the language will be practical and reliable in your projects, take a look at its advantages.

Advantages

  • The Ease

    • Kagsa is considered one of the most easy languages, if you are a programmer will not need more than half an hour to learn it !! :)
  • Allow some forbidden things in programming

    • Kagsa allows many things that other languages prohibit, some of them :
      • Allow some symbols in variable name (@$^~?)
      • Variable name can start with number

Negatives

  • Speed

    • Kagsa is based on Python, so it is a little slower, slow is at the beginning when the program is start.

Kagsa Story

Of course, KAGSA was not KAGSA from the beginning, I was thinking of calling it PlusScript and its file extension was .ps and later changed it to .pscript, when I searched for plusscript in Google I found two previous programming languages with this name and decided to change it to KAGSA , but in The first version I had problems publishing on pip, was the first version with the number 0.1.5 and it did not contain classes and it contained some stupid things so it was deleted and we got the new version 1.x.x.

Versions

How it Works ?

It contains a main parts :

  • Lexer
    • It translates kagsa codes into data that contains a key and a value : ['KEYWORD','var']
  • Syntax Checker
    • It checks the syntax of the data coming out of the Lexer.
  • Parser
    • Arranges all data to be Python code.
  • Compiler
    • It does more than one task, the most important of which is that it prepares everything to run Python codes coming out of the parser.

Installation

PyPi ( All OS )

Run this command your terminal :

pip install kagsa

Windows

Go to last kagsa releases and download kagsa-win-1.1.0.zip, Copy kagsa folder to any path you want and add this path to Environment Variables :

This PC > Properties > Advanced system settings > Environment Variables > System variables > Path > New > Paste The Path > Ok > Ok > Ok

Note : if kagsa command isn't run on your CMD, try to restart you computer

Make .kg files always open with kagsa.exe

Linux

Go to last kagsa releases and download kagsa-linux-1.1.0.zip, Take a look at readme.txt

Note : Make sure you have installed python3.

Termux

Download kagsa-termux-1.1.0.zip, read readme.txt

Note : Make sure you have installed python3.

Command Line Usage

Run kagsa program :

kagsa file.kg

Compile a library :

kagsa -l lib.kg -o output.kgl

Check version :

kagsa -v
kagsa --version

Check for updates :

kagsa -u
kagsa --updates

Help :

kagsa -h
kagsa --help

Examples :

Hello World

write 'Hello World'

OOP

class App {
    func @constructor (@this) {
        write 'Welcome To App\n'
        var @this.num = 0
    }
    func addOne (@this) {
        @this.num+=1
    }
    func takeOne (@this) {
        @this.num-=1
    }
}

var game = App()
game.addOne()
game.addOne()
game.addOne()
game.takeOne()

write game.num

Factorial

func factorial (num) {
    if num < 0 {
        write 'error'
        return ''
    }elseif num == 0 {
        return 1
    }else{
        var data = 1
        for i -> nlist(num, zero=false) {
            var data=data * i;
        }
        return data;
        
    }
}
write factorial(10)

Documents

You can find full documents in docs folder

Thanks To :

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

kagsa-1.1.0.tar.gz (24.3 kB view hashes)

Uploaded Source

Built Distribution

kagsa-1.1.0-py3-none-any.whl (32.3 kB view hashes)

Uploaded Python 3

Supported by

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