Skip to content

CSaintos/Mua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

μυα

Mua is (an open source, rudimentary, step-by-step, cli-based, arithmetic) a calculator.

repl demo

Table of Contents

Getting Started

  • To download Mua, go to Releases
  • Install/Place Mua anywhere you'd like on your machine, and to make it easily accessible, add it to your system's or shell's environment path.

Documentation

Shell Operations

Repl mode
  • Start repl mode with: ./muac
  • Exit repl mode: exit[]; on an empty line.
Evaluating mua files
  • Evaluate mua file: ./muac <path-to-file>.mua [<output-file-path>.muar]
    • Brackets mean optional argument
  • Ex:
    • ./muac ./hello_world.mua
    • ./muac ./hello_world.mua ./hello_world.muar

Arithmetic Operators

Operation Example Result
Addition 1 + 1; 2;
Subtraction 1-1; 0;
Multiplication 1 * 1; 1;
Division -1/(-1); 1;
Modulation 4%3; 1;
Exponentiation 2^3; 8;
Radical 4^(1/2); 2;

Misc

  • Comments: // A line comment

Building Mua

Requirements

  • You will need GCC v11+ or Clang v17+.
    • At a minimum must support c++20
  • You will need GNU-make 4.4.1+
  • If you are on Windows, you can download these packages through MSYS2
  • Make sure to add the installed packages to your system/shell environment path

Clone

  • clone this repo into an empty directory git clone https://github.com/CSaintos/STEM.git

Build

  • Within that same directory, run make following one of the options for your operating system below
Windows Build
  • make -j SYS=Windows
Linux Build
  • make -j SYS=Linux

or

  • make -j
MacOS Build
  • make -j SYS=OSX CXX_VERSION=c++20

or

  • make -j SYS=OSX
    • By default the CXX_VERSION is c++23 and may not work on your machine with the current version of gcc supported by macos

Execute

  • Once completed, the executable is stored in ./build/mua/main/muac