Metadata-Version: 2.4
Name: nmlang
Version: 0.1.0
Summary: Numerus - An Esoteric Stack-based Programming Language (Esolang) by TeaserLang
Author-email: Teaserverse <contact@teaserverse.online>
License: Copyright © 2025 Teaserverse
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project-URL: Homepage, https://github.com/TeaserLang/numerus
Project-URL: Bug Tracker, https://github.com/TeaserLang/numerus/issues
Keywords: esolang,stack,numerus,teaserlang
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Interpreters
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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:
```bash
pip install nmlang
```

## CLI Usage

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

## Library Usage (Integration)

You can also use the Numerus interpreter directly in your Python projects.
```python
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`)

```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**.
