Language - Manhunter07/MFL GitHub Wiki
Hey there! It is nice you found your way to this project. My name is Dennis, I am the designer and so-far only programmer of this language and its implementations.
MFL is a functional programming language that supports a variety of things, including evrything you know from the common imperative languages like C, Pascal, Python, Java and JavaScript. Let us give you an overview of what this language is and what it isn't. MFL is...
- ...functional:
- Every term and every function defines an output value determined by its input values.
- Loops and other code blocks in the classical sense do not exist.
- Variables exist, but cannot be changed from within a term or a function.
- Functions can be called or passed by reference.
- ...typed:
- You can declare and address any kind of type, including numbers, strings and others.
- You can declare and specialize or generalize types through inheritance, including an OOP-like type system.
- ...duck-typed (structurally-, but weakly-typed):
- In most cases, types act only as constraints and have no own identity.
- Constructors exist, but may return anything supported by their type. There is no indication which constructor had been used to create a value.
Trivia
- This language is called MFL which originally meant My Functional Language. This was because I did not know how to name it and also, because with FML it has a nice anagram everyone should understand.
- The reason I made this language functional was because I initially did not know how I could implement loops and blocks properly.
- MFL's first and back-then only data type was the 32 bit Integer which eventually was dropped in favour of floats. Strings, arrays, records, booleans and references only came later.
- There might be still some functions in the system package from when the language had no support for structures,
if
-then
-else
statements or other later features. - I implemented a Delphi-like number format including the
$
prefix for hexals. But since the%
is an operator already and because it was completely pointless to waste it for binaries, I refuse to implement it as a number prefix. - I know I could easily improve the compiler's performance through the use of pointers, but who am I to drop the most intersting challange here...