L1VM - build programs

Here I want to show how easy you can build Brackets programs by using my build.sh script. We want to build the hello-2 example in the L1VM directory. Open a shell and type in:

$ ./build.sh prog/hello-2
$ ./build.sh prog/hello-2
code lines compiled: 13
[✔] out compiled
assembler args: ' '
assembling file: 'out'
codesize: 158 bytes
datasize: 341 bytes
filesize: 561 bytes
[✔] out assembled

Now the program is compiled. The build.sh script calls the preprocessor and does include header files and doing other macro replace stuff. Then the compiler is called. And finally the assembler builds the byte code which runs in the VM! So the build.sh script does this automatically for us. It is very easy to use.

All the needed modules code is included in every byte code file. So to run a program the needed modules (.so libraries) must be installed in your system. That is all.

Here I want to show how fast it is: building the POV-edit program. It has 2056 code lines in Brackets, including comment lines. The output of the compiler has 5534 lines assembly. Here is the whole build process:

$ time ./build.sh prog/pov-edit-2 -lines 10000
max line len set to: 10000 lines

cast: line 275: cast to lower precision variable!
>  (cast pixel_setstore_pattern_pixel numstore_pattern_pixel =)


cast: line 468: cast to lower precision variable!
>  (cast pattern_xsave_pattern numsave_pattern =)


cast: line 475: cast to lower precision variable!
>   (cast zerosave_pattern pixelbsave_pattern =)


cast: line 485: cast to lower precision variable!
>     (cast pixelshiftsave_pattern numsave_pattern =)


cast: line 715: cast to lower precision variable!
>   (cast zeroload_pattern_file numload_pattern_file =)


cast: line 759: cast to lower precision variable!
>   (cast lenload_pattern_file numload_pattern_file =)


cast: line 806: cast to lower precision variable!
>      (cast oneload_pattern_file numload_pattern_file =)

code lines compiled: 1850
[✔] out compiled
assembler args: ' '
assembling file: 'out'
codesize: 37451 , 36.573 KB
datasize: 51101 , 49.903 KB
filesize: 96228 , 93.973 KB
[✔] out assembled


real	0m0,182s
user	0m0,146s
sys	0m0,035s

I have an Intel(R) Core(TM) i5-9300HF CPU @ 2.40GHz. This is a Intel i5 9th generation CPU.
IMHO the whole build process of the preprocessor, compiler and assembler is really fast!