otp 21.2

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

otp 21.2

Sam Overdorf
This version does not load my ".erlang" file when I run "escript".
If I run "erl" it gets loaded as expected.
Thanks,
Sam Overdorf
[hidden email]
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Dan Gudmundsson-3
Loading .erlang have intentionally been removed from escript,
as noted in the release notes for 21.0.
You can load it manually from your escripts if want, see c:erlangrc/1



On Wed, Dec 12, 2018 at 12:46 AM Sam Overdorf <[hidden email]> wrote:
This version does not load my ".erlang" file when I run "escript".
If I run "erl" it gets loaded as expected.
Thanks,
Sam Overdorf
[hidden email]
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Kenneth Lundin-5
In reply to this post by Sam Overdorf


Den ons 12 dec. 2018 00:47 skrev Sam Overdorf <[hidden email]>:
This version does not load my ".erlang" file when I run "escript".
If I run "erl" it gets loaded as expected.

This is a change made on purpose, and introduced in 21.0.

In the README for OTP-21.0 we have:

--- Improvements and New Features ---

  OTP-14439    Application(s): compiler, dialyzer, erts, stdlib

               *** POTENTIAL INCOMPATIBILITY ***

               Changed the default behaviour of .erlang loading:
               .erlang is no longer loaded from the current directory.
               c:erlangrc(PathList) can be used to search and load an
               .erlang file from user specified directories.

               escript, erlc, dialyzer and typer no longer load an
               .erlang at all.
/Kenneth Erlang/OTP, Ericsson


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Sam Overdorf
"erl" still has the behavior of loading the ".erlangrc". Shouldn't it
have the same behavior as escript to be consistent?

Thanks,
Sam






On Tue, Dec 11, 2018 at 10:44 PM Kenneth Lundin <[hidden email]> wrote:

>
>
>
> Den ons 12 dec. 2018 00:47 skrev Sam Overdorf <[hidden email]>:
>>
>> This version does not load my ".erlang" file when I run "escript".
>> If I run "erl" it gets loaded as expected.
>
>
> This is a change made on purpose, and introduced in 21.0.
>
> In the README for OTP-21.0 we have:
>
> --- Improvements and New Features ---
>
>   OTP-14439    Application(s): compiler, dialyzer, erts, stdlib
>
>                *** POTENTIAL INCOMPATIBILITY ***
>
>                Changed the default behaviour of .erlang loading:
>                .erlang is no longer loaded from the current directory.
>                c:erlangrc(PathList) can be used to search and load an
>                .erlang file from user specified directories.
>
>                escript, erlc, dialyzer and typer no longer load an
>                .erlang at all.
>
> /Kenneth Erlang/OTP, Ericsson
>>
>>
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Richard O'Keefe
The .erlang file is a customisation file for "erl".
It's just like the way a .gdbinit file will be read
if you run a C program under GDB.


On Thu, 13 Dec 2018 at 12:08, Sam Overdorf <[hidden email]> wrote:
"erl" still has the behavior of loading the ".erlangrc". Shouldn't it
have the same behavior as escript to be consistent?

Thanks,
Sam






On Tue, Dec 11, 2018 at 10:44 PM Kenneth Lundin <[hidden email]> wrote:
>
>
>
> Den ons 12 dec. 2018 00:47 skrev Sam Overdorf <[hidden email]>:
>>
>> This version does not load my ".erlang" file when I run "escript".
>> If I run "erl" it gets loaded as expected.
>
>
> This is a change made on purpose, and introduced in 21.0.
>
> In the README for OTP-21.0 we have:
>
> --- Improvements and New Features ---
>
>   OTP-14439    Application(s): compiler, dialyzer, erts, stdlib
>
>                *** POTENTIAL INCOMPATIBILITY ***
>
>                Changed the default behaviour of .erlang loading:
>                .erlang is no longer loaded from the current directory.
>                c:erlangrc(PathList) can be used to search and load an
>                .erlang file from user specified directories.
>
>                escript, erlc, dialyzer and typer no longer load an
>                .erlang at all.
>
> /Kenneth Erlang/OTP, Ericsson
>>
>>
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Sam Overdorf
I believe you missed the point that they "erl" and "escript" should
have the same behavior.
Sam




On Wed, Dec 12, 2018 at 3:16 PM Richard O'Keefe <[hidden email]> wrote:

>
> The .erlang file is a customisation file for "erl".
> It's just like the way a .gdbinit file will be read
> if you run a C program under GDB.
>
>
> On Thu, 13 Dec 2018 at 12:08, Sam Overdorf <[hidden email]> wrote:
>>
>> "erl" still has the behavior of loading the ".erlangrc". Shouldn't it
>> have the same behavior as escript to be consistent?
>>
>> Thanks,
>> Sam
>>
>>
>>
>>
>>
>>
>> On Tue, Dec 11, 2018 at 10:44 PM Kenneth Lundin <[hidden email]> wrote:
>> >
>> >
>> >
>> > Den ons 12 dec. 2018 00:47 skrev Sam Overdorf <[hidden email]>:
>> >>
>> >> This version does not load my ".erlang" file when I run "escript".
>> >> If I run "erl" it gets loaded as expected.
>> >
>> >
>> > This is a change made on purpose, and introduced in 21.0.
>> >
>> > In the README for OTP-21.0 we have:
>> >
>> > --- Improvements and New Features ---
>> >
>> >   OTP-14439    Application(s): compiler, dialyzer, erts, stdlib
>> >
>> >                *** POTENTIAL INCOMPATIBILITY ***
>> >
>> >                Changed the default behaviour of .erlang loading:
>> >                .erlang is no longer loaded from the current directory.
>> >                c:erlangrc(PathList) can be used to search and load an
>> >                .erlang file from user specified directories.
>> >
>> >                escript, erlc, dialyzer and typer no longer load an
>> >                .erlang at all.
>> >
>> > /Kenneth Erlang/OTP, Ericsson
>> >>
>> >>
>> _______________________________________________
>> erlang-questions mailing list
>> [hidden email]
>> http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Dan Sommers
On 12/12/18 5:30 PM, Sam Overdorf wrote:
> I believe you missed the point that they "erl" and "escript" should
> have the same behavior.

I don't know the exact reason for the change, but if your escript
depends on your .erlang file, then you can't share it with anyone.

In fact, if your escript even just loads your .erlang file, then
you can't share it with anyone.

I believe that the correct behaviour for escript is *not* to read
a .erlang file, unless directed to do so explicitly.

Dan
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Sam Overdorf
This kind of defeats the purpose of an ".rc" file.
The unix world uses them to set default behavior for scripts and programs.
Now I have to remember to add "c:erlangrc()" to each of my programs.
If I forget to do this then OOPs things don't work correctly.

Sam





On Wed, Dec 12, 2018 at 9:01 PM Dan Sommers
<[hidden email]> wrote:

>
> On 12/12/18 5:30 PM, Sam Overdorf wrote:
> > I believe you missed the point that they "erl" and "escript" should
> > have the same behavior.
>
> I don't know the exact reason for the change, but if your escript
> depends on your .erlang file, then you can't share it with anyone.
>
> In fact, if your escript even just loads your .erlang file, then
> you can't share it with anyone.
>
> I believe that the correct behaviour for escript is *not* to read
> a .erlang file, unless directed to do so explicitly.
>
> Dan
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Andrew Thompson-2
On Sat, Dec 15, 2018 at 03:51:18PM -0800, Sam Overdorf wrote:
> This kind of defeats the purpose of an ".rc" file.
> The unix world uses them to set default behavior for scripts and programs.
> Now I have to remember to add "c:erlangrc()" to each of my programs.
> If I forget to do this then OOPs things don't work correctly.

This is like expecting bash shell scripts to source your ~/.bashrc.
.bashrc is only sourced for interactive shells, not non-interactive
shells, like the one invoked by the shebang line in a shell script.

Arguably you're relying on incorrect behaviour in escript and you should
adjust your usage accordingly.

Andrew
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Sam Overdorf
I have decided that this is really dumb that I have to run the
function "c:erlangrc()" just to load my ".erlang" file.
Some of my erlang files have multiple entry points and I have to
execute the function within each one of them (dumb idea).

I'm use to having a configuration file that will get loaded every time
something "erlang" gets executed.
I don't care if I can't share my erlang with you. I have bigger things
to make work and that is why I need and use the ".erlang" file.

Sam




On Sat, Dec 15, 2018 at 4:30 PM Andrew Thompson <[hidden email]> wrote:

>
> On Sat, Dec 15, 2018 at 03:51:18PM -0800, Sam Overdorf wrote:
> > This kind of defeats the purpose of an ".rc" file.
> > The unix world uses them to set default behavior for scripts and programs.
> > Now I have to remember to add "c:erlangrc()" to each of my programs.
> > If I forget to do this then OOPs things don't work correctly.
>
> This is like expecting bash shell scripts to source your ~/.bashrc.
> .bashrc is only sourced for interactive shells, not non-interactive
> shells, like the one invoked by the shebang line in a shell script.
>
> Arguably you're relying on incorrect behaviour in escript and you should
> adjust your usage accordingly.
>
> Andrew
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Michael Truog
On 12/19/18 3:58 PM, Sam Overdorf wrote:

> I have decided that this is really dumb that I have to run the
> function "c:erlangrc()" just to load my ".erlang" file.
> Some of my erlang files have multiple entry points and I have to
> execute the function within each one of them (dumb idea).
>
> I'm use to having a configuration file that will get loaded every time
> something "erlang" gets executed.
> I don't care if I can't share my erlang with you. I have bigger things
> to make work and that is why I need and use the ".erlang" file.
>
> Sam
When Erlang is used in production, it is best to not have it loading a
.erlang file that contains random things.  For your own experimentation
or development, you can always load things from .erlang with
c:erlangrc/1 as was previously described.  If Erlang loaded a .erlang
file by default upon startup, it would be difficult to take it seriously
for production use.

Best Regards,
Michael
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Sam Overdorf
I don't know about you but if I am responsible for a production
environment I am in control of how everything starts and stops and
everything in between.
My goal for having all of this control is I want my production
environment to run simply and smoothly for all of my users.
My way of making it simple and smooth is to control everything and the
more tools I have to do this the better.

Sam




On Wed, Dec 19, 2018 at 4:23 PM Michael Truog <[hidden email]> wrote:

>
> On 12/19/18 3:58 PM, Sam Overdorf wrote:
> > I have decided that this is really dumb that I have to run the
> > function "c:erlangrc()" just to load my ".erlang" file.
> > Some of my erlang files have multiple entry points and I have to
> > execute the function within each one of them (dumb idea).
> >
> > I'm use to having a configuration file that will get loaded every time
> > something "erlang" gets executed.
> > I don't care if I can't share my erlang with you. I have bigger things
> > to make work and that is why I need and use the ".erlang" file.
> >
> > Sam
> When Erlang is used in production, it is best to not have it loading a
> .erlang file that contains random things.  For your own experimentation
> or development, you can always load things from .erlang with
> c:erlangrc/1 as was previously described.  If Erlang loaded a .erlang
> file by default upon startup, it would be difficult to take it seriously
> for production use.
>
> Best Regards,
> Michael
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Michael Truog
On 12/20/18 4:01 PM, Sam Overdorf wrote:
> I don't know about you but if I am responsible for a production
> environment I am in control of how everything starts and stops and
> everything in between.
> My goal for having all of this control is I want my production
> environment to run simply and smoothly for all of my users.
> My way of making it simple and smooth is to control everything and the
> more tools I have to do this the better.
>
Loading random source code from a file at ${HOME}/.erlang that lacks
visibility and is outside of the release, as part of the release, as if
it was meant to be there does not help the release be more dependable. 
The random source code can cause problems, and avoiding the potential
for it to be the source of problems is a great way to pursue having a
dependable release.  Random source code can always be entered into the
shell, which should be logged, or added to a module that is properly
within the release and that gives it visibility, allowing it to be tracked.

Best Regards,
Michael
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Sam Overdorf
It is hardly random source. It is only stuff supported by me because
it is my application supported by me.

Sam




On Thu, Dec 20, 2018 at 6:42 PM Michael Truog <[hidden email]> wrote:

>
> On 12/20/18 4:01 PM, Sam Overdorf wrote:
> > I don't know about you but if I am responsible for a production
> > environment I am in control of how everything starts and stops and
> > everything in between.
> > My goal for having all of this control is I want my production
> > environment to run simply and smoothly for all of my users.
> > My way of making it simple and smooth is to control everything and the
> > more tools I have to do this the better.
> >
> Loading random source code from a file at ${HOME}/.erlang that lacks
> visibility and is outside of the release, as part of the release, as if
> it was meant to be there does not help the release be more dependable.
> The random source code can cause problems, and avoiding the potential
> for it to be the source of problems is a great way to pursue having a
> dependable release.  Random source code can always be entered into the
> shell, which should be logged, or added to a module that is properly
> within the release and that gives it visibility, allowing it to be tracked.
>
> Best Regards,
> Michael
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: otp 21.2

Jesper Louis Andersen-2
On Sat, Dec 22, 2018 at 12:16 AM Sam Overdorf <[hidden email]> wrote:
It is hardly random source. It is only stuff supported by me because
it is my application supported by me.


I have some pretty nasty war stories where people couldn't build software on their development machine, whereas the CI system and other users happily built the software. The culprit turned out to be .erlangrc. It is of course easy when you control the environment, but many hours have been wasted on this, trust me.

Regard this is a deliberate design trade-off in the language. My hunch is it saves around 10 people whenever it inconveniences 1.


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions