Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 2.51 KB

README.md

File metadata and controls

54 lines (36 loc) · 2.51 KB

Malang   DEVELOPMENT STATUS: version 3 pre-release

Math language

Programming / computing using, literally, only algebraic operations.

That is, any program that you write in the language, becomes a mathematical operation that, when computed / evaluated, gives the expected result of the program.

You can read the wiki to understand the what and the how. But in here I will discuss the

Why?

Well mainly because it was a fun / interesting project.

I got the idea while watching this YouTube video that talks about this Prime generating formula. It seemed really fascinating and it was something new to me and I was really intrigued by this idea that a mathematical formula can have features similar to that in programming languages. And so I experimented a bit with the idea to see if I can do anything with it, and if I remember correctly, one of the first things I was able to come up with was the not gate. And that got me like so: 🤯.

And so the desire of being able to mimic programming language features in math slowly turned into wanting to make it into an actual programming language that is compiled to that.

And while developing it I was always fixated on the idea / concept that

I want the numbers and operations to do everything and not the compiler or something else.

And indeed I managed to do so.

Is there any practical real-life use for this programming language? At the moment no, and it's not even turing complete. But it is my project and it was really fun developing it.


Requirements

Nothing, just python 3.10 or newer.

How-to

After cloning the repo, you can run files using malang.py like so:

$ python malang.py file_to_run

Don't forget the check out the couple of options available when running a file by using:

$ python malang.py -h

Examples

Some examples are available in the examples dir. A favorite is the FizzBuzz example, as that it uses all the interessting aspects of the language.

You can run it like so:

$ python malang.py -i examples/fizzBuzz 15

Syntax support

I made a VSCode extension that provides syntax highlighting / support for the language, but I haven't published it. Will maybe do so later on, or if someone is interested.


Note: do mention this repo in case of any public use.