Skip to main content

Numerus - An Esoteric Stack-based Programming Language (Esolang) by TeaserLang

Project description

Numerus

Numerus is an Esoteric Stack-based Programming Language (Esolang). It is a purely number-based language where all operations are represented by numerical codes.

Installation (CLI)

Install the command-line interpreter (nmc) via PyPI:

pip install nmlang

CLI Usage

Execute a Numerus source file (.nm) using the nmc command:

nmc your_program.nm

Library Usage (Integration)

You can also use the Numerus interpreter directly in your Python projects.

import numerus

# 1. Run a raw string
try:
    # Prints 'H' (ASCII 72)
    output = numerus.run_numerus_string("10 72 31 33")
    print(output)

except numerus.NumerusError as e:
    print(f"Code failed to run: {e}")


# 2. Run a file
try:
    output = numerus.run_numerus_file("hello_world.nm")
    print(output)

except FileNotFoundError:
    print("File not found!")
except numerus.NumerusError as e:
    print(f"Code failed to run: {e}")

Quick Syntax Guide

Code Command Stack Behavior (TOS = Top of Stack)
0-9 PUSH_VALUE Pushes the opcode value itself.
10 PUSH_NEXT Pushes the next number in the source code.
20 ADD (b, a) -> (b+a)
21 SUB (b, a) -> (b-a)
23 DUP (a) -> (a, a)
31 PRINT_CHAR Pops and prints value as ASCII character.
32 JUMP_ZERO If popped value is 0, jumps to address provided in source code.
33 END Halts execution.

Example Hello World Program (hello_world.nm)

10 72 31 10 101 31 10 108 31 10 108 31 10 111 31 10 44 31 10 32 31 10 87 31 10 111 31 10 114 31 10 108 31 10 100 31 10 33 31 33

License

This project is under the MIT License.

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

nmlang-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

nmlang-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nmlang-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nmlang-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d25cf6bf106bd011fded71e04c068283af81d4d2b54b4d2bb54f54236d5cb9c8
MD5 5dff80bf962918d77039e1dc92180bbe
BLAKE2b-256 84881ce574326097eb5fa5fbc44190324d6698dd8e6f99d69de861c8c1ac3edc

See more details on using hashes here.

Provenance

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

Publisher: python-publish.yml on TeaserLang/numerus

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

File details

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

File metadata

  • Download URL: nmlang-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nmlang-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a518dc6e007de885e9f73f9a43a9dd7b761558509c339787fd236195cd60a4fd
MD5 6e579c166f2c28ae900b54d1d44e6b20
BLAKE2b-256 888aa788d399621ec648354cc5e5de0487517aa346c79feb2513e91bba53b5d3

See more details on using hashes here.

Provenance

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

Publisher: python-publish.yml on TeaserLang/numerus

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