pprzetacznik / IElixir

Jupyter's kernel for Elixir programming language
Apache License 2.0
357 stars 44 forks source link

Loading external dependencies #20

Closed Lida closed 6 years ago

Lida commented 8 years ago

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?

pprzetacznik commented 8 years ago

@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 8 years ago

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?

mattvonrocketstein commented 8 years ago

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.

pprzetacznik commented 8 years ago

@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.

pikeas commented 8 years ago

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.

anandtrex commented 7 years ago

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

pprzetacznik commented 6 years ago

@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.