pprzetacznik/IElixir

Loading external dependencies

Lida opened this issue · 7 comments

Lida commented

HI @pprzetacznik, great work on this kernel.

One very common case I use when trying out a new module is play around with the API on the repl. I would love to be able to use jupyter to do exploration instead of just iex.

However, it seems like there is no easy way to load external modules into the running kernel, except maybe add it as a deps to the project.

Is there a way to either integrate ielixir as an app to an umbrella app, or have ielixir detect and load dependencies based on the project?

@Lida probably you could run Mix Tasks from the repl: https://github.com/elixir-lang/elixir/blob/v1.3.2/lib/mix/lib/mix/tasks/deps.get.ex

What do you think about that?

Lida commented

I am not sure how mix deps.get would provide the kernel with access to the needed modules.

For example, if I want to play around with https://github.com/CargoSense/ex_aws. What's an easy way to do it with IElixir?

I too am very interested in this, and it seems to me that if IElixir had more support for proper elixir projects (i.e. was aware of mix.exs) then IElixir would make a very attractive replacement for the standard "iex -S mix" invocation and could actually be the mainstream elixir shell of choice. As of now though as far as I understand, IElixir is really only easy to interact with the standard library which drastically limits the utility.

IEx has fairly serious usability issues and even getting the up/down arrow to work with history is a pain, yet the standard workarounds have stability problems. It seems there is some resistance to fixing the underlying issues anywhere but inside erlang core, and these discussions are years old already. Meanwhile, with a work-around at the jupyter level instead, we'd fix the history annoyance at the same time as things like multi-line console editing, as well as getting all the other many niceties of jupyter as a bonus.

@Lida I was thinking about running this module from the Jupyter level.
@mattvonrocketstein @Lida The second option would be to add magic commands. Something which starts with ! sign. And these commands would refresh project or something with this specific dependencies. I need to do a research and I'll give an answer in few days.

I agree wholeheartedly with @mattvonrocketstein. I'm new to Elixir and am absolutely shocked at how primitive iex is. IElixir is great, and could replace iex with a few additions.

Agree with @mattvonrocketstein that being able to load external modules would be great. Any progress on this issue?

@Lida @pikeas @mattvonrocketstein @anandtrex I've created Boyle module which enables module installation and loading it without need of restarting Jupyter / IElixir.

https://github.com/pprzetacznik/IElixir#packages-management-with-boyle

Please take a look if this fulfil your needs and is useful.