All you need to know about Peregrine programming language | Python like language

    Peregrine is a new programming language with Python-like syntax and C-like execution speed. Peregrine programming language is currently under development. This programming language has started in Oct 2021. It can be one kind of alternative to python and C. Peregrine has the simplicity of Python with the efficiency of C. It gets Executed in 1.06 secs only.

Peregrine - A python-like programming language


    Quick Reading about Peregrine Language

    - Peregrine is a new programming language with Python-like syntax and C-like execution speed.
    - It's easy to use, quick and takes less Compilation time.
    Peregrine uses less memory.
    Ccode is a new feature in Peregrine that allows you to run C code. 
    The type interface feature is one of the most recent additions.
    Inline assembly is used in Peregrine language.  
    - Peregrine executed in 1.06 secs only and  Python get Executed in 32.30 secs.

    Depth Reading about Peregrine Language


    Advantages of Peregrine Language:

    - It's easy to use.
    - Quick
    - Highly Modular.
    - Compilation in less time.
    - It uses less memory.

    Let's look at some interesting features of Peregrine Programming Language:

    Ccode

    - Ccode is a new feature in Peregrine that is currently available for usage. 
    - Ccode is a Peregrine feature that allows you to run C code.  
    - Ccode can be used to import and use C libraries in Peregrine.

    Type interface (Automatic detection of the type of an expression in a formal language)

    - The type interface feature is one of the most recent additions to this computer language. 
    - It is now feasible for developers to create Peregrine code in an easy manner because of this capability. 
    - It is possible to automatically- determine the kind of expression in a formal language using this capability. 

     If/else/match

    - Despite the fact that this is a standard feature found in most languages, it however takes time to execute in this programming language.

    Inline Assembly

    - Inline assembly is used in Peregrine language. 
    - Some compilers provide an inline assembler as a feature that allows low-level assembly code to be included in a program alongside code written in a higher-level language like C.

    Python VS Peregrine Programming language

        The syntax of Peregrines is fairly close to that of Python, and it is trans-compiled to C, making it as fast as C. Two programs are given below, one in Peregrine and the other in Python.

    The program, written in Peregrine language 

    def fib(int x) -> int :
        if x <= 0:
            return 1
        return fib(x-1) + fib(x-2)

    def main():
        count = 0 # Peregrine has type inference!
        int res = 0

        while count < 40:
            res = fib(count)
            count++
    function return types can be omitted.

    The program, written in Python language:


    def fib(x):
        if x <= 0:
            return 1
        return fib(x-1) + fib(x-2)

    res = 0
    for c in range(0, 40):
        res = fib(c)

    "How much faster is Peregrine programming language?" you may be wondering. So, to answer your question, here are the outcomes:

    - Peregrine executed in 1.06 secs only and  Python get Executed in 32.30 secs.
    - Peregrine is considerably faster than Python.

    I'm sure you've discovered some interesting and useful information about Peregrine programming language. Keep visiting this blog for more awesome learning.

    I hope this information is helpful for you.
    👌Keep Learning |💕Keep Sharing | 💪Stay Safe!

    Post a Comment

    0 Comments