Skip to main content

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
  -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


Download files

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

Source Distribution

paramath_lang-2.2.4.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

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

paramath_lang-2.2.4-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file paramath_lang-2.2.4.tar.gz.

File metadata

  • Download URL: paramath_lang-2.2.4.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for paramath_lang-2.2.4.tar.gz
Algorithm Hash digest
SHA256 76f7d644dea6778ffc845f2b96082dc19959b339b4fd5180d35186d9658afac3
MD5 5b18efb52291907c9b91d597a860cc0a
BLAKE2b-256 2a9e648f051179ee4c41071a14d909b8aedba2b25bbcf7d2c9c8bf07ae7d0cc6

See more details on using hashes here.

File details

Details for the file paramath_lang-2.2.4-py3-none-any.whl.

File metadata

  • Download URL: paramath_lang-2.2.4-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for paramath_lang-2.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1a640b15381f8e2208f66854e3fe870e9bd4a8eb2fcb0ea879a5ae35ed548efe
MD5 0d3f0290902b9fd60276b11450a423f7
BLAKE2b-256 46cf172d3349aae318de9234aed5cea009e33884ec28eaa6a82c90ada14e6bc7

See more details on using hashes here.

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