Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

MathScript-Lang/MathScript.py

Repository files navigation

MathScript

GitHub Releases

A Math programming language


⚠️ Deprecated version in Python, please use the new version ⚠️


What is MathScript?

MathScript is a simple, yet powerful, programming language designed with mathematics in mind. It offers a clean and intuitive syntax, making it ideal for:

  • Mathematical calculations: Perform complex operations, and work with maths effortlessly.
  • Data analysis: Analyze and visualize data, perform statistical calculations, and build data models.
  • Algorithm development: Develop algorithms, solve equations, and create simulations.

Features

  • Intuitive Syntax: Inspired by mathematical notation, MathScript's syntax feels natural and easy to learn.
  • Data Structures: Supports integers, decimals, complex numbers, strings, lists, and functions.
  • Control Flow: Includes if, elif, else, for, while, and func statements for structured programming.
  • Built-in Functions: Provides a collection of useful built-in functions for mathematical operations, input/output, and more.
  • Extensibility: The language is designed to be extensible with user-defined functions.
  • Cross-Platform: Runs on Windows, Linux, macOS and other platforms.

Getting Started

  1. Install MathScript:
    • From the GitHub release
    • Or fork the repsitory and then build
  2. Run a program:
    mathscript <your_program.mscr>
    Or start an interractive shell:
    mathscript

Build

MathScript uses cx_Freeze for building the binaries.

Firstly, you need to install the dependencies:

pip install -r requirements.txt

Then you can build the binaries by running the following command:

python setup.py build

This will create a build/ directory containing the binaries for your platform in a subdirectory. The MathScript executable will be in the subdirectory of your platform and will be named mathscript.

Example

Here's a simple MathScript program to calculate the area of a circle:

func circle_area(radius) => pi * radius ^ 2
print(circle_area(5))

Documentation

Contributing

Contributions to MathScript are always welcome! Feel free to submit issues, pull requests, or suggest new features.

  1. Fork the repository.
  2. Create a new branch for your feature or fix.
  3. Make your changes.
  4. Test your changes thoroughly.
  5. Submit a pull request.

License

MathScript is licensed under the GNU General Public License v2.0. See the LICENSE file for details.

About

A Math programming language - ⚠️ Deprecated version in Python ⚠️

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages