hauleth

hauleth

BERT-ng (temporary name, to be changed) - new version of BERT-RPC spec (WIP)

Maybe some of you know that there was (is?) something like BERT-RPC which in short is simplified version of External Term Format (also known as :erlang.term_to_binary/1). I try to revive this standard a little with my small project BERT-ng which is supposed to be simplified and standardised subset of ETF that will be implementable in other languages.

Let me know what do you think, and what kind of improvements you would like to see in it. I will also try to provide some implementations in different languages for sake of interoperability.

Oh, and by the way, I am looking for better name, if you have any suggestions then I am open to it.

Most Liked

josevalim

josevalim

Creator of Elixir

This is great! Let me start by saying that we are planning to send Erlang Term Format from channels in Phoenix v1.5, as that will use less CPU and save bandwidth. So work on this is definitely welcome as well as an efficient decoder in JS (the client will continue sending JSON though).

With that said and since you are planning to drop RPC anyway, I would call it SETF - Sequential Erlang Term Format. It is sequential because it does not include PIDs and others.

With that said, my take is:

  • Should we support atoms?

Yes.

  • Should we support byte lists (aka Erlang strings)?

They should just be a list of integers. I.e. they should not have a special treatment. (btw, Erlang strings are a list of chars)

  • Should we allow defining improper lists?

I am personally indifferent.

hauleth

hauleth

BERT-ng is now Ernie (not an acronym, at least for now).

Also I have prepared implementation of encoder and decoder in Rust:

I have started work on implementations in Go and JS, but contributions from more experienced developers are more than welcome. Other languages are welcome as well.

erszcz

erszcz

That is why I disallowed improper lists and force all lists to be proper.

Maybe loudly disallowing them in the spec yet making the encoder smart enough to rewrite as proper lists would make sense (possibly only with a relevant flag/option, so it’s not completely hidden)?

Solid implementations in other languages would rock!

Eiji

Eiji

That’s awesome news!

Do you plan to optionally support Erlang Term Format? Some projects does not care about how much client needs to do, but bandwidth is still a big problem for people which does not have fiber cable. I’m in small city in Poland and I could use fiber internet only after relocation. In my old flat there is still no fiber connection.

Yes, but developer in other languages could be confused as its name is sometimes different like symbols, so I think that atoms/symbols should be mentioned there.

I think like @josevalim, because I don’t like overcomplicated solutions.

I’m not sure, because I did not read about similar things when I learned about basics of other languages (which not surprised me as for some reason I mostly take a look at OOP languages). If it have value even for 1% of them then I would add it, but if not then again we do not need extra complication.

I’m sure that Erlang has support for it - if other languages based on Erlang also supports it then I would definitely say yes.

josevalim

josevalim

Creator of Elixir

As long as you document that unknown atoms may be refused, I think you should be fine? And no atoms cache, for simplicity.

Ah, I see. Then yes, we need to handle it if you want to leverage term_to_binary out of the box. :frowning:

Not sure. But note that all of this can already be achieved today too with custom serializers.

Where Next?

Popular in Discussions Top

New
AstonJ
Phil just posted this on EFS: …interesting that some of the key updates to JavaScript appear heavily influenced by (or blatantly copied...
New
bartblast
StackOverflow Survey results for 2025 have been published: Gleam - 2nd most admired language Elixir - 3rd most admired language Phoenix...
New
lud
Hello, I just extracted the boilerplate management code that I used to work with in previous years: It is yet another generic input d...
New
garrison
The Elixir ecosystem is one of our biggest strengths, and the BEAM really lends itself to native implementations (e.g. Cachex over Redis,...
New
AstonJ
@Garrison’s comment in another thread reminded me of this post by Joe: With the big five exerting more control than ever, new (AI) play...
New
thiagomajesk
I came across this PKGX tool the other day, if anyone here is using it, could you share your experience? I’m wondering how useful it wou...
New
chulkilee
I’ve heard of several companies using Elixir + gRPC successfully. Tubi is one example - which sponsors grpc However, grpc still depends ...
New
fredwu
Hey folks, Just wanted to share my journey and experiences so far. Preface: I’ve been using Elixir for about 10 years now, so relatively...
New
isaacsanders
When I try to run my applications and I haven’t updated the dependencies, the output tells me to run mix deps.get. Why doesn’t the binar...
New

Other popular topics Top

albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New

We're in Beta

About us Mission Statement