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

Afterwards, run this to ensure Paramath is correctly installed:

paramath --version

To update, just run:

pip install --upgrade paramath

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.3.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.3-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: paramath_lang-2.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 bafaab98304604c30a24c1a661e877fd6c2c790f81d17d367bbb578f6eba27af
MD5 f13ca864f6c557755e99a377dd013b53
BLAKE2b-256 a340e5f4c00f84f8388d4b1068e43a2a3ecd3ca77ce22cb801f400eb4067752e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: paramath_lang-2.2.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ff7fb35fe4ef768f611da26c75f02e945bd16abd1901155c0d83e2f9389b2534
MD5 0f9cf130b3221ff627d40a8b97db1efb
BLAKE2b-256 9f22d59a0ed8824f0d8ef399f0c14892ad711902bc2c154bf913a659af801abd

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