Loading arbitrary packages during plain iex sessions

32 views
Skip to first unread message

Abdullah Esmail

unread,
Jun 15, 2020, 4:47:35 AM6/15/20
to elixir-lang-core
Hello,

I believe it would be extremely helpful to old and new elixir developers to be able to try out packages without the need to create a whole project.
Developers coming from different backgrounds (python, ruby, etc) are used to getting into the interactive shell and just importing/requiring the package they need and start playing with it.

I don't know if this is technically possible with iex, but it would definitely change how I work with elixir in general.

Something like:
iex --hex <package1> <package2>

Even if it takes longer to start, at least I could try those packages without creating a dummy project and including those packages as dependencies and then compiling everything.
One command to rule them all.

Maybe `iex --hex` could create a temporary dummy project behind the scenes?

For what it's worth, I'd be very willing to help work on implementing this if it's going to happen.

I apologize if this has been discussed or brought up before. I couldn't find a similar topic.

Alexei Sholik

unread,
Jun 15, 2020, 5:13:48 AM6/15/20
to elixir-lang-core
It's possible to experiment with this by creating a custom mix task, installing it as an archive and then running `iex -S mix try.package ...`.

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/40ef0ab9-7d92-4601-b445-de7c5796c046o%40googlegroups.com.


--
Best regards
Alexei Sholik

Stefan Chrobot

unread,
Jun 15, 2020, 5:15:08 AM6/15/20
to elixir-l...@googlegroups.com
This is a nice proposal, but I'd rather have this go all the way and allow me to pull Hex packages while maintaining the current IEx session, so something like:

$ iex --hex
iex> Something.deps_get :some_http_client, "1.0.0"
iex> SomeHttpClient.get(...)


Best,

Stefan

Simon St.Laurent

unread,
Jun 15, 2020, 6:07:49 AM6/15/20
to elixir-l...@googlegroups.com

I would love to see (some version of) both the original proposal and this one.  They would make IEx a lot more useful.

Thanks,
Simon St.Laurent
Introducing Elixir


Ben Wilson

unread,
Jun 15, 2020, 9:59:16 AM6/15/20
to elixir-lang-core
The issue is, those packages need to be compiled and in a specific order, how would that work? `hex` isn't a build tool, `mix` is.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-l...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-l...@googlegroups.com.

Wiebe-Marten Wijnja

unread,
Jun 15, 2020, 10:10:57 AM6/15/20
to elixir-l...@googlegroups.com

I like this idea, but I do believe that creating something like this will necessarily require certain opinionated decisions to be made.
As such, it might be more suitable to be a custom Mix archive that will not be included (nor maintained) as part of Elixir itself.

~Marten/Qqwy

To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/d5609066-bfc8-4a7c-aaa2-0534ec8d9a2fo%40googlegroups.com.
signature.asc
Reply all
Reply to author
Forward
0 new messages