Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/SaptakBhoumik/Peregrine
A blazing fast language for the blazing fast world(WIP)
https://github.com/SaptakBhoumik/Peregrine
compiler language peregrine peregrine-lang programming-language
Last synced: 29 days ago
JSON representation
A blazing fast language for the blazing fast world(WIP)
- Host: GitHub
- URL: https://github.com/SaptakBhoumik/Peregrine
- Owner: SaptakBhoumik
- License: mpl-2.0
- Created: 2021-07-18T10:32:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-18T15:25:07.000Z (6 months ago)
- Last Synced: 2024-11-11T18:25:24.783Z (about 1 month ago)
- Topics: compiler, language, peregrine, peregrine-lang, programming-language
- Language: C++
- Homepage: https://peregrine-lang.github.io/
- Size: 7.07 MB
- Stars: 1,459
- Watchers: 70
- Forks: 76
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
A Blazing-Fast Language for the Blazing-Fast world.
The Peregrine Programming Language
NOTE:-It has been discontinued. Please use mojo
Peregrine is a Compiled, Systems Programming Language, currently under development.
## 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 dialect of python which compiles to clean C++. It will have no garbage collector because it is a system programming language.
## Building/compiling Peregrine
### Requirements to build from source
- [clang compiler](https://clang.llvm.org/)
- [Meson](https://mesonbuild.com/)
- [Ninja](https://ninja-build.org/)# Compilation instructions
**1) Clone the main branch of https://github.com/peregrine-lang/Peregrine.git**
```bash
git clone https://github.com/peregrine-lang/Peregrine.git
```
**2) Cd into the directory**
```bash
cd Peregrine
```
**3) Build it**
```bash
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 ``./path_to_file``. Run it to see the result. Check the [can_comp.pe](https://github.com/peregrine-lang/Peregrine/blob/main/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 ``path_to_file.js``. Run the generated javascript using ``node path_to_file.js``. Check the [can_comp.js.pe](https://github.com/peregrine-lang/Peregrine/blob/main/can_comp.js.pe) file in the root directory to know what you can do with the js backend at this point## Progress
Currently we are working on the codegen and some Peregrine programs are working
## Example
Here is a small example for you to understand:
```py
def fib(n:int) -> int :
if n <= 0:
return 1
return fib(n-1) + fib(n-2)def main():
count:int = 0
res:int = 0while count < 40:
res = fib(count)
count++```
The `main` function is the entry point for the program.
## Have questions?
Cool, you can contact me via mail.
Email: [email protected]
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](https://github.com/Peregrine-lang/Peregrine/issues) to find a mission that resonates with you.
Please check [CONTRIBUTING.md](https://github.com/Peregrine-lang/Peregrine/blob/main/CONTRIBUTING.md) to learn how you can contribute.
# License
The Peregrine compiler is licensed under the [Mozilla Public License](https://github.com/Peregrine-lang/Peregrine/blob/main/LICENSE), which is attached in this repository