A differentiable programming language for continuous computation
Project description
The Paramath Programming Language
Paramath is a Domain-Specific Language (DSL) that transforms procedural math code into mathematical expressions. Paramath compiles into math expressions with operations that are commonly found on standard scientific calculators, allowing evaluation of logical code on mathematical hardware.
All this, powered by Python!
Why the name "Paramath"?
The word "paramath" comes from the portmanteau of "parenthesis" and "mathematics".
Features
- S-expression syntax: Clean, unambiguous structure
- Automatic optimization: Duplicate detection and subexpression extraction
- Loop unrolling: Compile-time iteration for performance
- Flexible output: Display or store results in variables
Documentation
Full documentation is available here!
Installation
Method 1 (PyPI):
To install the latest release, just install it fron PyPI using:
pip install paramath-lang
Afterwards, run this to ensure Paramath is correctly installed:
paramath --version
To update, just run:
pip install --upgrade paramath-lang
Method 2 (Direct Git Clone):
Clone this repository by running the following commands in a shell:
git clone https://github.com/kaemori/paramath.git
cd paramath
Then, run the following command to install Paramath:
python -m pip install .
Note: We recommend installing via PyPI for easier updates. Direct git installs are snapshots and require reinstalling for each update.
Usage
The compiler can be accessed with the following command:
paramath [-h] [-v] [-o FILE] [-D] [-V] [-O] [-S] [-L FILE] [filepath]
positional arguments:
filepath Input paramath file
options:
-h, --help show this help message and exit
-v, --version prints the Paramath version number and exits
-o, --output FILE output file (default: math.txt)
-D, --debug enable debug output
-V, --verbose enable verbose output
-O, --print-output print out the compiled output
-m, --math-output format output for calculators (use ^, implicit multiplication, ANS)
-S, --safe-eval prints and blocks python code from evaluating and exits, used for safely running unknown scripts
-L, --logfile FILE write logs to FILE
This help message can also be displayed later by running paramath --help
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paramath_lang-2.2.6.tar.gz.
File metadata
- Download URL: paramath_lang-2.2.6.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1da33c85d6abf3bab2790579adcc4fb0885fbea4bad538673fadfdb531d393d3
|
|
| MD5 |
0246f0eb5a26fd8ed7c6326ef02451de
|
|
| BLAKE2b-256 |
19c16de4985577da719e65cb1f876e43287521a40c71edc66b2313d4ac75a67c
|
File details
Details for the file paramath_lang-2.2.6-py3-none-any.whl.
File metadata
- Download URL: paramath_lang-2.2.6-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3489183714d7525f08c7acd311cc6a36f66de56b3655c3488019497fcec1332
|
|
| MD5 |
ceac837781eaa2c92760e915893664e8
|
|
| BLAKE2b-256 |
bda80660f219f3cafd8681fdec34c1738166d64ab2b0892f4156f5e8bd72fcb7
|