Skip to main content

Lua programming language written in Python

Project description

mehtap

Lua 5.4 programming language implementation in Pure Python

Latest version on PyPI Supported Python versions

Codacy Grade Badge Codacy Coverage Badge checks/master docs

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.

# 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 is supported.

  • There are utility functions to convert values from Python to Lua and from Lua to Python.

  • Most of the standard library is supported. (100% support is planned.)

    Basic Functions (22/25)
    • assert()
    • collectgarbage() — Does nothing.
    • dofile()
    • error()
    • _G
    • getmetatable()
    • ipairs()
    • load()
    • loadfile()
    • next()
    • pairs()
    • pcall()
    • print()
    • rawequal()
    • rawget()
    • rawlen()
    • rawset()
    • select()
    • setmetatable()
    • tonumber()
    • tostring()
    • type()
    • _VERSION
    • warn()
    • xpcall()
    Input and Output Facilities (17/18)
    • io.close()
    • io.flush()
    • io.input()
    • io.lines()
    • io.open()
    • io.output()
    • io.popen()
    • io.read()
    • io.tmpfile()
    • io.type()
    • io.write()
    • file:close()
    • file:flush()
    • file:lines()
    • file:read()
    • file:seek()
    • file:setvbuf() — Does nothing.
    • file:write()
    Operating System Facilities (8/11)
    • os.clock()
    • os.date()
    • os.difftime()
    • os.execute()
    • os.exit()
    • os.getenv()
    • os.remove()
    • os.rename()
    • os.setlocale()
    • os.time()
    • os.tmpname()

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:
(If you are reading this, hello! 👋)


Copyright (c) 2024 Emre Özcan

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mehtap-0.1.0.tar.gz (46.5 kB view details)

Uploaded Source

Built Distribution

mehtap-0.1.0-py3-none-any.whl (51.8 kB view details)

Uploaded Python 3

File details

Details for the file mehtap-0.1.0.tar.gz.

File metadata

  • Download URL: mehtap-0.1.0.tar.gz
  • Upload date:
  • Size: 46.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for mehtap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e41f08a3d6206c7b45c4a9b4bc515518458d32671e9c2f6ff20c3df92afd9ba4
MD5 8786416bf23501a3357a6098a0daa760
BLAKE2b-256 a318b75a8fbce70dd4ada372339a4d3d2cbf56eec64a7dfcf7df3d686974f707

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehtap-0.1.0.tar.gz:

Publisher: publish.yml on emreozcan/mehtap

Attestations:

File details

Details for the file mehtap-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mehtap-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 51.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for mehtap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e9a48ffdcb697966cbf54134181811b2b99777afe613f662d3b6e78498f787d
MD5 65e9b361712491cf8f26e050ef742976
BLAKE2b-256 ec26d660428cbbb1762f8e394339a6aacb687d11a5cb2bac07d54893d09fa2d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehtap-0.1.0-py3-none-any.whl:

Publisher: publish.yml on emreozcan/mehtap

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page