Home

Awesome

mpl:)) Mini Portable Language - MPL (BETA-0.6)

This is a small,fast and simple interpreter also best solution to common problems of programmers.

The solution to common problems of programmers<br> راه حل کارهای متداول برنامه نویسان

TODO

((:publish MPL-BETA version of MPL (for windows):))

MPL BUG be reported

((:publish MPL-RC version of MPL (for windows):))

((:publish MPL-HELLO version of MPL (for windows,linux):))

((:publish MPL-HI version of MPL (for windows,linux):))

To be continued ...

MPL Sample Codes

MPL Modules

MPL Language Features

support utf8 strings [OK] <br> support radix numbers [OK] <br> has boolean XOR operand [OK] <br> support data structures [OK] <br> support magic macros [OK] <br> support huge numbers [OK]<br> support override functions [OK] <br> has built-in functions [OK] <br> manage exceptions [OK] <br> support multi dimensions arrays [OK] <br> has built-in garbage collector(gc) [OK] <br> expandability by c libraries [OK] <br> support built-in debugger [OK] <br> support unlimited function parameters [OK] <br> support multi return values [OK] <br> support call by reference vars [OK] <br> support short allocations for vars [OK] <br> support built-in encoder [OK] <br> has bit functions [OK] <br> support session storage [OK] <br> support sqlite3 module [OK] <br> support package libraries [..] <br> support browse arrays in loop [..] <br> support switch condition [..] <br> support module os syscalls [..] <br> support create executable file from program [..] <br>

MPL Hello World Program

func main(){
    print("Hello World!\n")
}

Get Starterd

[Windows] : Build Mpl.exe

First clone the repository and then install python3 for ruuning build tool and mingw64 for compiling mpl. Then run 'build_win32_migw64.py' in 'tools' directory. Finally created a folder by name 'win32-release'. <br> Now you can run a file by name 'main.mpl' through command 'mpl.exe main.mpl' and you can see the result! <br> [Mpl is portable!] you can move 'mpl.exe' to any where. it's a static executable file and not need to any files.(It's not need any modules or packages or docs or anything... Their are just for easier programming by mpl:)) ) <br>

[Linux] : Build Mpl

TODO...

MPL Sample Program

 //=>import an external file
import "file:$/data/sam.mpl"
//=>edit $con values
$con["AppName"]="MyProgram"
//=>edit $ses values. it is store in a built-in database
$ses["AppName"]="MyProgram"
//------------
//=>define main function,start point of any program
func main(){
    print("Hello World!\n");
    //=>print an utf8 string
    print("سلام بر دنیا!\n"); 
    str uu[2,2]={{"x","v"},{"h","i"}}
    //=> browse an array
    loop(str u,b,num i=0;i<len(uu);i++){
		u=uu[i][0]
		b=uu[i][1]
        //=>print a calculated string
        print("u is: %u%,and b is: %b%\n");
    }
    //=>define some vars by one value
    num sum1,sum2=0;
    //=>call a function by reference var
    add(&sum1,5,7.7,-2,0.7) //=>sum1=3
    sum2=add(sum2,5,7.7,-2,0.7) //=>sum2=3
    struct st1{bool b,str s,num n}
    struct st2{st1 v,bool b}
    //=>create a var by a customized data type
    st1 s1=struct(true,"ty",78.7)
    //=>using multiple struct into other
    st2 s2[2]={struct(struct(false,"ui",-9.99h),true),null}
}
//------------
//=>create a documentation for a function
/**
@params:
    ref(num) : can set sum of value by reference var
    nums(vars) : get unlimited numbers
@output:
    return sum of integers
@des:
    add up just integer numbers and return it
@ver:
    1.0.0
*/
//=>define a function by unlimited data type
func add(num ref,vars nums){
    loop(num i=0;i<len(nums);i++){
        //=>check type of var by 'typeof' function
        if(typeof(nums[i])=="i") ref+=nums[i]
    }
    return ref
}

Programmers & Designers

  1. Mohammad Amin Delavar Khalafi [main developer,designer],[Iran],[amindelavar@hotmail.com]

MPL VERSIONS

Events

MPL is best choice FOR

  1. build tools of personal projects or big projects [DONE]
  2. start to learning the programming world [DONE]
  3. create small and common tools for programmers [....]
  4. personal programming for spend time-end time [DONE]
  5. create and test new algorithms [DONE]
  6. network testing and hacking [....]
  7. familiarity and learning SQL [DONE]

MPL appreciates for your suggestions and the other :))

Contact with amindelavar[at]hotmail.com by mpl:)) title

<hr> <center> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-<br> | Mini Portable Language - MPL |<br> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-<br> </center>