Go Native! Go Faster!
   
 


Usage: moto [options] <files...>

Options:

-c: Compiles the moto files to C code and sends the output to stdout
-d: Prints memory debugging information
-h: Displays help message
-l: Print simple memory leak diagnostic (uncollected memory yes or no)
-M<size>: Sets the heap size in bytes,kilobytes or megabytes
#: Sets the heap size in bytes
#K: Sets the heap size in kilobytes
#M: Sets the heap size in megabytes
-X<path>: Appends the specified path to the list of paths in which to look for moto extensions
-p: Runs the moto preprocessor only and sends the output to stdout
-v: Runs the moto type verifier only and sends any errors to stdout
-x: Runs moto without loading default extensions
 

Examples:

Verify there are no errors for all moto files in a directory:

moto -v *.moto  

Compile a moto file by hand

moto -c foo.moto > foo.c
gcc -I/usr/local/moto/include -I/usr/local/moto/lib/mx/moto -D__MAIN__=main -DSHARED_MALLOC foo.c /usr/local/moto/lib/mx/moto/libmx_moto.a /usr/local/moto/lib/libcodex.a
 

Use extensions you're still developing

moto -X/home/dhakim/src/iolio/mx index.moto
 

Debug a memory leak in an extension

moto -d break.moto

Size Range Tree :
|[0x40140000,0x4014402a)| = 16426 id=32 pid=1109131227
|[0x401441f6,0x42140000)| = 33537546 id=12 pid=32
Allocated Range Tree :
|[0x4014403a,0x4014404e)| = 20(36)
|[0x4014405e,0x40144086)| = 40(56)
|[0x40144096,0x401440aa)| = 20(36)
|[0x401440ba,0x401440e2)| = 40(56)
|[0x401440f2,0x40144106)| = 20(36)
|[0x40144116,0x4014413e)| = 40(56)
|[0x4014414e,0x40144162)| = 20(36)
|[0x40144172,0x4014419a)| = 40(56)
|[0x401441aa,0x401441be)| = 20(36)
|[0x401441ce,0x401441f6)| = 40(56)

gdb moto
> break sharedmem.c:897
> cond 1 size=40 && returnAddress==0x401441ce
> run break.moto