--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/54627973-7b74-47d7-9e35-4270621e6c91n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/22887a7e-a1b6-4ccc-98bf-69a5ad3551a5n%40googlegroups.com.
Sorry, correction: If, at any moment, you call any function from that module at runtime, you must not remove the runtime time dependency.
On Sun, Sep 11, 2022 at 8:55 PM José Valim <jose.valim@dashbit.co> wrote:
Why do you want to remove the runtime dependency when, per your description:> In Ash Framework, we have declarative ways to construct runtime behavior using behaviors.Emphasis mine. If, at any moment, you call any function from that module at runtime, you must not remove the compile time dependency.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/22887a7e-a1b6-4ccc-98bf-69a5ad3551a5n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2BVkL%2B1V7LTDVyzhCqcNWrmHFPoWx2Fp916Ur%2ByL%2BiVBA%40mail.gmail.com.
So all we we do is hold onto the module, and then at runtime we go through the list of modules that we should call and call a specific function on them. Requiring a runtime dependency for that is causing really slow compile times because of transitive dependencies. Maybe there is some consequence I don't see, but I removed the runtime dependencies by disabling the lexical tracker when expanding the alias, and its been that way for months w/o anyone reporting any issues with that implementation. Aside from having to use `warn: false` if they use aliases.
To me, its the same as if they gave us, instead of a module, an `atom` that referred to application configuration, i.e the adapter pattern. That would work without a runtime dependency, so why couldn't this?
On Sun, Sep 11, 2022 at 2:56 PM, José Valim <jose....@dashbit.co> wrote:
Sorry, correction: If, at any moment, you call any function from that module at runtime, you must not remove the runtime time dependency.
On Sun, Sep 11, 2022 at 8:55 PM José Valim <jose....@dashbit.co> wrote:
Why do you want to remove the runtime dependency when, per your description:> In Ash Framework, we have declarative ways to construct runtime behavior using behaviors.Emphasis mine. If, at any moment, you call any function from that module at runtime, you must not remove the compile time dependency.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/22887a7e-a1b6-4ccc-98bf-69a5ad3551a5n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2BVkL%2B1V7LTDVyzhCqcNWrmHFPoWx2Fp916Ur%2ByL%2BiVBA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/l7xp6eut.444ff913-f528-4b88-805a-cac120cdb4d6%40we.are.superhuman.com.
Hm...yeah, that makes sense. Are there other things a runtime dependency is meant to do aside from ensure that transitive compile time dependencies are properly tracked? If so, is there a way to solve for the transitive dependencies without removing the runtime dependency? Because ultimately the idea here is that this module is essentially just a big validated/extensible configuration. The resource itself doesn't do anything. So requiring things that refer to a resource to recompile when any of the modules it refers to in a `change` like that is unnecessary. However we can express that reality is totally fine with me.
On Sunday, September 11, 2022 at 3:05:18 PM UTC-4 José Valim wrote:
The issue is in the transitive compile time dependencies, not the runtime dependencies.I don't think we should be encouraging removing the runtime dependencies when they are explicitly listed in the code as above. When done via configuration, at least you are not literally listing it.On Sun, Sep 11, 2022 at 8:59 PM Zach Daniel <zachary....@gmail.com> wrote:So all we we do is hold onto the module, and then at runtime we go through the list of modules that we should call and call a specific function on them. Requiring a runtime dependency for that is causing really slow compile times because of transitive dependencies. Maybe there is some consequence I don't see, but I removed the runtime dependencies by disabling the lexical tracker when expanding the alias, and its been that way for months w/o anyone reporting any issues with that implementation. Aside from having to use `warn: false` if they use aliases.
To me, its the same as if they gave us, instead of a module, an `atom` that referred to application configuration, i.e the adapter pattern. That would work without a runtime dependency, so why couldn't this?
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/072bb99d-09a0-4567-a934-f8893015dd91n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/072bb99d-09a0-4567-a934-f8893015dd91n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/l80s9s37.13dfe243-83b3-4133-8aad-7a86910f56fa%40we.are.superhuman.com.
As I mentioned, the issue on transitive compile-time dependencies are the compile-time deps, not the runtime ones. So I would focus on how to eliminate those. Otherwise I am not sure we will agree on the problem statement. :)
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/072bb99d-09a0-4567-a934-f8893015dd91n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/l80s9s37.13dfe243-83b3-4133-8aad-7a86910f56fa%40we.are.superhuman.com.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4J8qxM%3DKxMUUW6X%2Bt%2BrD9rKn0yDHbDY1fDgopxRvtNn5A%40mail.gmail.com.
Well, its runtime dependencies that create transitive compile time dependencies, isn't it? So if I have a function like
defmodule Foo do
 # callers are aware that they can't use the module at compile time def returns_a_module() do   SomeSpecificModule end
 def something_used_at_compile_time() do
  10
 end
end
# and then some other module
defmodule Bar do
 @something Foo.something_used_at_compile_time()
endThis induces a transitive compile time dependency from Bar to SomeSpecificModule.
In the case of Ash DSLs, for example, this happens because we store the resulting configuration in a module attribute. Users are aware that you can't call these pluggable modules at compile time. Only the framework code calls those modules. The above example is contrived, of course, I'm not suggesting that we need a feature to make *that* work, just trying to draw some kind of parallel.
I don't see a reasonable way to handle this without essentially removing the ability to use modules in the way that we are. It would be a pretty unreasonable amount of work/change for users to change the way that we plug behavior in Ash.
To me, another kind of module dependency, like `runtime-only`, would solve for this, and it would have to be explicitly requested, i.e `expand_literal(.., runtime_only: true)`. Then when determining transitive compile time dependencies, the compiler would not use those modules.On Tue, Sep 13, 2022 at 6:51 PM, José Valim <jose....@dashbit.co> wrote:As I mentioned, the issue on transitive compile-time dependencies are the compile-time deps, not the runtime ones. So I would focus on how to eliminate those. Otherwise I am not sure we will agree on the problem statement. :)
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/072bb99d-09a0-4567-a934-f8893015dd91n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/l80s9s37.13dfe243-83b3-4133-8aad-7a86910f56fa%40we.are.superhuman.com.
--You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4J8qxM%3DKxMUUW6X%2Bt%2BrD9rKn0yDHbDY1fDgopxRvtNn5A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/325ea272-674a-4a5a-9228-6af11579bd05n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/73a308e4-59e9-4f23-bb92-1417855cc996n%40googlegroups.com.
What I am saying is that you need to rethink the approach altogether. :)As you said, the issue is with compile-time dependencies. Rewriting compile-time dependencies to export dependencies and changing signatures for recompilation is a brittle work-around the compiler.With @after_verify, you should be able to treat all of them as runtime dependencies, and let the @after_verify callback be invoked whenever you are supposed to verify them again. :) This means you no longer need to track compile, exports, etc. The compiler is doing all the job for you!
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/73a308e4-59e9-4f23-bb92-1417855cc996n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4KrE3xy3PnQecUP0HM%2BMNx6dboS0Ar50p8cBW9qAAwP-w%40mail.gmail.com.
I guess what I'm ultimately confused about is what *absolutely necessitates* a runtime dependency becoming a transitive compile time dependency.
In the case of Ash resources, they are introspectable configurations. Some modules that you get back when inspecting that configuration make sense to "do something with" at compile time. Others absolutely don't. In Ash these things are modeled as behaviours because that is the way that I can define a functional contract. Not being able to refer to modules in this way essentially forces us to bypass the compiler.