# mehtap
Lua 5.4 programming language implementation in Pure Python
[![Latest version on PyPI](https://img.shields.io/pypi/v/mehtap)](https://pypi.org/project/mehtap/)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/mehtap)](https://pypi.org/project/mehtap/)
[![Codacy Grade Badge](https://app.codacy.com/project/badge/Grade/c8799d9203354667a97ba39aca2c75f2)](https://app.codacy.com/gh/EmreOzcan/mehtap/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![Codacy Coverage Badge](https://app.codacy.com/project/badge/Coverage/c8799d9203354667a97ba39aca2c75f2)](https://app.codacy.com/gh/EmreOzcan/mehtap/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)
[![checks/master](https://img.shields.io/github/check-runs/emreozcan/mehtap/master?logo=github&label=checks%2Fmaster)](https://github.com/emreozcan/mehtap/actions/workflows/test.yml)
[![docs](https://readthedocs.org/projects/mehtap/badge/?version=latest&style=flat)](https://mehtap.readthedocs.io/en/latest/)
## Status
mehtap is in an early alpha stage. Since there is active development,
API changes may happen without any special notice.
Please pin your dependencies using a specific commit hash.
## Installation
mehtap is supported on Python 3.10+.
First, make sure you have a Python environment set up.
```bash
# in the shell
poetry add mehtap # if using python-poetry.org
pipenv install mehtap # if using pipenv.pypa.io
pip install mehtap # straight pip.pypa.io
```
## What does mehtap have?
* Everything in the [Lua 5.4 grammar](https://lua.org/manual/5.4/manual.html#9)
is supported.
* There are utility functions to convert values
[from Python to Lua](https://mehtap.readthedocs.io/en/latest/py2lua.html)
and
[from Lua to Python](https://mehtap.readthedocs.io/en/latest/lua2py.html).
* Most of the standard library is supported. (100% support is planned.)
<details>
<summary>Basic Functions (25/25)</summary>
- [x] `assert()`
- [x] `collectgarbage()` — Does nothing.
- [x] `dofile()`
- [x] `error()`
- [x] `_G`
- [x] `getmetatable()`
- [x] `ipairs()`
- [x] `load()` — No binary chunks, no upvalues and no _ENV.
- [x] `loadfile()` — see `load()`.
- [x] `next()`
- [x] `pairs()`
- [x] `pcall()`
- [x] `print()`
- [x] `rawequal()`
- [x] `rawget()`
- [x] `rawlen()`
- [x] `rawset()`
- [x] `select()`
- [x] `setmetatable()`
- [x] `tonumber()`
- [x] `tostring()`
- [x] `type()`
- [x] `_VERSION`
- [x] `warn()`
- [x] `xpcall()`
</details>
<details>
<summary>Input and Output Facilities (17/18)</summary>
- [x] io.close()
- [x] io.flush()
- [x] io.input()
- [x] io.lines()
- [x] io.open()
- [x] io.output()
- [ ] io.popen()
- [x] io.read()
- [x] io.tmpfile()
- [x] io.type()
- [x] io.write()
- [x] file:close()
- [x] file:flush()
- [x] file:lines()
- [x] file:read()
- [x] file:seek()
- [x] file:setvbuf() — Does nothing.
- [x] file:write()
</details>
<details>
<summary>Operating System Facilities (8/11)</summary>
- [x] os.clock()
- [ ] os.date()
- [ ] os.difftime()
- [x] os.execute()
- [x] os.exit()
- [x] os.getenv()
- [x] os.remove()
- [x] os.rename()
- [x] os.setlocale()
- [ ] os.time()
- [x] os.tmpname()
</details>
## What's the catch?
There are some differences with the specification of the reference manual.
They are:
- garbage collection,
- frame scope.
For the most part,
behaviour differences with the reference implementation are only allowed if the
reference manual does not specify the behaviour.
For example, the exact formatting of error messages is not specified in the
reference manual, so it is allowed to be different.
Also, since this is a Python implementation, it is ***SLOW***.
## Acknowledgements
I want to hereby thank the following people for their
(uninformed) contributions to the project:<br>
(If you are reading this, hello! 👋)
- **[Blake Bourque]** for creating [Lua by Example], a great resource for learning
Lua which also serves in the test suite of mehtap.
- **[oatmealine]** for putting together [this awesome gist][gist] explaining how
metamethods and metavalues override operations in detail.
[Blake Bourque]: https://techplexlabs.com/
[oatmealine]: https://oat.zone/
[Lua by Example]: https://luabyexample.techplexlabs.com/
[gist]: https://gist.github.com/oatmealine/655c9e64599d0f0dd47687c1186de99f
---
Copyright (c) 2024 Emre Özcan
Raw data
{
"_id": null,
"home_page": "https://github.com/emreozcan/mehtap",
"name": "mehtap",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "lua, parser, interpreter",
"author": "Emre \u00d6zcan",
"author_email": "emre@emreis.com",
"download_url": "https://files.pythonhosted.org/packages/ae/a7/cd83a06941d2e50d7720eaed3e72eda2a763d9a6aa561d0a34e17cee534f/mehtap-0.1.2.tar.gz",
"platform": null,
"description": "# mehtap\n\nLua 5.4 programming language implementation in Pure Python\n\n\n[![Latest version on PyPI](https://img.shields.io/pypi/v/mehtap)](https://pypi.org/project/mehtap/)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/mehtap)](https://pypi.org/project/mehtap/)\n\n[![Codacy Grade Badge](https://app.codacy.com/project/badge/Grade/c8799d9203354667a97ba39aca2c75f2)](https://app.codacy.com/gh/EmreOzcan/mehtap/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)\n[![Codacy Coverage Badge](https://app.codacy.com/project/badge/Coverage/c8799d9203354667a97ba39aca2c75f2)](https://app.codacy.com/gh/EmreOzcan/mehtap/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)\n[![checks/master](https://img.shields.io/github/check-runs/emreozcan/mehtap/master?logo=github&label=checks%2Fmaster)](https://github.com/emreozcan/mehtap/actions/workflows/test.yml)\n[![docs](https://readthedocs.org/projects/mehtap/badge/?version=latest&style=flat)](https://mehtap.readthedocs.io/en/latest/)\n\n## Status\n\nmehtap is in an early alpha stage. Since there is active development,\nAPI changes may happen without any special notice.\nPlease pin your dependencies using a specific commit hash.\n\n## Installation\n\nmehtap is supported on Python 3.10+.\nFirst, make sure you have a Python environment set up.\n\n```bash\n# in the shell\npoetry add mehtap # if using python-poetry.org\npipenv install mehtap # if using pipenv.pypa.io\npip install mehtap # straight pip.pypa.io\n```\n\n## What does mehtap have?\n\n* Everything in the [Lua 5.4 grammar](https://lua.org/manual/5.4/manual.html#9)\n is supported.\n* There are utility functions to convert values\n [from Python to Lua](https://mehtap.readthedocs.io/en/latest/py2lua.html)\n and\n [from Lua to Python](https://mehtap.readthedocs.io/en/latest/lua2py.html).\n* Most of the standard library is supported. (100% support is planned.)\n\n <details>\n <summary>Basic Functions (25/25)</summary>\n\n - [x] `assert()`\n - [x] `collectgarbage()` — Does nothing.\n - [x] `dofile()`\n - [x] `error()`\n - [x] `_G`\n - [x] `getmetatable()`\n - [x] `ipairs()`\n - [x] `load()` — No binary chunks, no upvalues and no _ENV.\n - [x] `loadfile()` — see `load()`.\n - [x] `next()`\n - [x] `pairs()`\n - [x] `pcall()`\n - [x] `print()`\n - [x] `rawequal()`\n - [x] `rawget()`\n - [x] `rawlen()`\n - [x] `rawset()`\n - [x] `select()`\n - [x] `setmetatable()`\n - [x] `tonumber()`\n - [x] `tostring()`\n - [x] `type()`\n - [x] `_VERSION`\n - [x] `warn()`\n - [x] `xpcall()`\n </details>\n\n <details>\n <summary>Input and Output Facilities (17/18)</summary>\n\n - [x] io.close()\n - [x] io.flush()\n - [x] io.input()\n - [x] io.lines()\n - [x] io.open()\n - [x] io.output()\n - [ ] io.popen()\n - [x] io.read()\n - [x] io.tmpfile()\n - [x] io.type()\n - [x] io.write()\n - [x] file:close()\n - [x] file:flush()\n - [x] file:lines()\n - [x] file:read()\n - [x] file:seek()\n - [x] file:setvbuf() — Does nothing.\n - [x] file:write()\n </details>\n\n <details>\n <summary>Operating System Facilities (8/11)</summary>\n\n - [x] os.clock()\n - [ ] os.date()\n - [ ] os.difftime()\n - [x] os.execute()\n - [x] os.exit()\n - [x] os.getenv()\n - [x] os.remove()\n - [x] os.rename()\n - [x] os.setlocale()\n - [ ] os.time()\n - [x] os.tmpname()\n </details>\n\n## What's the catch?\n\nThere are some differences with the specification of the reference manual.\nThey are:\n\n- garbage collection,\n- frame scope.\n\nFor the most part,\nbehaviour differences with the reference implementation are only allowed if the\nreference manual does not specify the behaviour.\nFor example, the exact formatting of error messages is not specified in the\nreference manual, so it is allowed to be different.\n\nAlso, since this is a Python implementation, it is ***SLOW***.\n\n## Acknowledgements\n\nI want to hereby thank the following people for their\n(uninformed) contributions to the project:<br>\n(If you are reading this, hello! \ud83d\udc4b)\n\n- **[Blake Bourque]** for creating [Lua by Example], a great resource for learning\n Lua which also serves in the test suite of mehtap.\n- **[oatmealine]** for putting together [this awesome gist][gist] explaining how\n metamethods and metavalues override operations in detail.\n\n[Blake Bourque]: https://techplexlabs.com/\n[oatmealine]: https://oat.zone/\n[Lua by Example]: https://luabyexample.techplexlabs.com/\n[gist]: https://gist.github.com/oatmealine/655c9e64599d0f0dd47687c1186de99f\n\n---\n\nCopyright (c) 2024 Emre \u00d6zcan\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Lua programming language written in Python",
"version": "0.1.2",
"project_urls": {
"Documentation": "https://mehtap.readthedocs.io/en/latest/",
"Homepage": "https://github.com/emreozcan/mehtap",
"Repository": "https://github.com/emreozcan/mehtap"
},
"split_keywords": [
"lua",
" parser",
" interpreter"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "074a7002dc2e5069b70adca6cadd78b83859fae495baf652b229b08d7cc1df44",
"md5": "9225798fcda30478acfa67348ae90ebc",
"sha256": "c44c74b9942a85302eca3dfc056bc5c7756aef4423945ca9734a06ba094b36d8"
},
"downloads": -1,
"filename": "mehtap-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9225798fcda30478acfa67348ae90ebc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 53333,
"upload_time": "2024-11-21T20:18:23",
"upload_time_iso_8601": "2024-11-21T20:18:23.773055Z",
"url": "https://files.pythonhosted.org/packages/07/4a/7002dc2e5069b70adca6cadd78b83859fae495baf652b229b08d7cc1df44/mehtap-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "aea7cd83a06941d2e50d7720eaed3e72eda2a763d9a6aa561d0a34e17cee534f",
"md5": "b705520a5ca1cd3f7954515c81d51163",
"sha256": "98ae2daa9c698077dceee4ada96d93ee46d86e341b9fe0eec5a1869d119413e8"
},
"downloads": -1,
"filename": "mehtap-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "b705520a5ca1cd3f7954515c81d51163",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 48023,
"upload_time": "2024-11-21T20:18:26",
"upload_time_iso_8601": "2024-11-21T20:18:26.545726Z",
"url": "https://files.pythonhosted.org/packages/ae/a7/cd83a06941d2e50d7720eaed3e72eda2a763d9a6aa561d0a34e17cee534f/mehtap-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-21 20:18:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "emreozcan",
"github_project": "mehtap",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mehtap"
}