Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 1.68 KB

README.md

File metadata and controls

51 lines (38 loc) · 1.68 KB

Csq-Version3

This is one more version of Csq programming language which's syntax looks much similar to Python and much faster than Csq Version-2.

How does it works in backend?

It's processes are similar to the in the programming language Nim but here what it does it that a Intermediate code converter converts .csq to .csqm and later .csqm is converted to .cpp and it uses a prebuilt C++ compiler such as in this it uses clang++ to produce output.

What is new?

  • Speed is made faster than Csq version-2.
  • Functions can be used in main file.
  • Syntax for for loop is enhanced.
  • Speed of imported module is faster.
  • Code of CsqV2 couldn't be used in this.
  • You could add new tokens to it by changine base/token.h.
  • How to build Csq?

  • git clone https://github.com/AniketKumar2500/Csq-Version3.git
  • cd Csq-Version3 && bash build.sh
  • Some examples:

    Hello World

    print("Hello World")

    For loop

    for var i : range(11) so
    print(i,",")
    ends

    Functions

    def fizz(){
    return str("BUZZ")
    }

    Functions with arguments

    def fizz(str name){
    return name + " BUZZ"
    }
    fizz("Aniket")

    New keywords::

    ["go","so","ends","meth"]

    To comment

    to comment you could either use # or //

    What's inside base directory?

    In base directory all necessary header are present such as for code analysis, strings, arrays ...

    How to change add or remove operators:

    Go to base/token.h and there you will see a dictionary in which operators with their meaning in C++ are there. After changes compile csq.cpp and mcsq.cpp so that the changes can be applied.