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


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.5.tar.gz (20.4 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.5-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: paramath_lang-2.2.5.tar.gz
  • Upload date:
  • Size: 20.4 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.5.tar.gz
Algorithm Hash digest
SHA256 b10eafa9df82b758227527a3b2327493779f90c4a952d2e07d294d7683967d45
MD5 290519b2e3c9dd895537eef5c84780b2
BLAKE2b-256 43b6dd92f6e161dbfe17a6a0e3f521fdba1a259d5a7a4813b49a8df4479fdc7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: paramath_lang-2.2.5-py3-none-any.whl
  • Upload date:
  • Size: 19.1 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9771aa2274a00ddbbe0fe7fab612c59b1482a17eb2b1c090edd4fe5e2d6adbb9
MD5 26f01fdfbfaf966d060466d24b6916a9
BLAKE2b-256 8440d79a5116681ed32bdf56ecdcc2f515e514ed893ec077888f40ade1b46ce0

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