Re: [elixir-core:8236] PROPOSAL: Code.beam_instructions/2

2018-08-06 Thread José Valim
What do you think about Michal's decompile package: https://github.com/michalmuskala/decompile You can install as an archive and use it any project from the command line and it supports multiple formats. *José Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R On Mon,

[elixir-core:8236] PROPOSAL: Code.beam_instructions/2

2018-08-06 Thread Devon Estes
As part of debugging an issue in Benchee recently, we needed to look at BEAM instructions for some code to see what exactly was being generated on OTP 20 and OTP 21. I also know of several other people in the community that need to look at the BEAM instructions from time to time, either for

Re: [elixir-core:8242] Re: Proposal: make Application.get_env being able to resolve {:system, var} tuple out of the box

2018-08-06 Thread Paul Schoenfelder
In my opinion we absolutely should not support this. It is an old convention that was created to patch over problems with configuration in releases, but it has been considered a bad pattern for quite some time now. Not only are there better patterns available (see Phoenix and Ecto and their init/1

Re: [elixir-core:8242] Re: Proposal: make Application.get_env being able to resolve {:system, var} tuple out of the box

2018-08-06 Thread Allen Madsen
I believe the community is moving away from the {:system, var} pattern, though some libraries will continue to support it. I believe the short term solution being worked on is to allow your config to run at runtime. Which would mean you could just do System.get_env/1. The longer term push is

[elixir-core:8241] Re: Proposal: make Application.get_env being able to resolve {:system, var} tuple out of the box

2018-08-06 Thread OvermindDL1
But what if I want to read it from a data store, or the database, or a variety of other places. A whole configuration handling overhaul has been discussed on the forums not long ago: https://elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302 For now,

[elixir-core:8242] Re: Proposal: make Application.get_env being able to resolve {:system, var} tuple out of the box

2018-08-06 Thread Ivan Yurov
I agree that in general this is not something that should be defined in the language core or the standard lib. However, configuration (application env) is already managed by elixir, and this pattern to access system env var is a widely used by the libraries, so this might appear confusing for

Re: [elixir-core:8245] Re: Proposal: make Application.get_env being able to resolve {:system, var} tuple out of the box

2018-08-06 Thread Ivan Yurov
So the idea is to individually resolve these settings in init callback, am I getting it right? https://github.com/elixir-ecto/ecto/blob/master/lib/ecto/repo.ex#L69-L75 Well, if I do that, I'll have to use the ENV variable in dev environment as well, which I wouldn't want to do for obvious

Re: [elixir-core:8245] Re: Proposal: make Application.get_env being able to resolve {:system, var} tuple out of the box

2018-08-06 Thread Paul Schoenfelder
> So the idea is to individually resolve these settings in init callback, am I getting it right? https://github.com/elixir-ecto/ecto/blob/master/lib/ecto/repo.ex#L69-L75 > Well, if I do that, I'll have to use the ENV variable in dev environment as well, which I wouldn't want to do for obvious

[elixir-core:8238] Re: Feature Request: tap function

2018-08-06 Thread Khaja Minhajuddin
I'd love to see `tap` be part of the `Enum` module. I use it a lot in our app to emit events. On Friday, October 21, 2016 at 2:21:07 AM UTC+5:30, jbo...@wistia.com wrote: > > In Ruby I've found Object#tap > to be really > useful when

Re: [elixir-core:8239] PROPOSAL: Code.beam_instructions/2

2018-08-06 Thread Devon Estes
I didn't know that existed! I mean, I guess that could at least be a starting point for something. Needs some more documentation to make it a little more SEO friendly, though ;) On Monday, August 6, 2018 at 10:39:58 AM UTC+2, José Valim wrote: > > What do you think about Michal's decompile

[elixir-core:8240] Proposal: make Application.get_env being able to resolve {:system, var} tuple out of the box

2018-08-06 Thread Ivan Yurov
While playing with deployment I found out that some libraries provide this feature that you can put {:system, var} in configuration and then it's resolved at runtime. However if it's in my code, I'd have to implement it on my own. Wouldn't it be nice if it was supported by Application module by