Peregrine - A blazing fast language for the blazing fast world(WIP)

Overview


A Blazing-Fast Language for the Blazing-Fast world.




The Peregrine Programming Language

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

Compilation instructions

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

git clone 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

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():
    printf("Hello, World!")

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 to find a mission that resonates with you.

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

License

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

Comments
  • Call for contributers

    Call for contributers

    Hi, I am Saptak Bhoumik and I would like to say that we need more contributors to complete this project as fast as possible, if you are interested please fork this repo and contribute. If you have any question please contact me [email protected]

    help wanted 
    opened by SaptakBhoumik 20
  • Refined argument parser

    Refined argument parser

    Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.

    Please provide enough information so that others can review your pull request: I made some changed to the argument parser. Now, it will be easy to expand the cli with more commands. But, I have changed how the arguments are parsed in the cli. An example 👇

    swallow compile <filename> --o=<output-file>
    

    Explain the details for making this change. What existing problem does the pull request solve? The pull request cleans up the mess in the main function and allows the cli to expand with more commands

    Code formatting The V code was formatted with v fmt. The C code was beautified with clang_format

    Closing issues

    Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).

    opened by pranavbaburaj 14
  • v peregrine.v doesn't work

    v peregrine.v doesn't work

    I installed it just like described on the Github site, along with the dependencies but it just won't work whenever I type "v peregrine.v" it just does nothing I'm using Ubuntu 20.04 and I have reinstalled Peregrine like 7 times already... image

    opened by DweetOnWeed 13
  • Add logos and banner to 'graphics' folder and insert banner into READ…

    Add logos and banner to 'graphics' folder and insert banner into READ…

    …ME.md

    Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.

    Please provide enough information so that others can review your pull request:

    • Logos, a banner, Inkscape's .svg file, and a README.md file is added in the graphics folder.
    • The banner is inserted into the README.md (NOT THE README.md IN graphics FOLDER).
    • Logos with different dimensions in .png format are stored in graphics/logos folder.
    • The README.md file in the graphics folder contains a description of the logos and the banner.
    • There is all dark version of the logos and banner named with suffix _dark.
    • View the logos and banner at here

    Explain the details for making this change. What existing problem does the pull request solve?

    • Where is the logo?

    Code formatting

    Closing issues

    Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).

    opened by RechieKho 12
  • Comparison docs

    Comparison docs

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    No problems

    Describe the solution you'd like A clear and concise description of what you want to happen.

    I would like to work towards learning swallow as primary language and assist in writing docs and implementing self hosting of the language and stay a consistent contributor to this amazing project I did read contribution.md and didn't see anything about my question which is why I ask here

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Whether I can or cannot help with the documentation maybe the documentation might have this but I'd be happy make a domain or go under a docs sub domain and write comparisons of swallow and python with examples and explanations

    Additional context Add any other context or screenshots about the feature request here.

    If I could work towards these goals I would love to become a consistent contributor for swallow as I had my own similar ideas but my experience programming is nowhere near capable and I can see this being what I was looking for and taking a lead in tech a few years from now

    documentation 
    opened by AcousticCh 11
  • Lot's of questions (future, memory mgmt, metaprogramming, etc.)

    Lot's of questions (future, memory mgmt, metaprogramming, etc.)

    Please refer to https://github.com/aardappel/lobster/issues/136 , read the thread to understand why I'm asking these questions and please answer them here :wink:.

    Additionally I'd like to ask:

    a) Why don't you want to join Lobster or Cython or even RPython devs instead of starting from scratch? b) How do you want to support parallel computation on multiple CPU/GPU/FPGA cores? This is by far the most important point utterly needed as explained in https://github.com/vlang/v/discussions/11608 because it affects nearly all design decisions made when designing a language. This ranges from "each statement & expression is run in parallel" (Kind, ParaSail, BMDFM, DawnCC - actually not a new language but a smart compiler supporting even non-uniform platforms like big.LITTLE, ... ) through channel/pipe-based parallelism (Dao, Go, V, POSIX sh, Til, ...) to non-builtin support (i.e. pthreads, actors, structured concurrency or nurseries, etc.).

    opened by dumblob 8
  • Error when compiling peregrine on Windows

    Error when compiling peregrine on Windows

    Describe the bug

    When compiling the Peregrine source with the v compiler:

      v peregrine.v
    

    I get the following error:

    c:\Peregrine\Peregrine>v peregrine.v builder error: 'libtcc.h' not found

    To Reproduce

    1. Install v and peregrine exactly as described
    2. v peregrine.v
    3. See error

    Expected behavior Successfull compilation of peregrine

    Desktop (please complete the following information):

    • OS: Windows 10/11
    • V 0.2.4 43931be

    Additional info The file libtcc.h lives in C:\v\thirdparty\tcc\libtcc

    opened by Ivo-Balbaert 5
  • Add GH action to run the tests automaticaly.

    Add GH action to run the tests automaticaly.

    Add all steps necessary to run the tests automatically.

    An action that compiles the language already exists.

    In the action file, you will find some lines that were commented out. You can either fix the bugs and use this code or delete it and rewrite that part of the action file.

    opened by ClientCrash 5
  • asm test failing

    asm test failing

    Describe the bug Asm test gives an error.

    To Reproduce Steps to reproduce the behavior:

    1. Run test_runner.py

    Expected behavior No error.

    Screenshots

    If applicable, add screenshots to help explain your problem.

    temp.c: In function ‘main’:
    temp.c:279:1: error: impossible constraint in ‘asm’
     __asm__ ( "addl %%ebx, %%eax;" : "=a" ( add ) : "a" ( arg1 ) , "b" ( arg2 ) ) ;
     ^~~~~~~
    

    Desktop (please complete the following information):

    • OS: [Raspi os]
    • Version [Buster(10)]
    opened by Ccode-lang 5
  • Slight grammar and related edits for README.md

    Slight grammar and related edits for README.md

    • Corrected capitalisation for language names.
    • Full stops.
    • Odds and ends.

    Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.

    Please provide enough information so that others can review your pull request:

    Explain the details for making this change. What existing problem does the pull request solve?

    Code formatting

    Closing issues

    Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).

    opened by anirudhgray 5
  • Isn't this more of a transpiler than a programming language?

    Isn't this more of a transpiler than a programming language?

    I saw that your code generates C instead of assembly. Doesn't this make it a transpiler, rather than a compiler? Also, it will be as fast as C when you generate C :).

    opened by frankhart2018 5
  • C++ compiler giving errors instead of peregrine handling function arguments correctly.

    C++ compiler giving errors instead of peregrine handling function arguments correctly.

    when i do not give a function all the arguments needed, the c++ compiler will give me errors. Peregrine should check this and give an error not the c++ compiler. code

    def function(arg)->int:
    	printf("arg: %d\n", arg)
    	return 1
    
    
    def main()->int:
    	function()
    	return 0
    

    error

    temp.cc: In function ‘int main()’:
    temp.cc:19:92: error: no matching function for call to ‘____P____P________home____dev____projects____Peregrine____builddir____main___pefunction(____P____exception_handler*&)’
       19 |     ____P____P________home____dev____projects____Peregrine____builddir____main___pefunction(____Pexception_handlers);
          |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
    temp.cc:13:9: note: candidate: ‘template<class auto:3> int64_t ____P____P________home____dev____projects____Peregrine____builddir____main___pefunction(auto:3, ____P____exception_handler*)’
       13 | int64_t ____P____P________home____dev____projects____Peregrine____builddir____main___pefunction(auto ____P____P____arg,____P____exception_handler* ____Pexception_handlers)  noexcept {
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    temp.cc:13:9: note:   template argument deduction/substitution failed:
    temp.cc:19:92: note:   candidate expects 2 arguments, 1 provided
       19 |     ____P____P________home____dev____projects____Peregrine____builddir____main___pefunction(____Pexception_handlers);
          |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
    
    
    opened by InsaneMiner 4
Owner
Peregrine
Peregrine
Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP)

ice_libs Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP) Brief ice_libs is collection of Single-Header C

Rabia Alhaffar 118 Dec 6, 2022
WIP: ESP32 powered robot dog, quadruped robot. This is just code, hardware in the other repositories

Small Robot dog (quadruped) Hardware ESP32 IMU (not implemented) 12 servos TowerPro mg90d (hope it will work) Two 18650 Software Arduino IDE compatibl

Gleb Devyatkin 74 Dec 22, 2022
WIP - Material para uma live stream que estou preparando

C para devs PHP ATENÇÃO: Este projeto ainda está em progresso. A estrutura e conteúdo aqui provavelmente ainda estão muito confusas. Eu não recomendo

Níckolas Daniel da Silva 10 Feb 24, 2022
A crappy hook on SpAcceptLsaModeContext that prints incoming auth attempts. WIP

About Hooks for intercepting SpAcceptLsaModeContext to print any incoming authentication attempts to Beacon. The hook is installed on the Lsass heap t

Austin Hudson 0 Dec 11, 2021
WIP Plan 9 port of Simon Tatham's Portable Puzzle Collection

This is the README accompanying the source code to Simon Tatham's puzzle collection. The collection's web site is at <https://www.chiark.greenend.org.

Sean Hinchee 4 Sep 16, 2021
MIDI remapping plugin (WIP)

Wolf MidiCurve Wolf MidiCurve is a MIDI remapping plugin. It can be built as an LV2 or VST plugin and as a standalone Jack application. Build manually

Wolf Plugins 8 Oct 21, 2022
Emulator of soviet chess computer, WIP 🚧

elektronika-im01 - emulator of soviet chess computer "Электроника ИМ-01" is a Soviet era chess computer. Produced on "Svetlana" (ПАО «Светлана») since

Nikita Zimin 2 Dec 14, 2022
[WIP] Differentiable Simulation of Soft Multi-body Systems (NeurIPS 2021)

Differentiable Simulation of Soft Multi-body Systems Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, Ming C. Lin [Paper] [Code] Updates The C++ backend s

YilingQiao 26 Dec 23, 2022
WIP / DIN-rail compatible WiFi security camera with additional features (doorbell detection, magnetic / reed switch door & PIR sensor...) that sends you alerts on Telegram if someone unauthorised breaks into your house.

WIP / DIN-rail compatible WiFi security camera with additional features (doorbell detection, magnetic / reed switch door & PIR sensor...) that sends you alerts on Telegram if someone unauthorised breaks into your house.

François Leparoux 2 Dec 18, 2021
Northstar-dedicated - Docker container for the Northstar dedicated server. Also includes general notes on running the dedi on Linux. WIP.

northstar-dedicated Docker image for the Northstar dedicated server. Not ready yet (it'll probably be another day or two). Versioning Tentative. Stabl

null 83 Jan 6, 2023
[WIP] Experimental C++14 multithreaded compile-time entity-component-system library.

ecst Experimental & work-in-progress C++14 multithreaded compile-time Entity-Component-System header-only library. Overview Successful development of

Vittorio Romeo 450 Dec 17, 2022
Base Repository for Voxeloop (wip)

voxeloop-base A CMake project for GLFW , Glad, ImGui and glm. This project is meant to simplify the import of the OpenGL related libraries GLFW, ImGui

Rujal Acharya 4 Mar 20, 2022
The Wren Programming Language. Wren is a small, fast, class-based concurrent scripting language.

Wren is a small, fast, class-based concurrent scripting language Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a fami

Wren 6.1k Dec 30, 2022
This is the repo for the microcontroller part of project Cleanurge - a scalable IoT powered waste management system, our solution towards a greener world.

Cleanurge A scalable waste management system powered by IoT. There are 3 repositories for the entire cleanurge system in total cleanurge-mcu: Containi

Developer Student Clubs KGEC 6 Oct 11, 2021
#PICOmputer - World first Raspberry RP2040 PICO - QWERTY & IPS devkit

PICOmputer #PICOmputer - World first Raspberry RP2040 PICO - QWERTY & IPS devkit https://www.pcbway.com/project/shareproject/_PICOmputer____World_firs

Peter Misenko 52 Dec 30, 2022
BfaCore : Reforged is a open-source project for World of Warcraft

BfaCore Reforged BfaCore : Reforged is a open-source project for World of Warcraft, currently supporting the 8.3.7 (build 35662) game version. Why Bfa

Boralus Project 60 Jan 3, 2023
Othello AI which got 1st in the world

Egaroucid 4 - Othello AI Abstract Egaroucid 4 is an Othello AI. You can play this AI on the Web. There are former versions: https://github.com/Nyanyan

Takuto Yamana 7 Apr 7, 2022
The world's worst kernel module

antipatterns.ko: the world's worst kernel module caution: DO NOT LOAD THIS MODULE This kernel module contains numerous security vulnerabilities. It is

David Malcolm 288 Dec 9, 2022