Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Erlang 26 features #4467

Open
10 tasks
janl opened this issue Mar 10, 2023 · 1 comment
Open
10 tasks

Use Erlang 26 features #4467

janl opened this issue Mar 10, 2023 · 1 comment

Comments

@janl
Copy link
Member

janl commented Mar 10, 2023

This issue is an experiment nicked from the Elixir project. Whenever a new Erlang version comes out, they go through the release notes and note any new features or issues that might affect Elixir. We should do the same for CouchDB.

Since we support older versions of Erlang, we usually can’t start adopting new features when they come out (unless we version-guard them, in cases where it is warranted, like opting into a substantial speedup on newer versions), but at least we have a check-list for things to adopt when the new Erlang version some day becomes our oldest-supported version.

Here’s a start from the Erlang 26 RC1 release notes and more detailed Readme:

@nickva
Copy link
Contributor

nickva commented Mar 10, 2023

Great idea, @janl.

A good page to keep an eye on is upcoming_incompatibilities

For clouseau (search) which implements its own dist protocol there are some things to fix up:

A tricky one may be that term_to_binary is changing:

  • erlang:term_to_binary/1,2 and erlang:term_to_iovec/1,2 will now encode atoms as UTF8 by default. We use term_to_binary for on-disk storage. I think we can try toggling {minor_version, 2} in more places to ensure we use a forward compatible format. As far back as R16 can already read that format. A potential pitfall here is a case where in the compactor we may not necessarily re-encode all doc bodies or other bits when we copy. That means we could potentially carry forward future-incompatible compression format, or term_to_binary ({minor_version, 0} ?) or such without noticing or compaction having a way to upgrade it.
  • erlang:term_to_binary/1,2 has a new deterministic option since OTP 24. can be used to ensure that within the same major release of Erlang/OTP, the same encoded representation is returned for the same term. There is still no guarantee that the encoded representation remains the same between major releases of Erlang/OTP. wonder if there is any need or use for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants