Code in Mix config files aka. Build Dependencies - new feature?

39 views
Skip to first unread message

florian...@planprop.de

unread,
Mar 16, 2018, 6:52:18 AM3/16/18
to elixir-lang-core
Currently, there is no obvious way to use compiled code or external packages in Mix config files. 

There are good reasons to not be able to use application code, because it's the responsibility of Mix to build that code in the first place.

Still, it's desirable to be able to introduce abstractions in config files, else there is lots of low-quality ad-hoc code in configs, foreseeably.

It is possible to place e.g. script code in `config/support.exs` and place `Code.load_file("config/support.exs")` at the top of `config/config.exs`, but that's only a workaround. And one that makes testing and reused quite hard. 

The question is - would it make sense to introduce *build dependencies* to Mix?

Build dependencies are a feature many compiled languages use. Java for certain uses it, npm devDependencies fulfill the same role in Javascript, if I'm not mistaken.

They might be fetched and compiled in an additional build step.

José Valim

unread,
Mar 16, 2018, 6:58:04 AM3/16/18
to elixir-l...@googlegroups.com
The mechanism to do so currently in Mix is via archives. They do have some limitations in that the installation is manual but that would probably be the best way to extend configs.



José Valim
Founder and 
Director of R&D

--
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/76181150-40c4-478e-99ca-3bddd7314519%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Florian Ebeling

unread,
Mar 16, 2018, 8:30:42 AM3/16/18
to elixir-l...@googlegroups.com
I wasn’t aware of that. Thanks for pointing it out. And that’s probably enough, even if support for fetch, project-specific installation and search path are likely useful extensions.

> On 16 Mar 2018, at 11:57, José Valim <jose....@gmail.com> wrote:
>
> The mechanism to do so currently in Mix is via archives. They do have some limitations in that the installation is manual but that would probably be the best way to extend configs.
>
>
>
> José Valim
> www.plataformatec.com.br
> Founder and Director of R&D
>
> On Fri, Mar 16, 2018 at 11:52 AM, <florian...@planprop.de> wrote:
> Currently, there is no obvious way to use compiled code or external packages in Mix config files.
>
> There are good reasons to not be able to use application code, because it's the responsibility of Mix to build that code in the first place.
>
> Still, it's desirable to be able to introduce abstractions in config files, else there is lots of low-quality ad-hoc code in configs, foreseeably.
>
> It is possible to place e.g. script code in `config/support.exs` and place `Code.load_file("config/support.exs")` at the top of `config/config.exs`, but that's only a workaround. And one that makes testing and reused quite hard.
>
> The question is - would it make sense to introduce *build dependencies* to Mix?
>
> Build dependencies are a feature many compiled languages use. Java for certain uses it, npm devDependencies fulfill the same role in Javascript, if I'm not mistaken.
>
> They might be fetched and compiled in an additional build step.
>
>
> --
> 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.
> --
> You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-core" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-core/AzSNanGU9gs/unsubscribe.
> To unsubscribe from this group and all its topics, 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%2Bw29fWJdy2ihRaMvbEObtoG6C7Ud7yRGNUxdUjTZExOQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages