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!

Online IDE

note to self to finish this PLEASE

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: paramath_lang-2.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 abfe7e9599dd69bdffc08928bd2d732b5e86a9589353cb3388f610093fbad776
MD5 789f15aa73b44c5bcec9d8fc3d56e943
BLAKE2b-256 ca5d775a2b6fe0bee6e1a7c231d7bb512ddf0769b267f296c9fddca164a0afc2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: paramath_lang-2.2.2-py3-none-any.whl
  • Upload date:
  • Size: 18.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ed8b836cb6db057b38367f5a33e035ecdbd5ea1ac851d1d8dce249089ad73636
MD5 7f2b8f3d465711f2497d06a05bf09832
BLAKE2b-256 ad3d1d25d55de4236a9926d1f5157dc1c9eb6fe752569a597bb6c286f06533ea

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