The introduction of Mix.install in Elixir 1.12 was huge. Prior to that single file Elixir scripts could only use the standard library, which is decently sized, counting Erlang but notably misses a good HTTP client and JSON encoding/decoding. Despite using Elixir at my day-job and loving the language in a production environment, I had written off Elixir for scripting and throwaway work until then.
But now, I love it! Mix.install([:req]) at the top and you've got an easy to use, great basis for scripts.
Toss in Livebook and you're well on your way to a wonderful exploratory environment. I've moved off having an open iex window to having a scratch Livebook open, and it's great for little explorations. I've been using it whenever I need to work with my company's API, and over time the little helper modules and functions have been evolving. I almost feel like pretty soon it might as well package it up and release them as a full-fledged Elixir library for use with the API.
That's odd. I downgraded with asdf to 1.12.2 tried the same thing and it worked on my M1. You could try upgrading either Erlang/Elixir. Failing that, there's a lot of helpful people on elixirforum.com (which now features live chat), so it might be best to ask there.
I had the same issue on Ubuntu (had my "random project" server up to date already, but no Erlang or Elixir). Installing Erlang in addition to Elixir resolved the problem. I don't know exactly what interactions resolved it though.
The image classification app[0] written by Chris (creator of Phoenix) is IMO nicer example of single file Elixir/Phoenix app. I had some inspirational moments. Yes, I know it was probably linked on HN before.
I've only just dipped my toes into Elixir and Phoenix but so far really loving it. I feel like I've noticed it popping up on here way more often lately or is that just the ol' frequency bias kicking in?
Perhaps a bit of both? There's been a bump in Elixir posts in the last year or two, which is awesome given that the hype cycle has died down now that the language has been stable for a few years.
I just tried to learn some Elixir, in the latest ubuntu version. and
Mix.install([
{:req, "~> 0.3"}
])
could not compile dependency :mint, "mix compile" failed.
Also mix deps.get say that all dependencies are to date but then mix run gives again that could not compile dependency :mint, "mix compile" failed.
Or you can specify a git commit, or a path if you want to alter it locally.
> No way to keep track of what to change when mix create outputs something different next year.
`mix.lock` keeps track of your resolved dependencies and should be checked in along with your code. Mix/Hex can also be provided the exact `==` versions rather than the `~>` or other Version specifiers
What did you feel you needed to change on your project because the default template had changed? If the code works, then it keeps working.
I've run into this with the Phoenix generators a bit because you need to make changes to your project if you want to update to newer versions of the Phoenix libraries, but they produce documentation about what you need to change.
See, I feel it's a way to have some 'frameworky' elements in my projects that are wonderfully standardized. the changes that do occur usually are worth it.
If anything I sometimes find myself annoyed that Ecto is not there by default, because it's part of almost all my projects, and often even a one-file script might benefit from bits of it.
Not who you are responding to but yes, I see the same on Dark Reader. Opening the page in incognito mode fixed the issue (since I don't allow Dark Reader to run in that mode).
But now, I love it! Mix.install([:req]) at the top and you've got an easy to use, great basis for scripts.
Toss in Livebook and you're well on your way to a wonderful exploratory environment. I've moved off having an open iex window to having a scratch Livebook open, and it's great for little explorations. I've been using it whenever I need to work with my company's API, and over time the little helper modules and functions have been evolving. I almost feel like pretty soon it might as well package it up and release them as a full-fledged Elixir library for use with the API.