daokoder / dao

Dao Programming Language
http://daoscript.org
Other
198 stars 19 forks source link

Enhancement: A little bit of effortless HPC - DawnCC #530

Open dumblob opened 7 years ago

dumblob commented 7 years ago

I'd like to point the Dao community to the DawnCC compiler (github page), which fully automatically parallelizes C and C++ code. I can see two possible places of use:

  1. in the VM code (which is written in C99) itself
  2. in the programmer's code written in Dao

Both can be implemented at the same time, of course. The former should be pretty straightforward, but the latter would highly probably need addition of virtual instructions and few hacks.

With regards to how the "user/programmer interface" could look like, there should be the following options (independent of the two options above).

  1. compile-time option of the VM itself (e.g. make OPTIONS="--option-MULTIPROCESSING-ON")
  2. compile-time option of the run of any program written in Dao
    1. either as dao -m myapp.dao (-m stands for multiprocessing)
    2. or as app-specific option (e.g. through load multiproc in the source of myapp.dao)

The issue currently is, that the compiler directive statements (e.g. pragmas) inserted by DawnCC are currently fully supported only in few compilers, namely LLVM and GCC. Other compilers lack (or have it incomplete) this parallelization statements support.

On the other hand this could prove extremely useful e.g. for robotics (very easy "offloading" of computations to small, but yet powerful graphics processors or just better leverage of multicore CPUs, even non-uniform ones like big.LITTLE) or any lower-level parallel computations (mathematics, simulations, etc.) or high-performance scenarios (network daemons, buses, etc.).