Get the currently accessible paths (Load_path.get_path_list) from a toplevel plugin

Note that omod has the same problem. It’s maintaining its own data structures about included path and loaded objects.

Now of course if you #directory or #load, or use ocamlfind’s #require on your side omod will not be aware of these which could lead to all sorts of odd behaviours. My implementation of the library linking proposal upstream had patches to solve that e.g. here.

On the topic of omod what I’d like is to eventually provide the same functionality, that is load by module name – which is what matters to users – but by going back to use META files to lookup dependencies since it seems those are unlikely to go and nowadays have information that cannot be obtained via omod’s data driven strategy (exports).

After having done that I’d like to provide, opt-in, “autoload” functionality where basically stuff will be automatically loaded (as was once prototyped in another context) as you use it. If the result ends up being small enough and not too brittle I think I’ll add this directly to down and leave omod to rot. The day I get time on my hands…

1 Like