mike_bianco
Help an Elixir beginner find missing development tooling!
Hello! I’ve been super impressed with the community here on the forum. Thanks for the help everyone has provided thus far!
I just finished my first side project in Elixir and there are a couple of things I’m missing from ruby-land, and some minor annoyances I’ve run into. I’m guessing there are extensions or tweaks I can make to eliminate most of these. I’d appreciate any insight—thank you!
Here’s the list of questions & missing tooling I’ve run into:
- Automatically open up a REPL when an exception is thrown. In ruby, this is done via
pry-rescue. Super helpful for quickly diving into the exact context where the error occurs. - In Phoenix, it would be amazing if the debugging plug (which displays a page when an exception is thrown) displays the variables bound in a specific scope so I can reproduce & fix errors quickly. (It would be even better if a REPL could be opened and interacted with on the exception page.
better-errorsdoes this in ruby.) iex -S mix phx.serverfeels weird. It would feel a bit nicer if there was amix phx.consolewhich setup IEx for you.Allow? [Yn]is really annoying when I’m debugging a piece of code. It would be great if you could auto-acceptrequire IEx; IEx.pryrequests.- In a debugging session, I couldn’t figure out how to navigate up and down the call stack. Is there something like
pry-navavailable? - Scan dependencies for security issues. In ruby, this is done via
bundler-audit. - I couldn’t find a VS Code extension with
phoenix*snippets. Is there a way to autogenerate snippets automatically from installed hex packages?
Most Liked
joaquinalcerro
Cool.
Take a look at this presentation where Luke explains some debugging techniques:
It helped me hope it does the same for you.
OvermindDL1
Huh?
iex(1)> a = 42
42
iex(2)> try do
...(2)> throw :ack
...(2)> catch v ->
...(2)> b = 6.28
...(2)> IO.inspect(binding(), label: :Bindings)
...(2)> end
Bindings: [a: 42, b: 6.28, v: :ack]
[a: 42, b: 6.28, v: :ack]
If a binding ‘can’ be used in the local scope, then binding() will show it, it just compiles to a keyword list of bindings names to the bindings themselves, like [a: a, b: b, v: v]. Is there a case where it will not show a binding that ‘can’ in fact be accessed in the local scope?!
hauleth
Not possible as in most cases the failed process do not exist (unhandled exceptions will kill current process), so there is no “context” you can attach to.
As well I doubt that it would be possible, as Erlang do not provide anything like Kernel#local_variables in Ruby. Also as it was said earlier - process is probably dead when the error handling take place, so there is no “context”. Oh, and by the way, as Elixir compiles to Erlang code, and Erlang allows only one assignment per variable name (SSA-like) the “Elixir variables” will have non-meaningful names in Erlang code.
There was mix console but it was removed. I do not know what was the rationale. But if you do not like it, then you can always create custom command or alias (within Mix) or shell alias.
There is Sobelow, but I do not know if this audit the dependencies. For tool that checks deps for security issues we would need centralised log of such issues, AFAIK there is none, and AFAIK Elixir didn’t had any CVE assigned yet.
How would that even work? Really, I cannot imagine.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








