Skip to content
This repository has been archived by the owner on Nov 24, 2024. It is now read-only.

SaptakBhoumik/Peregrine

Repository files navigation

Note - We are rewriting the entire thing so please check the rewrite branch

Peregrine

GitHub Repo stars GitHub issues GitHub contributors

Peregrine is a compiled programming language currently under development. Documentation is coming soon.

-----------------------------------------------------

Purpose and intent

-----------------------------------------------------

Why am I creating this language?

I am creating it to have the simplicity of Python with the efficiency of C.

-----------------------------------------------------

Goals

  • Ease of use
  • Fast
  • Highly modular
  • Occupies less memory
  • Compiled

-----------------------------------------------------

How does it work?

You can consider it to be a superset of C which compiles to clean C. So valid C code is also valid Peregrine code (the language is named Peregrine). It will have no garbage collector because it is a system programming language but it will be very easy to use so there will be less chance of a memory leak.

-----------------------------------------------------

Building/compiling Peregrine

-----------------------------------------------------

Requirements to build from source

Compilation instructions

1)Clone the rewrite branch of https://github.com/peregrine-lang/Peregrine.git

git clone -b rewrite https://github.com/peregrine-lang/Peregrine.git

2)Cd into the directory

cd Peregrine

3)Build it

meson builddir
cd builddir
ninja

This will create the binary of the compiler named ./peregrine.elf in the builddir folder

C++ backend To compile it using the c++ backing just run ./peregrine.elf compile path_to_file.pe .It will create the executable named ./a.out. Run it to see the result. Check the can_comp.pe file in the root directory to know what you can do with the c++ backend at this point

JS Backend To use the javascript backend use the following command ./peregrine.elf compile path_to_file.js.pe -js. It will create the javascript file named index.js. Run the generated javascript using node index.js. Check the can_comp.js.pe file in the root directory to know what you can do with the js backend at this point

-----------------------------------------------------

Primary implementation language

It is written in c++ -----------------------------------------------------

Progress

Currently we are working on the codegen and some Peregrine programs are working

-----------------------------------------------------

Example

Here is a small example for you to understand:

def main():
    print("Hello, World!")

The main function is the entry point for the program.

-----------------------------------------------------

Have questions?

Cool, you can contact me via mail.
Email: saptakbhoumik@gmail.com
Discord : https://discord.gg/CAMgzwDJDM

-----------------------------------------------------

Want to contribute?

Great, go ahead and make the changes you want, then submit a new pull request

Take a look at the open issues to find a mission that resonates with you.

Please check CONTRIBUTING.md to learn how you can contribute.

If you create any new file make sure to comment your name in the file as shown Original author: Your name

-----------------------------------------------------

License

The Peregrine compiler is licensed under the Mozilla Public License, which is attached in this repository