Skip to content
revival0728Public

About

toy scripting language to calculate math, everything in this language are math expressions

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

209 Commits

Folders and files

Repository files navigation

Math Lang

LANG ICON

test & build GitHub Release GitHub commits since latest release (branch) GitHub Downloads (all assets, all releases)

Toy scripting language to calculate math

Everything in this language are math expressions

Features

  • Intuitive scripting experience for math
  • Eazy to learn with simple language syntax
  • With VSCode language extension support
  • Mathematic skills are all matters!

How to Play

  1. get the math-lang binary

Build binary from source

make sure you have installed git, rustc and cargo

using the rustup will be helpful

git clone https://github.com/revival0728/math-lang.git
cd math-lang 
cargo build --profile release

Install binary from source

make sure you have installed git, rustc and cargo

using the rustup will be helpful

git clone https://github.com/revival0728/math-lang.git
cd math-lang 
cargo install --path .

Download from Release

You can download math-lang binary from Release page.

  1. run the binary
./target/release/math-lang    # build from source
math-lang                     # install from source
$(DOWNLOAD_FOLDER)/math-lang  # download from release

Binary Usage

$ math-lang --help
toy scripting language to calculate math

Usage: math-lang [SOURCE]

Arguments:
  [SOURCE]  Path of source file

Options:
  -h, --help     Print help
  -V, --version  Print version

About the Language

please checkout the document

How to Write Rust Library Module

  1. clone the repository
  2. run cargo doc --open to checkout the document

Development

Main Changes

  • added builtin function scifmt(x)
  • improved builtin math function domain check
  • improved builtin math function result when passing +INF, -INF, NaN

Bug fixed

  • log(0), log2(0), ln(0) returned +INF

TODO

  • improve error message
  • fix tail call optimization to recursion
  • add function info expression
  • add custom type support (parsed as None but bytes has meanings)
  • fix cannot access parent scope with same function name (?)
  • flatten inst, flat Inst::Mul with new inst Inst::Jump(cond, dest)
  • package manager

About

toy scripting language to calculate math, everything in this language are math expressions

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages