Skip to main content

Python implemented on the BEAM, packaged with Erlang/OTP

Project description

Pyrlang

Pyrlang is Python implemented on the BEAM, primarily in Erlang/OTP.

The project goal is not to build a CPython package, a python -m runner, or a Python library that mimics Erlang. Pyrlang source is parsed, loaded, evaluated, interpreted, or compiled by BEAM-resident runtime code.

Current repository contents:

  • SPEC.md: language and runtime semantics.
  • WEB.md: Pyrunicorn WSGI target architecture.
  • src/: BEAM-native Erlang runtime modules.
  • test/: EUnit tests for the current runtime slice.
  • bin/: BEAM-native escript entrypoints for pyrlang and pyrunicorn.
  • include/: shared Erlang definitions.
  • Makefile: plain erlc/erl build and test entrypoint.

Implemented foundation:

  • Actor-local heaps and mutable container/object references.
  • Message export/import with copied mutable values and cyclic object graphs. Native stdlib objects that close over actor-local state or BEAM resources are marked unsendable and surface as Pyrlang TypeError through source-level send().
  • BEAM actor primitives: spawn, send, receive, selective receive, call/reply, source-level links, monitors, demonitoring, linked spawn, exit trapping, registration, source-level receive timeouts, and explicit atom-safe Erlang calls through erlang.apply.
  • Parser/evaluator subset for expressions, assignments, functions, classes, methods, attributes, subscripts, decorators, if/elif/else, while, for, try/except/finally, with, yield, lambdas, boolean operators, membership, identity comparisons, simple slices, keyword/default arguments, *args/**kwargs, call expansion, range, and list/dict/set comprehensions.
  • Literal support for None, booleans, integers, floats, strings, bytes, tuples, lists, dicts, and sets.
  • Object model foundation: classes, instances, descriptors, bound methods, and C3 MRO, including super(), property, staticmethod, classmethod, and callable instances plus arithmetic/comparison special-method dispatch. Class suites execute supported Pyrlang statements including nested classes, imports, conditionals, loops, exception handlers, and context managers.
  • Basic metaclass creation and inherited metaclass selection through class C(metaclass=...) and type(name, bases, attrs).
  • Dynamic object helpers: getattr, setattr, hasattr, isinstance, issubclass, and type(obj) for Pyrlang instances.
  • BEAM-backed open() for basic file read/write/close and context-manager use, with live file handles marked as actor-local unsendable resources.
  • Actor-local module/package loading/imports from .py and __init__.py source files, with .pyr accepted as a legacy project-local extension, plus BEAM-native erlang, os, re, hashlib, hmac, secrets, contextvars, weakref, threading, importlib, datetime, decimal, logging, pathlib, http.cookies, urllib.parse, and email.utils modules, plus a minimal actor-backed sqlite3 DB-API surface.
  • Pyrlang exception values with catch/raise flow, StopIteration, catchable attribute/subscript/operator errors, and bare raise re-raising the active exception inside exception handlers.
  • Generator objects, the user-visible __iter__/__next__ protocol, and source-level mutable list/dict operations, including iter, list, tuple, dict, and set constructors.
  • One-for-one supervisor foundation.
  • Actor-backed SQLite access through an Erlang port to sqlite3, with connection-scoped transactions, DB-API connection/cursor objects marked as actor-local resources, and connection actor crashes mapped to DB-API operational errors.
  • Pyrunicorn WSGI environ/worker/http/server foundation that loads Pyrlang module:callable apps inside worker actors, provides basic WSGI stream objects with sized and line reads, supports iterable response bodies and the start_response write callable including exc_info replacement before headers are sent, threads configured and socket-derived WSGI environ values such as SERVER_PORT and REMOTE_ADDR into Pyrlang-source apps, isolates worker module globals, returns 400 responses for malformed requests and 500 responses for app and worker failures, reads Content-Length bodies across TCP packets, serves over a real TCP socket with a round-robin worker pool, restarts crashed workers, and boots a small Pyrlang-source Django-shaped WSGI shim with a minimal middleware chain.
  • BEAM-native bin/pyrlang and bin/pyrunicorn escript wrappers. pyrunicorn accepts --bind, --workers, --django-settings-module, and --path.
  • pyrlang -m module ... executes a module or package __main__.py through the Pyrlang runtime and exposes arguments through the BEAM-native sys.argv.

Run the current verification suite:

make test

Build and refresh executable entrypoint bits:

make entrypoints

This repository implements the current scoped contracts in SPEC.md and WEB.md: Python-syntax Pyrlang source running on BEAM-resident runtime code, actor-backed runtime behavior, and Pyrlang-source WSGI on BEAM-native Pyrunicorn. Larger Python and Django compatibility areas remain outside the current scope until the specifications are expanded.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyrlang-0.1.5-py3-none-win_amd64.whl (47.0 MB view details)

Uploaded Python 3Windows x86-64

pyrlang-0.1.5-py3-none-musllinux_1_2_x86_64.whl (34.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

pyrlang-0.1.5-py3-none-musllinux_1_2_aarch64.whl (33.5 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

pyrlang-0.1.5-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (33.5 MB view details)

Uploaded Python 3manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyrlang-0.1.5-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (32.2 MB view details)

Uploaded Python 3manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

pyrlang-0.1.5-py3-none-macosx_14_0_x86_64.whl (13.6 MB view details)

Uploaded Python 3macOS 14.0+ x86-64

pyrlang-0.1.5-py3-none-macosx_14_0_arm64.whl (13.7 MB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

Details for the file pyrlang-0.1.5-py3-none-win_amd64.whl.

File metadata

  • Download URL: pyrlang-0.1.5-py3-none-win_amd64.whl
  • Upload date:
  • Size: 47.0 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyrlang-0.1.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 cf0eb3526213b0ba5cb90445cb32e863b903bdf5e2d761e428c9cd00c5a71488
MD5 497eb8084fa6b00e9dd68b4dd2be0cb3
BLAKE2b-256 2a9f8cdb190d013d28e2d0d9c4d87028f0b2b667917c9efc8448170056cad70c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrlang-0.1.5-py3-none-win_amd64.whl:

Publisher: release.yml on grantjenks/pyrlang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrlang-0.1.5-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyrlang-0.1.5-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4ebc65116c0965bc849188289ff33e81fe21dfa2e03da963537e0d7b7dfb6b6b
MD5 99fcf5e8ca07aa2505c9f50afde8dbd4
BLAKE2b-256 6aa5ed52737d31cb007030a3a7aab7889fcbcb216d0c1d5e97d5260665d00f67

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrlang-0.1.5-py3-none-musllinux_1_2_x86_64.whl:

Publisher: release.yml on grantjenks/pyrlang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrlang-0.1.5-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pyrlang-0.1.5-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c7937eb35c750586c7c89440026da08bcf3d7b983c03906cdb737f965ee10434
MD5 375980aaa6c41033dcbd0fc8ee3da2fe
BLAKE2b-256 f4927755b0a8120b74ebcf0f763ab00c76eeaa87b74e3395fef2ea955f4dcde6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrlang-0.1.5-py3-none-musllinux_1_2_aarch64.whl:

Publisher: release.yml on grantjenks/pyrlang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrlang-0.1.5-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyrlang-0.1.5-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3b562515a0e68b353fa9ee5eb4741d33c98a739f7a5a7d94e7ef6752227f2404
MD5 36e3fac9e52470d7e9275a35f99b18b2
BLAKE2b-256 e8ad46c3a5b2fe815809ff357c6f6f28b00abf2698bd84cefd7e525a26470db2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrlang-0.1.5-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on grantjenks/pyrlang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrlang-0.1.5-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyrlang-0.1.5-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0da356945f87803f5706021f6cc2216e7bd679097772be55b0ba06e68f11b4ce
MD5 3517d5cdcbd05260228980dee21a19da
BLAKE2b-256 b008be5e898eb665bde2d252164f4fd7131288d61af964fda7a74a08aeada298

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrlang-0.1.5-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: release.yml on grantjenks/pyrlang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrlang-0.1.5-py3-none-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for pyrlang-0.1.5-py3-none-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 b12c84679261c24d8169a62ce99d73cbc950004b0be64eeb9eb0f94023f9f503
MD5 e448acb10df527adc20347fae85766fe
BLAKE2b-256 ddd6c7e03c138f0d73a35f1b15b915834e9e35b3fef2cc1167b22d0e9e916da8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrlang-0.1.5-py3-none-macosx_14_0_x86_64.whl:

Publisher: release.yml on grantjenks/pyrlang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrlang-0.1.5-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyrlang-0.1.5-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 bb8f6ed7f48868ff7ab12f462e1fde4ff5e036c1ec77a4162be04f605e6e9ec4
MD5 cd04103f0273c376ed369f5966be7978
BLAKE2b-256 9233033df4fd8037a536532ac264de90e63680a2ccdbb4291c7000b509e5ed9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrlang-0.1.5-py3-none-macosx_14_0_arm64.whl:

Publisher: release.yml on grantjenks/pyrlang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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