[ANN] power_shell 1.1.2 has been released

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

[ANN] power_shell 1.1.2 has been released

Maxim Fedorov-2
power_shell is an application providing a convenient way to evaluate
functions extracted from compiled *.beam file, or read from *.erl
source.

How do we use it at WhatsApp?

Debugging on production machines: evaluating functions that are not
exported. For example, dist_util.erl contains gen_challenge/0, but it
is not accessible without making a change to OTP kernel application.
Using power_shell:eval(dist_util, gen_challenge, []) yields the
desired result.

Common Tests: testing functions that are not exported. We want to test
against production build, providing production API.

Development: changing *.erl file and immediately evaluating functions
directly from *.erl file (no need to c(mymodule) to compile and load
updated code).

Package is available on hex:
https://hex.pm/packages/power_shell

Source code is available on GitHub:
https://github.com/WhatsApp/power_shell

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

Re: [ANN] power_shell 1.1.2 has been released

Richard O'Keefe
The example is power_shell:eval(dist_util, gen_challenge, []).
With the arguments being Module, Function, Arguments, why is
it not called power_shell:apply/3?

Since I'm currently trying to learn PowerShell, I was initially
confused by the module name.

On Thu, 19 Sep 2019 at 16:02, Maxim Fedorov <[hidden email]> wrote:
power_shell is an application providing a convenient way to evaluate
functions extracted from compiled *.beam file, or read from *.erl
source.

How do we use it at WhatsApp?

Debugging on production machines: evaluating functions that are not
exported. For example, dist_util.erl contains gen_challenge/0, but it
is not accessible without making a change to OTP kernel application.
Using power_shell:eval(dist_util, gen_challenge, []) yields the
desired result.

Common Tests: testing functions that are not exported. We want to test
against production build, providing production API.

Development: changing *.erl file and immediately evaluating functions
directly from *.erl file (no need to c(mymodule) to compile and load
updated code).

Package is available on hex:
https://hex.pm/packages/power_shell

Source code is available on GitHub:
https://github.com/WhatsApp/power_shell

Enjoy!
_______________________________________________
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: [ANN] power_shell 1.1.2 has been released

Maxim Fedorov-2
There are two reasons to name is eval/3:
1. Clearly indicate evaluation rather than actual execution.
2. Avoid clash with erlang:apply/3. When power_shell is started as an
application (e.g. application:start(power_shell) in Erlang shell), it
becomes a part of the shell, so you can just type eval(mod, fun,
[args]).

As for the project name, it is purely historical, and has no relation
to Microsoft.

Maxim

On Wed, 18 Sep 2019 at 21:06, Richard O'Keefe <[hidden email]> wrote:

>
> The example is power_shell:eval(dist_util, gen_challenge, []).
> With the arguments being Module, Function, Arguments, why is
> it not called power_shell:apply/3?
>
> Since I'm currently trying to learn PowerShell, I was initially
> confused by the module name.
>
> On Thu, 19 Sep 2019 at 16:02, Maxim Fedorov <[hidden email]> wrote:
>>
>> power_shell is an application providing a convenient way to evaluate
>> functions extracted from compiled *.beam file, or read from *.erl
>> source.
>>
>> How do we use it at WhatsApp?
>>
>> Debugging on production machines: evaluating functions that are not
>> exported. For example, dist_util.erl contains gen_challenge/0, but it
>> is not accessible without making a change to OTP kernel application.
>> Using power_shell:eval(dist_util, gen_challenge, []) yields the
>> desired result.
>>
>> Common Tests: testing functions that are not exported. We want to test
>> against production build, providing production API.
>>
>> Development: changing *.erl file and immediately evaluating functions
>> directly from *.erl file (no need to c(mymodule) to compile and load
>> updated code).
>>
>> Package is available on hex:
>> https://hex.pm/packages/power_shell
>>
>> Source code is available on GitHub:
>> https://github.com/WhatsApp/power_shell
>>
>> Enjoy!
>> _______________________________________________
>> 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: [ANN] power_shell 1.1.2 has been released

Richard O'Keefe
"1. Clearly indicate evaluation rather than actual execution."
What does that mean?  Execution is evaluation is execution.


On Fri, 20 Sep 2019 at 15:20, Maxim Fedorov <[hidden email]> wrote:
There are two reasons to name is eval/3:
1. Clearly indicate evaluation rather than actual execution.
2. Avoid clash with erlang:apply/3. When power_shell is started as an
application (e.g. application:start(power_shell) in Erlang shell), it
becomes a part of the shell, so you can just type eval(mod, fun,
[args]).

As for the project name, it is purely historical, and has no relation
to Microsoft.

Maxim

On Wed, 18 Sep 2019 at 21:06, Richard O'Keefe <[hidden email]> wrote:
>
> The example is power_shell:eval(dist_util, gen_challenge, []).
> With the arguments being Module, Function, Arguments, why is
> it not called power_shell:apply/3?
>
> Since I'm currently trying to learn PowerShell, I was initially
> confused by the module name.
>
> On Thu, 19 Sep 2019 at 16:02, Maxim Fedorov <[hidden email]> wrote:
>>
>> power_shell is an application providing a convenient way to evaluate
>> functions extracted from compiled *.beam file, or read from *.erl
>> source.
>>
>> How do we use it at WhatsApp?
>>
>> Debugging on production machines: evaluating functions that are not
>> exported. For example, dist_util.erl contains gen_challenge/0, but it
>> is not accessible without making a change to OTP kernel application.
>> Using power_shell:eval(dist_util, gen_challenge, []) yields the
>> desired result.
>>
>> Common Tests: testing functions that are not exported. We want to test
>> against production build, providing production API.
>>
>> Development: changing *.erl file and immediately evaluating functions
>> directly from *.erl file (no need to c(mymodule) to compile and load
>> updated code).
>>
>> Package is available on hex:
>> https://hex.pm/packages/power_shell
>>
>> Source code is available on GitHub:
>> https://github.com/WhatsApp/power_shell
>>
>> Enjoy!
>> _______________________________________________
>> 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

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