Metadata-Version: 2.4
Name: mathsys
Version: 6
Summary: The Domain Specific Language for math.
Author-email: Alejandro Vaz <support@abscissa.eu>
License: Copyright 2025 alejandro-vaz
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Keywords: dsl,math,mathsys,compiler,language
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.14
Description-Content-Type: text/markdown
Requires-Dist: async_lru
Requires-Dist: lark
Requires-Dist: aiofiles
Requires-Dist: rich

# Mathsys

![Pepy Total Downloads](https://img.shields.io/pepy/dt/mathsys?logo=pypi&label=Pypi%20downloads&link=https%3A%2F%2Fpypi.org%2Fproject%2Fmathsys%2F)
![NPM Downloads](https://img.shields.io/npm/dm/mathsys?logo=npm&label=NPM%20downloads&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fmathsys)
![Crates.io Total Downloads](https://img.shields.io/crates/d/mathsys)

Mathsys is an educational math language for students and teachers who want to write, read, and experiment with mathematics in a clear, human-readable way.

It looks like math, not code -- but it can still be checked, validated and converted into LaTeX or runnable programs for interactive exploration.

## Example

```
x = 2 + 3*7/4

@Number e == lim n->inf of (1 + 1/n)^n^

@Tensor u, v
u*v
```

compiles to:

$$x=2.0+\frac{3.0\cdot 7.0}{4.0}$$
$$\pi \equiv 3.14159$$
$$e\equiv \lim_{\substack{n\to \infty }}\left( 1.0+\frac{1.0}{n}\right) ^{n}$$
$$\overline{u}\cdot \overline{v}$$

See more examples in [the documentation.](https://docs.abscissa.eu)

## Why Mathsys for Learning?

- Clear, structured expressions instead of dense symbols
- Can be converted directly to LaTeX
- Intuitive to write and read, whilst still being mathematically rigorous
- Can be [used online](https://app.abscissa.eu/playground) without any local installation 
- Allows for greek letters, multicharacter variables and easy syntax

## Try it now

### Online

[Go to playground.](https://app.abscissa.eu/playground)

### Local installation

Install the latest version via `pip`:

```sh
pip install mathsys
```

Compile a Mathsys file to different targets with:

```sh
mathsys <target> <filename>.msX
```

where `.msX` is the file extension stands for `.ms1`, `.ms2`, `.ms3` ... (versioned), `.msr` or `.msd` (release and dev).

`mathsys.release` is the last stable version, whilst `mathsys.dev` is the latest version published.

> [!NOTE]
> To view all available targets, run `mathsys help <filename>.msX`.

> [!WARNING]
> You'll need Rust installed in order to compile to `native` target, with the nightly toolchain, and the `wasm32-unknown-unknown` toolchain for compiling to WebAssembly.
> The compiler will also try to optimize the executable so it is recommended that you install `wasm-opt` and `upx`.

## Project Status

Mathsys is actively developed with regular releases every few weeks. This project is still in its early stages, so expect major shifts and changes. Most features aren't close to being developed yet.
