Your thoughts on advancing the Elixir ecosystem

Have split this from the recent Ecto announcement where I think the quote below warrants some thought :smiley:

What/how do you think the Elixir ecosystem could be advanced? :101:


Anyone else excited by this? :003:

7 Likes

Elixir Devise perhaps? :heart_eyes_cat:

Iā€™m very excited!

4 Likes

Some mistakes should be committed just once. :laughing:

42 Likes

Unless they are idempotent.

1 Like

I think actually a large part of improving elixir can be done via improving erlang. For example, dialyzer has a lot of information about types that if presented properly to the user would be really beneficial. However, since running it is optional its not always done and new users as well as advanced users get tripped up on it and frequently end up not using it. I believe having elixir ship with the dialyzer plt and utilize as much information as makes sense in a more elixir styled presentation of the same information could bring a lot of improvement to the type system that people have been asking for, for some time.

8 Likes

I absolutely agree that dialyzer needs some love. I for one donā€™t insist on statically typed Erlang / Elixir because that would deprive us of a lot of goodies. But better warning messages and more intuitive way to work with specs is something that will push both languages into the future.

I am pretty sure itā€™s hard as hell but in any case, I believe itā€™s one pain point that needs addressed. Whether itā€™s in 3 months or 3 years, it was a soft-blocker for me and I had to persist a lot to gain a basic understanding and be able to use specs relatively well. And even now parameterizing the specs is something that makes me scratch my head. I might be stupid though.


Additionally:

  • Standardizing Elixirā€™s configuration ā€“ compile-time, boot-time and run-time ā€“ is something thatā€™s sorely needed to improve Elixirā€™s deployment story.

  • Speaking of which, Elixirā€™s deployment with Distillery could benefit from less WTH experience ā€“ thereā€™s a bunch of stuff to setup if you want to deploy to your own VPS and itā€™s easy to get it wrong. I am betting $20 that it will take me more than 15 minutes even if we donā€™t count the time to install everything needed on a VPS / droplet.

9 Likes

Easier debugging?

1 Like

What is hard in debugging?

3 Likes

Some mistakes should be committed just once. :laughing:

Iā€™d be interested in reading more about ā€œDevise was a mistakeā€ (reasoning, lessons learned, etc.). Is there anything out there on this? I was unable to find anything (my searches just turn up user issues with errors/validations).

Or it simply a case of introducing a lot of complexity into projects with a simple gem install, i.e. going against the goal of simplicity that e.g. Rich Hickey talks about in https://www.youtube.com/watch?v=rI8tNMsozo0 (such as shortly after 22:00)?

I agree and am pretty sure there has been a lot of recent work committed in dialyxir to get to v1 and present the dialyzer type warnings more understandably in Elixir format. Also JakeBeckerā€™s elixir-ls (by default) runs dialyzer automatically in the background as you work presenting these warnings. So I do think this will be getting a lot better soon.

That said unfortunately an automatic inferred typing system looks to be out of reach for now (JosĆ©ā€™s ElixirConf speech https://youtu.be/suOzNeMJXl0?t=2563) so Iā€™m hoping at this point something like a https://github.com/josefs/Gradualizer approach will eventually advance the state of typing in the ecosystem.

3 Likes

On Elixir proper yes, but there is always the possibility to, for example, do a typed module definition that does the inference using a restricted set of Elixir, I started such an experiment and Iā€™d love to complete it but I just donā€™t have the time (maybe someone else can get it going? ^.^).

Shameless self promotion, but Iā€™m doing my part. Rendering Phoenix templates 12x faster (usual disclaimers apply: This is probably true for highly dynamic templates; my implementation is not yet complete, etc.)

Bonus: these new templates make it much easier to send diffs over the network for things like Drab, LiveView, etc.

12 Likes

I agree that one of the best ways to improve Elixir is to improve Erlang/OTP. There are many areas of OTP in particular that are unpolished/in need of some love. One area that is still not-as-good-as-it-could-be is the lack of Common Test integration with Elixir. Not that Common Test makes any of this easy to do, of course (itā€™s not designed very well to play nicely with anything other than Erlang/OTP; for example _SUITE.erl is literally hard-coded in a few places).

In general, I think there are people within the Erlang community who wouldnā€™t mind moving into the Elixir ecosystem, but have a hard time because they have to give up some of the tooling and frameworks theyā€™re accustomed to using to do their work. Common Test is one of those areas where I donā€™t feel like we have an equivalent available in Elixir.

1 Like

I have really enjoyed using ExUnit, can you talk a little about what Common Test offers that ExUnit does not?

1 Like

Thatā€™s true, but donā€™t forget you can often leverage Elixir macros for dramatic performance improvements (like what I do above).

Iā€™d throw out there additional support for Elixir LS and editor integrations. I recently explored using Elixir/Erlang debugger support and, while the tools are nifty on their own, it would be amazing if it could be integrated into something like Visual Studio Code. If it was turnkey to setup sane defaults for an Elixir plugin for VS Code, Atom, Sublime, etc. I think that would be helpful for a lot of new developers:

  • Dialyzer support
    • Auto-detect and offer to insert type specs?
  • ExUnit integration
  • Better autocompletion and language snippets
  • Debugger integration (I suspect this is both rewarding and very complex)
  • Exposing powerful existing tools like :observer or :debugger (how many newcomers know about those tools out of the box?)
8 Likes

Omnisharp is a great example

1 Like

Apologies if Iā€™m misunderstanding you, but donā€™t you already get get Dialyzer support (problems tab, as well as in-editor) + suggested specs in VSCode.

Autocomplete and language snippets are a bit iffy sometimes, but for the most part they seem on par with what Iā€™m used to in other editors. Definitely would love improvements there.

1 Like

Iā€™m interested! Iā€™ve tried to read up on various systems of type inference but I really struggle to understand the theory. If you have the beginnings of something written in Elixir, Iā€™d be very interested in seeing the code.

3 Likes

I have a few playground projects made, none are ā€˜completeā€™ by an stretch but playing with ideas as I get time (Iā€™ve been out of time lately as well) such as TypedElixir and MLElixir among some others.