Skip to content
This repository has been archived by the owner on Jan 28, 2019. It is now read-only.

Think about in-ns, ns and multi-file namespaces. #150

Open
arrdem opened this issue Oct 11, 2016 · 1 comment
Open

Think about in-ns, ns and multi-file namespaces. #150

arrdem opened this issue Oct 11, 2016 · 1 comment

Comments

@arrdem
Copy link
Collaborator

arrdem commented Oct 11, 2016

I'm not entirely sure what the interaction is, but it seems that in some cases of AOT compilation the versioned namespace features (#60) can cause most of the standard library to become marked stale. This is really really annoying for users, because they get a boatload of warnings whenever they do much of anything and seems to point to larger problems with the way that my model of namespace loading (namespaces are modules, one at a time somewhat atomically) maps to Clojure/Jaunt which is actually a form-at-a-time compiler which uses mutation of global state to continuously introduce updates.

Maybe there needs to be some dynamic loading context used to understand the stack of namespaces currently being loaded so that ns version bumps are avoided as long as that dynamic scope is present and the module(s) are flagged as currently being loaded. This could be implemented as easily as taking clojure.core/*pending-paths*, moving that into RT and executing the doInit load of clojure/core.{class|clj} with clojure/core.clj already in the *pending-paths* stack. ns and in-ns would need to be modified to search *pending-paths* then in order to decide whether or not to increment the namespace serial number. Some sanitization to just the namespace path will probably be required here.

@arrdem
Copy link
Collaborator Author

arrdem commented Oct 11, 2016

This dovetails with (#58, #100, #143) wrt considering namespaces to be more like modules, and with #145 which is a step towards making clojure.core less magical and more modular or normal by enabling the use of something approaching the typical import syntax.

The broad question here is now much of the namespace system do I want to lift out of clojure.core and bake into either RT or the compiler. Right now, RT provides a bootstrap load and a bootstrap ns which are quickly replaced in clojure.core with more fully featured implementations. However if making core more normal is a goal, there's a legitimate question as to why ns is well not a special form. #145 is totally guilty of starting to make import* smarter for exactly this reason so where should this stop?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant