MPLLang / mpl

The MaPLe compiler for efficient and scalable parallel functional programming
Other
340 stars 19 forks source link

Refactor MLton.Parallel #77

Open ramLlama opened 7 years ago

ramLlama commented 7 years ago

MLton.Parallel is currently a "bag of stuff". It's worth organizing this. I'll go section by section

Reorganization

I propose the following:

Deprecated

We have a few things in MLton.Parallel.Deprecated that have been there a while. We should handle them.

My thoughts:

Unsafe

Top-level

MatthewFluet commented 7 years ago

There is already an Unsafe module (basis-library/sml-nj/unsafe.{sig,sml}), although within the Basis Library implementation (i.e., before we constrain the Array module to that specified by the Basis Library), you have Array.arrayUninit available.

ramLlama commented 7 years ago

Isn't that Unsafe a compatibility structure with SML/NJ Unsafe? What has been mainline MLton's thoughts on where to put MLton-specific unsafe things?

Also, yes, we would use the same Array.arrayUninit that is provided in the basis, not a reimplementation. We just a need a place to put it.

MatthewFluet commented 7 years ago

Yes, the exported structure Unsafe is for compatibility with SML/NJ. We haven't needed to export MLton-specific unsafe things. Within the Basis Library implementation, we simply use *Unsafe functions within their natural structures. So, it is really a question of whether these operations are meant for export to user programs or just for internal implementation.