Elixir: Support Erlang/OTP 22 new features

Created on 21 Nov 2018  路  8Comments  路  Source: elixir-lang/elixir

To be implemented when Erlang 22 is released:

To be implemented when we require Erlang 22 exclusively:

  • [ ] Use cover:local_only/0
  • [ ] Use system_info(:ets_count) instead of length(:ets.all()) in IEx.Helpers.runtime_info
  • [ ] Add Logger.put_application_level/2 and Logger.delete_application_level/2
  • [ ] Rely less on MapSet.difference and use -- instead (as it has been heavily optimized)
  • [ ] RELEASE_NODE no longer needs the hostname bit (see https://github.com/erlang/otp/pull/2219)
  • [ ] Store Regex version in persistent terms
  • [ ] Remove TODOs in the codebase that require Erlang/OTP 22+, especially around the Logger
  • [ ] Move warn once storage to persistent terms
  • [ ] Update examples to :exsss pseudo-random algo (see #9609)
  • [ ] Introduce :inspect_redact callbacks using persistent terms (see discussion)
Elixir Chore

Most helpful comment

It depends on the feature. For example, leveraging stuff at compilation time, such as changes to the compiler, is relatively easier because we need to perform checks only when the code is compiled.

But for things like the MapSet, then the check needs to happen at runtime, and I just don't think the code ugliness is worth the benefit. It is simpler to wait. It is not like the code is slow today.

And regarding new features, we typically avoid adding features to Elixir that require only certain Erlang version to work. Otherwise a project like Phoenix can say, "oh, we require Elixir v1.8" but in truth it is Elixir v1.8 AND Erlang/OTP 22, which makes it harder to use for everyone.

All 8 comments

Am I wrong? Seems the first issue is already resolved in master (talking about MapSet.difference)

@RobertDober not yet. Basically what that feature means is to revisit the use MapSet in our codebase and we still use it in certain places.

Tried to figure out how to help and seem to be unable of finding the code, great for starters 馃槗 I guess I'll leave it to the experts, sorry for the noise.

@RobertDober none of those issues can be acted on right now anyway since they would require us to depend on Erlang/OTP 22+ exclusively, and we are likely 2 years away from doing so.

Just out of pure academic interest and only if you do not object to this conversation in this issue @josevalim .
Would it be
[] possible
[] simple
[] incredibly much work
[] difficult
[] impossible
to install Elixir with a feature set depending on the Erlang version it is compiled with?

It depends on the feature. For example, leveraging stuff at compilation time, such as changes to the compiler, is relatively easier because we need to perform checks only when the code is compiled.

But for things like the MapSet, then the check needs to happen at runtime, and I just don't think the code ugliness is worth the benefit. It is simpler to wait. It is not like the code is slow today.

And regarding new features, we typically avoid adding features to Elixir that require only certain Erlang version to work. Otherwise a project like Phoenix can say, "oh, we require Elixir v1.8" but in truth it is Elixir v1.8 AND Erlang/OTP 22, which makes it harder to use for everyone.

Hi @josevalim, I see that you've removed #6738 from the list. Does that mean the patch at https://github.com/erlang/otp/pull/1973 does not help?

@indocomsoft correct, it doesn't help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DEvil0000 picture DEvil0000  路  3Comments

Paddy3118 picture Paddy3118  路  3Comments

josevalim picture josevalim  路  3Comments

sashaafm picture sashaafm  路  3Comments

ericmj picture ericmj  路  3Comments