mirror of
https://github.com/google/brotli.git
synced 2026-04-06 06:03:43 +00:00
Naming scheme consistent with the established conventions #85
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @piotrjurkiewicz on GitHub (Jan 21, 2016).
Introduction:
Change of the content encoding type from "bro" to "br" (
c4f439dbe6) caused a big fuss. People divided into "bro" vs. "br" camps and focused on political aspects of the change. In particular no one tried to survey existing naming conventions in order to find the right answer for the problem. As problem remained unsolved and controversial, this led to the confusion about file extension and package names, resulting in the following bug reports: #288, #281, #72.Therefore, I would like to create a consistent naming scheme, compatible with the conventions established by IANA and real world practice. The starting point for this is a survey of existing naming conventions of compression algorithms.
Existing convention in HTTP Content-Coding tokens naming:
IANA registry contains 6 non-deprecated tokens:
compress,deflate,exi,gzip,identityandpack200-gzip.Wikipedia lists a number of non-standardized tokens as well, for example:
bzip2,lzmaorsdch.As you may notice, the convention established by IANA is to use a full name of compression algorithm as a token. This means usage of
gzipinsteadgz, etc.Existing convention in MIME types and file extensions naming:
Only two popular compression formats have their MIME type and file extension registered in IANA:
gzip: MIME type:application/gzip, file extension:.gzzip: MIME type:application/zip, file extension:.zipPopular non-standardized formats include:
bzip2: MIME type:application/x-bzip2, file extension:.bz2xz: MIME type:application/x-xz, file extension:.xzlzip: MIME type:application/x-lzip, file extension:.lz7z: MIME type:application/x-7z-compressed, file extension:.7zConvention is harder to spot here, but we can distinguish two patterns:
Existing convention in cmd line program names:
Unix commands for the commonly used compression algorithms have the following names:
/usr/bin/gzipforgzip/usr/bin/bzip2forbzip2/usr/bin/xzforxz/usr/bin/{zip,unzip}forzipAgain, we may notice that established convention is to use a full name of compression algorithm/file fomat as program name (
xzfits this as well, because algorithm/format name ofxzisxz, notlzma(lzmawas an older, incompatible file format)).My proposal for brotli:
Use the full name (
brotli) as HTTP Content-Coding token.This fits into the convention established by IANA and reduces the probability of registration rejection by IETF. Someone may point out that this means sending 4 bytes more in each HTTP request/response than when using the
brtoken. It is true, but in HTTP2 headers will be anyway Huffman-encoded by HPACK, so there will be no difference in requests size.Use the full name (
application/brotli) as a MIME type.In order to fit the existing convention, as well as to reduce future collision and ambiguity probability.
Use the two-letter abbreviation (
.br) as a file extension.Again to fit the existing two-letter extension convention. In the case of file extension we do not need to worry about collisions, so abbreviation can be safely used.
This would resolve issue #288.
Use the full name (
brotli) as cmd line program name.As someone pointed out in #281,
broprogram name is already occupied in Debian.brabbreviation is commonly used in Linux for network bridge related things, for examplebrctltool. Therefore I think that the full name should be used. In fact the longer name is, the lower probability of collision with the existing program and ambiguity is. And the usage of full name fits the existing convention in Unix.This would resolve issue #281 and affect pull request #163.
Use the full name (
brotli) as Python/nodejs/distribution/etc. package name.Again, we should use the full name in order to reduce collision and ambiguity probability. We cannot use
brbecause this package name is already taken in PyPI. In the case of npm it is even worse, because bothbrandbronames are already taken by unrelated packages.This would resolve issue #72.
Summary
I have tried to create a consistent naming scheme, compatible with the established conventions. I am looking forward for your opinions.
Notice, that I did not use
broname in any place. I do that not because of political-correctness related things, but simply because it does not fit into any of the established conventions: it is neither the full name, nor the two-letter abbreviation. Therefore, I would like to avoid here discussion related to thebroissue, and to focus on consistency aspects instead.