what is point of having a .erlang file?

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

what is point of having a .erlang file?

Sam Overdorf
What is the point of having a".erlang" file if I have to run
"c:erlangrc()" in all of my programs.

I like to add a search a path when all of my programs run and not just
some of them. It shouldn't make any difference if I run them with
"erl" or "escript".

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: what is point of having a .erlang file?

Jesper Louis Andersen-2
On Mon, Jan 21, 2019 at 1:53 AM Sam Overdorf <[hidden email]> wrote:
What is the point of having a".erlang" file if I have to run
"c:erlangrc()" in all of my programs.


Usually, it is to have a set of development changes and configurations to the Erlang system. There might be some helper functionality you wrote for yourself, or tend to use in projects you want to check out. Rather than having to add them to each project, it is somewhat easier to configure them from a central point. This is also, roughly, its historical usage to my knowledge.

However, it is a doubly edged sword, insofar it also means that the software you run has local configuration and setup. If more than one developer works on the same set of software, the local configuration can mean the software doesn't run without the .erlangrc specific configuration. To a large extend, the focus on standard tooling such as Continuous Integration/Continuous Deployment seek to alleviate this. An even more modern approach is to always build everything the same way scratch such that the software is built in a reproducible way with idempotence as well.

My experience is that the more these (admittedly functional programming-like) ways of handling software builds are adapted, the easier it gets to work on software.


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

Re: what is point of having a .erlang file?

Sam Overdorf
 I have customers and I want the same configuration for all of them so
".erlang" sounds like a good option for me.

The problems is "erl" will run the ".erlang" file but "escript" does
not run the ".erlang" file.

I prefer to use "escript" because the consistent handling of arguments
passed in.

What is the solution?

Thanks,
Sam Overdorf
[hidden email]


On Mon, Jan 21, 2019 at 7:35 AM Jesper Louis Andersen
<[hidden email]> wrote:

>
> On Mon, Jan 21, 2019 at 1:53 AM Sam Overdorf <[hidden email]> wrote:
>>
>> What is the point of having a".erlang" file if I have to run
>> "c:erlangrc()" in all of my programs.
>>
>
> Usually, it is to have a set of development changes and configurations to the Erlang system. There might be some helper functionality you wrote for yourself, or tend to use in projects you want to check out. Rather than having to add them to each project, it is somewhat easier to configure them from a central point. This is also, roughly, its historical usage to my knowledge.
>
> However, it is a doubly edged sword, insofar it also means that the software you run has local configuration and setup. If more than one developer works on the same set of software, the local configuration can mean the software doesn't run without the .erlangrc specific configuration. To a large extend, the focus on standard tooling such as Continuous Integration/Continuous Deployment seek to alleviate this. An even more modern approach is to always build everything the same way scratch such that the software is built in a reproducible way with idempotence as well.
>
> My experience is that the more these (admittedly functional programming-like) ways of handling software builds are adapted, the easier it gets to work on software.
>
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: what is point of having a .erlang file?

Hugo Mills-2
On Mon, Jan 21, 2019 at 01:54:03PM -0800, Sam Overdorf wrote:

>  I have customers and I want the same configuration for all of them so
> ".erlang" sounds like a good option for me.
>
> The problems is "erl" will run the ".erlang" file but "escript" does
> not run the ".erlang" file.
>
> I prefer to use "escript" because the consistent handling of arguments
> passed in.
>
> What is the solution?
   I would suggest to use releases for your non-escript packages, and
use either escript's ability to package a full runtime system in with
the escript, or use it's ability to pass command-line options in the
second or third line of the script. To quote the man page on that:

      On the third line (or second line depending on the  presence  of
      the  Emacs  directive), arguments can be specified to the emula‐
      tor, for example:

      %%! -smp enable -sname factorial -mnesia debug verbose

   Hugo.

> Thanks,
> Sam Overdorf
> [hidden email]
>
>
> On Mon, Jan 21, 2019 at 7:35 AM Jesper Louis Andersen
> <[hidden email]> wrote:
> >
> > On Mon, Jan 21, 2019 at 1:53 AM Sam Overdorf <[hidden email]> wrote:
> >>
> >> What is the point of having a".erlang" file if I have to run
> >> "c:erlangrc()" in all of my programs.
> >>
> >
> > Usually, it is to have a set of development changes and configurations to the Erlang system. There might be some helper functionality you wrote for yourself, or tend to use in projects you want to check out. Rather than having to add them to each project, it is somewhat easier to configure them from a central point. This is also, roughly, its historical usage to my knowledge.
> >
> > However, it is a doubly edged sword, insofar it also means that the software you run has local configuration and setup. If more than one developer works on the same set of software, the local configuration can mean the software doesn't run without the .erlangrc specific configuration. To a large extend, the focus on standard tooling such as Continuous Integration/Continuous Deployment seek to alleviate this. An even more modern approach is to always build everything the same way scratch such that the software is built in a reproducible way with idempotence as well.
> >
> > My experience is that the more these (admittedly functional programming-like) ways of handling software builds are adapted, the easier it gets to work on software.
> >
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
--
Hugo Mills             | Gort! Klaatu barada nikto!
hugo@... carfax.org.uk |
http://carfax.org.uk/  |
PGP: E2AB1DE4          |                         The Day the Earth Stood Still

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

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: what is point of having a .erlang file?

Roger Lipscombe-2
In reply to this post by Sam Overdorf
On Mon, 21 Jan 2019 at 21:45, Sam Overdorf <[hidden email]> wrote:
>
>  I have customers and I want the same configuration for all of them so
> ".erlang" sounds like a good option for me.

~/.erlang is for when you want *different* configuration.
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: what is point of having a .erlang file?

Steve Vinoski-2


On Tue, Jan 22, 2019 at 9:15 AM Roger Lipscombe <[hidden email]> wrote:
On Mon, 21 Jan 2019 at 21:45, Sam Overdorf <[hidden email]> wrote:
>
>  I have customers and I want the same configuration for all of them so
> ".erlang" sounds like a good option for me.

~/.erlang is for when you want *different* configuration.

Roger is correct, and also, you've asked this same question in two other threads in the recent past:


The answers you've already gotten clearly aren't what you want to hear, but they've consistently indicated you're misusing the ~/.erlang feature.

--steve

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

Re: what is point of having a .erlang file?

Jesper Louis Andersen-2
In reply to this post by Sam Overdorf
On Mon, Jan 21, 2019 at 10:45 PM Sam Overdorf <[hidden email]> wrote:
 I have customers and I want the same configuration for all of them so
".erlang" sounds like a good option for me.

The problems is "erl" will run the ".erlang" file but "escript" does
not run the ".erlang" file.

I prefer to use "escript" because the consistent handling of arguments
passed in.

What is the solution?


Usually, Erlang systems are run as releases. They specify configuration in a file, usually sys.config but that file can read further configuration from another file, or you can override configuration on the command line.

However, I am curious about your process of running your software. Maybe, if you explained it, we would be able to describe an alternative way of handling the distribution and running of said software.


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