📟
MathX Manual
  • Introduction
  • Syntax & Semantics
Powered by GitBook
On this page
  • What is Programming ?
  • Why MathX ?
  • Installing MathX
  • Running MathX

Introduction

Welcome to MathX, a Mathematical Statement-based Expressional language

NextSyntax & Semantics

Last updated 2 years ago

What is Programming ?

Computers don't understand human language, rather they understand only binary number (0's & 1's). Instructing computer with binary code is such a tedious work and hinders the growth of new technologies in the Computer World. So, new technologies were founded to convert human-readable code into binary and so programming languages invented. Programming Languages like Fortran, COBOL, Pascal, C, PROLOG, C/C++, Python, Java, Ruby were very powerful and useful since their origin. Programmers write their commands using such languages and execute their required task which to be done by computer. Thus, a new field arose. This is very interesting as it engages your brain to teach computers to solve problems.

Why MathX ?

Many newbies who enter the field of Computer programming often face problems (or lose their interest) due to the deep learning curve and their misunderstanding of the newly introduced Syntax of other programming languages. MathX being a Statement-based language, has a very simple syntax which resembles actual English thus reducing the learning curve. It is actually a transpiler which transpiles MathX code to high-level languages such as C, Go, Java, etc... so you may achieve the compatibility of those languages too as you go deep into it.

Note: v1.0 of MathX compiles only to C. Further Languages discussed above will be added in future.

Installing MathX

The Current version of MathX is v1.5. MathX requires Python version >= 3.6 and any C compiler to compile native code. So first install Python 3 from its and also your favourite C compiler (I prefer / for best performance). After installing Python and your C compiler, do the following:

  1. Go to the official MathX . Select your desired version release.

  2. For Linux/Mac users, download mathx-linux.tar.gz file.

  3. For Windows users, download mathx-windows.zip file.

  4. Unzip the file and save it to your desired location.

  5. Add the folder location (location where mathxc was located) to your PATH Environment variable

Now you're ready to run your first MathX program.

Running MathX

To verify your installation, run ./mathxc -h on Linux/Mac or mathxc -h on Windows. You'll be shown up with the following screen:

mathxc is the MathX Compiler, which we'll use to compile and run MathX programs. This compiler compiles to native code by transpiling to C which gives maximum speed.

Now, create a file named hello.mx and write the following into it:

!: Hello World Program in MathX Language.

main-para:-
println "Hello, World!".

After saving the file, run the following command: ./mathxc hello.mx on Linux/Mac or mathxc hello.mx on Windows.

Now run ./hello on Linux/Mac or hello.exe on Windows. You'll see the following screen:

🥳 Yay! You just ran your first MathX program.

official website
gcc
tcc
releases page
MathX Compiler Help Screen
Running your first MathX program