Hi, This sounds like an interesting project. Have you included it in the Poly/ML software directory at https://www.polyml.org/software/index.php ?
The modules mechanism was added quite a long time ago and as far as I'm aware isn't used much. The original idea was that it would enable a packager to package up Poly/ML along with a set of modules from various sources. This model is quite common for other languages. The problem is that modules can only be imported into the same executable. There is also the problem that you've noted where opaque types in different modules don't match. This comes ultimately from the fact that types are identified by ML references and that the references are different in different modules.
It might be possible to fix the opaque type problem but I'm not sure how useful it would be. I get the impression that most users of Poly/ML build their own executables from source and so would need to compile the modules they need anyway.
Regards, David
On 30/07/2025 22:07, vqn wrote:
Hello,
Over the past few months, I have been working on an implementation of the ML Basis system for Poly/ML. It supports the complete mlb spec and is available both as a library and a cli tool:
https://github.com/vqns/polymlb
On a side note, I have been trying to implement incremental compilation by caching compiled .mlb files (i.e compiler namespaces) and exporting and reimporting them through {save,load}ModuleBasic. I have however been running into the issue that exporting each .mlb to a different on-disk module causes opaque types mismatch when reimporting them. What would be the reason for that?
I have managed to work around it by exporting everything to the same file, but that result in a fairly large cache, e.g ~45mb for smlfmt (1.2mb executable, 15k loc). I suppose the reason for that is that I export the basis library as well, but I'm not sure there is a solution for that. _______________________________________________ Poly/ML mailing list -- polyml@lists.polyml.org To unsubscribe send an email to polyml-leave@lists.polyml.org