Programming with SML "in the very large" is still cumbersome. Although tooling in the form of ML basis files and smackage helps, those tools aren't standard and they only provide assistance at the tooling level rather than the language level.
Here are a few motivating examples where SML currently falls short:
-
if I want to consume a 3rd party library, it hopefully uses a compatible build mechanism. Additionally, a library that uses mlbasis files doesn't necessarily have a "default" basis file. e.g. even if I consume a library like cmyacc via smackage I have to rely on convention and depend on the cmyacc.mlb file.
-
how do teams of engineers within a company compose a working system. Since mlbasis files are a source level dependency mechanism, the consumers of a library end up depending on all signatures and structures with no separation between the modules that belong to the public interface and the modules that belong to the implementation.
-
popular libraries must maintain both mlb and cm definitions. This is tedious and error prone even if tooling helps to convert between both. https://github.com/standardml/cmlib/blob/master/cmlib.mlb vs https://github.com/standardml/cmlib/blob/master/cmlib.cm
The name The fact that they are called ml basis files confused me as a new comer. I was trying to figure out what they had to do with the ML basis (library).
** Does sml need a reified library concept? ** ML basis files files are merely directives to a compiler - a better make
. Experience tells me there is often a need to reify the concept of a library with visibility controls for modules are meant for external use vs internal implementation details. I don't really have a good concrete proposal here, there are examples of other languages attempting this (racket modules and java modules i.e. project jigsaw) but they've still got issues to iron out. Nuprl's approach to theories and libraries might be a better starting point.
Promote something similar to the ml basis file as a standard at the language level. I'm not familiar enough with sml/nj's compilation manager to know if that's a better starting point.
- separate compilation?
- separate compilation + whole program optimization
- namespaces
- ffi is hard
- Standard foreign function interface SMLFamily/Successor-ML#25
-
sml / nj compilation manager http://www.smlnj.org/doc/CM/new.pdf
-
ml basis files http://mlton.org/MLBasis.attachments/mlb-formal.pdf
-
Separate compilation http://www.elsman.com/mlkit/pdf/phd.pdf