Peelpreter


NamePeelpreter JSON
Version 1.7.4 PyPI version JSON
download
home_pageNone
SummaryA interpreter written in Python for the language, Monkey
upload_time2024-06-22 01:03:36
maintainerJeebak Samajdwar
docs_urlNone
authorJeebak Samajdwar
requires_python>=3.7
licenseGPL
keywords monkey interpreter ast treewalker vm programing language language
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ### Contribution
This is my first time having a public repo on github so I'm not sure on how to go on about this.
If anyone would like to contribute they are free to open issue, where i will discuss it with them.

### Contribution Suggestions
Features on the [features to add](#features-planned-to-be-added) list, ones you think are missing and think should be there, etc. are all welcome.

Adding a issue for the feature fist, where things could be decided whether the feature is add-able to the language or interpreter, would be appreciated though.

# Monkey
Peelpreter is a interpreter based on the language Monkey specified in the book `Writing an Interpreter in Go`.
It is not designed to be the fastest implementation but instead a (mostly) readable one. 
I, personally don't find encapsulating every little function of a program in classes to be particularly readable.
Hence, I have kept things bare-bone functions where I thought it made sense and used classes to encapsulate data like C-Structs
and sometimes to store methods.

### Features
Peelpreter supports all features of the canon implementation as well as some more.
They are:-
1. Variables
2. If expressions
3. First-Class Functions
4. Loops. Eg: `while` and `foreach`
4. Closures
5. Array
6. Hash Map (Dictionary)
7. Builtin Functions
8. Array and Hash mutability
9. Improved `puts` function

### Features Planned to be added
Some features which I wish for in a programming language are not present yet in this.
Suppport for them will be slowly added ~as soon as type annotations are improved for the existing code base~.
They are:-
- [x] Input function
- [x] Type conversion
- [x] While Loops
- [x] For Loops
- [x] Constants
- [ ] Add New Keyword `list`.
      This would cause loops to return an array of the results of the last expressions of each iteration of the loop 
      instead of returning the result of the last expression of the last iteration of the loop.
- [ ] Add New Keyword To Make Objects Immutable
- [ ] Optional Parameters
- [ ] Structs
- [ ] Chaining variable assignments. E.g, `let x = y = 7`
- [ ] Import System
- [ ] Extension modules using Python

I might also added a Type Checker later on, but thats upto the future.

### Changelog
- 1.6.0: Added `input`, `num` and `str`.
- 1.6.1: Fixed a bug which caused the interpreter to crash when a number was divided by zero
- 1.6.2: Fixed a bug with `str` which caused it to add double quotes (`"`) around a `String` object each time it was called on it
- 1.7.0: Added `while` loops
- 1.7.1: Fixed crash from missing a `=` in `let` statements
- 1.7.2: Added `foreach` loops
- 1.7.3: Fixed unintended behaviour of variables not being modified globally
- 1.7.4: Added new keyword `const` for declaration of constants

## Installation
For installation of the package run,
```
pip install peelpreter
```
Or if you would prefer to build and install yourself for a more up-to-date version, clone the repository and cd into it,
```
git clone https://github.com/GogiBoy102/Peelpreter.git
cd Peelpreter
```
then run,
```
python3 -m build
```
If `build` is not already installed onto the system then install it with,
```
pip install --upgrade build
```
After the build process ends, cd into `dist` and install the tar with,
```
cd dist
pip install peelpreter-<version>.tar.gz
```
And, voila! Peelpreter has been installed! For usage, follow the next section.

## Usage
Peelpreter comes with a script called `monkey` which is the entry point for the interpreter and also the reccomended way for it to be used.

Files in monkey usually have the extension ".mon".

`monkey`, when executed with no command line arguments starts the REPL for Monkey. However, it can also execute files if the path to those files are supplied as a command line argument.
The examples directory can be looked at for example programs writen in Monkey.
```
monkey (for starting a repl)
```
```
monkey /path/to/file (for running a file)
```

## License
Peelpreter is license under the GNU General Public License version 3 or above with it also being copyrighted by `Jeebak Samajdwar`


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "Peelpreter",
    "maintainer": "Jeebak Samajdwar",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "monkey, interpreter, ast, treewalker, vm, programing language, language",
    "author": "Jeebak Samajdwar",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/8c/d4/7f92758294248c48d4de48b1890d673741a28dc1a688375c9531a00d1268/peelpreter-1.7.4.tar.gz",
    "platform": null,
    "description": "### Contribution\nThis is my first time having a public repo on github so I'm not sure on how to go on about this.\nIf anyone would like to contribute they are free to open issue, where i will discuss it with them.\n\n### Contribution Suggestions\nFeatures on the [features to add](#features-planned-to-be-added) list, ones you think are missing and think should be there, etc. are all welcome.\n\nAdding a issue for the feature fist, where things could be decided whether the feature is add-able to the language or interpreter, would be appreciated though.\n\n# Monkey\nPeelpreter is a interpreter based on the language Monkey specified in the book `Writing an Interpreter in Go`.\nIt is not designed to be the fastest implementation but instead a (mostly) readable one. \nI, personally don't find encapsulating every little function of a program in classes to be particularly readable.\nHence, I have kept things bare-bone functions where I thought it made sense and used classes to encapsulate data like C-Structs\nand sometimes to store methods.\n\n### Features\nPeelpreter supports all features of the canon implementation as well as some more.\nThey are:-\n1. Variables\n2. If expressions\n3. First-Class Functions\n4. Loops. Eg: `while` and `foreach`\n4. Closures\n5. Array\n6. Hash Map (Dictionary)\n7. Builtin Functions\n8. Array and Hash mutability\n9. Improved `puts` function\n\n### Features Planned to be added\nSome features which I wish for in a programming language are not present yet in this.\nSuppport for them will be slowly added ~as soon as type annotations are improved for the existing code base~.\nThey are:-\n- [x] Input function\n- [x] Type conversion\n- [x] While Loops\n- [x] For Loops\n- [x] Constants\n- [ ] Add New Keyword `list`.\n      This would cause loops to return an array of the results of the last expressions of each iteration of the loop \n      instead of returning the result of the last expression of the last iteration of the loop.\n- [ ] Add New Keyword To Make Objects Immutable\n- [ ] Optional Parameters\n- [ ] Structs\n- [ ] Chaining variable assignments. E.g, `let x = y = 7`\n- [ ] Import System\n- [ ] Extension modules using Python\n\nI might also added a Type Checker later on, but thats upto the future.\n\n### Changelog\n- 1.6.0: Added `input`, `num` and `str`.\n- 1.6.1: Fixed a bug which caused the interpreter to crash when a number was divided by zero\n- 1.6.2: Fixed a bug with `str` which caused it to add double quotes (`\"`) around a `String` object each time it was called on it\n- 1.7.0: Added `while` loops\n- 1.7.1: Fixed crash from missing a `=` in `let` statements\n- 1.7.2: Added `foreach` loops\n- 1.7.3: Fixed unintended behaviour of variables not being modified globally\n- 1.7.4: Added new keyword `const` for declaration of constants\n\n## Installation\nFor installation of the package run,\n```\npip install peelpreter\n```\nOr if you would prefer to build and install yourself for a more up-to-date version, clone the repository and cd into it,\n```\ngit clone https://github.com/GogiBoy102/Peelpreter.git\ncd Peelpreter\n```\nthen run,\n```\npython3 -m build\n```\nIf `build` is not already installed onto the system then install it with,\n```\npip install --upgrade build\n```\nAfter the build process ends, cd into `dist` and install the tar with,\n```\ncd dist\npip install peelpreter-<version>.tar.gz\n```\nAnd, voila! Peelpreter has been installed! For usage, follow the next section.\n\n## Usage\nPeelpreter comes with a script called `monkey` which is the entry point for the interpreter and also the reccomended way for it to be used.\n\nFiles in monkey usually have the extension \".mon\".\n\n`monkey`, when executed with no command line arguments starts the REPL for Monkey. However, it can also execute files if the path to those files are supplied as a command line argument.\nThe examples directory can be looked at for example programs writen in Monkey.\n```\nmonkey (for starting a repl)\n```\n```\nmonkey /path/to/file (for running a file)\n```\n\n## License\nPeelpreter is license under the GNU General Public License version 3 or above with it also being copyrighted by `Jeebak Samajdwar`\n\n",
    "bugtrack_url": null,
    "license": "GPL",
    "summary": "A interpreter written in Python for the language, Monkey",
    "version": "1.7.4",
    "project_urls": {
        "Repository": "https://github.com/GogiBoy102/Peelpreter"
    },
    "split_keywords": [
        "monkey",
        " interpreter",
        " ast",
        " treewalker",
        " vm",
        " programing language",
        " language"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "45a7f2788eafe5e2fed49179acfc04d34a6662a51a08e5968c17e0ad6889d860",
                "md5": "e403adf9fb0e717befda052570fdfe2d",
                "sha256": "f9cea03a033df4076304faeb86d490e4e1524989ec3c19ed348d98d434b77e7e"
            },
            "downloads": -1,
            "filename": "Peelpreter-1.7.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e403adf9fb0e717befda052570fdfe2d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 41292,
            "upload_time": "2024-06-22T01:03:33",
            "upload_time_iso_8601": "2024-06-22T01:03:33.863152Z",
            "url": "https://files.pythonhosted.org/packages/45/a7/f2788eafe5e2fed49179acfc04d34a6662a51a08e5968c17e0ad6889d860/Peelpreter-1.7.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8cd47f92758294248c48d4de48b1890d673741a28dc1a688375c9531a00d1268",
                "md5": "ee468bb745f814bddb674080b0f33330",
                "sha256": "5aef8f4d466fde15ec6437395176d1bbc67139b02b0c8c4a57cdf384eb6940d7"
            },
            "downloads": -1,
            "filename": "peelpreter-1.7.4.tar.gz",
            "has_sig": false,
            "md5_digest": "ee468bb745f814bddb674080b0f33330",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 29936,
            "upload_time": "2024-06-22T01:03:36",
            "upload_time_iso_8601": "2024-06-22T01:03:36.531691Z",
            "url": "https://files.pythonhosted.org/packages/8c/d4/7f92758294248c48d4de48b1890d673741a28dc1a688375c9531a00d1268/peelpreter-1.7.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-22 01:03:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "GogiBoy102",
    "github_project": "Peelpreter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "peelpreter"
}
        
Elapsed time: 0.43925s