Expose and autoinline `Kernel.term_to_binary/1/2` and `Kernel.binary_to_term/1/2`.

357 views
Skip to first unread message

Norbert Melzer

unread,
Dec 22, 2017, 8:13:20 AM12/22/17
to elixir-lang-core
`:erlang.binary_to_term/1` and `:erlang.term_to_binary/1` are used in the erlang world quite often to serialize data for network, disk, or ports in an efficient manner.

In the elixir ecosystem they seem to be quite unknown and serialisation does often happen to and from JSON.

By including, documenting, and even autoinlining from Kernel (such that they get auto-imported) I think we could massively increase the awareness of the elixir community about these functions.

Bye,
  Norbert

José Valim

unread,
Dec 22, 2017, 10:58:34 AM12/22/17
to elixir-l...@googlegroups.com
We don't have conversion functions in Kernel and they are not even auto imported in Erlang, so we would need strong reasons to import them in Elixir. If discovery is a reason for adding functions to Kernel, then we can end-up with a bloated Kernel quite quickly.



José Valim
Founder and 
Director of R&D

--
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-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CA%2BbCVstDKAZZVPVMqgpqNLN2TuxK75S5_0kqHTh07vdeA3m%3DsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Norbert Melzer

unread,
Dec 22, 2017, 11:06:15 AM12/22/17
to elixir-l...@googlegroups.com
In Erlang I can use them unqualified, so they are "autoimported".

I can understand your argument about bloating kernel though. Can you imagine another way to make it documented in elixir and more or less part of it while still inlining it?



José Valim <jose....@gmail.com> schrieb am Fr., 22. Dez. 2017 um 16:58 Uhr:
We don't have conversion functions in Kernel and they are not even auto imported in Erlang, so we would need strong reasons to import them in Elixir. If discovery is a reason for adding functions to Kernel, then we can end-up with a bloated Kernel quite quickly.



José Valim
Founder and 
Director of R&D

On Fri, Dec 22, 2017 at 2:13 PM, Norbert Melzer <timm...@gmail.com> wrote:
`:erlang.binary_to_term/1` and `:erlang.term_to_binary/1` are used in the erlang world quite often to serialize data for network, disk, or ports in an efficient manner.

In the elixir ecosystem they seem to be quite unknown and serialisation does often happen to and from JSON.

By including, documenting, and even autoinlining from Kernel (such that they get auto-imported) I think we could massively increase the awareness of the elixir community about these functions.

Bye,
  Norbert

--
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.

--
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/CAGnRm4KMaYJ-jWARdLCG530-949kPYv14NQ3-9UprUQ84HN9JA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages