Skip to content

Commit 4710b2f

Browse files
ghnotgoodxiaoxiang781216
authored andcommitted
doc/apps: Add BARE
1 parent baba361 commit 4710b2f

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

  • Documentation/applications/netutils/bare
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
===========================================
2+
``bare`` Binary Application Record Encoding
3+
===========================================
4+
5+
BARE is a simple binary representation for structured application data, see
6+
https://baremessages.org/.
7+
8+
BARE implementation ported to NuttX is ``cbare``, see
9+
https://git.sr.ht/~fsx/cbare.
10+
11+
BARE_ is similar to other binary formats like CBOR_, BSON_, or `Protocol
12+
Buffers`_.
13+
14+
.. _BARE: https://baremessages.org/
15+
.. _CBOR: https://cbor.io/
16+
.. _BSON: https://bsonspec.org/
17+
.. _Protocol Buffers: https://protobuf.dev/
18+
19+
BARE at glance, from its web page:
20+
21+
- Messages are encoded in binary and compact in size. Messages do not contain
22+
schema information — they are not self-describing.
23+
24+
- BARE is optimized for small messages. It is not optimized for encoding large
25+
amounts of data in a single message, or efficiently reading a message with
26+
fields of a fixed size. However, all types are aligned to 8 bits, which does
27+
exchange some space for simplicity.
28+
29+
- BARE's approach to extensibility is conservative: messages encoded today will
30+
be decodable tomorrow, and vice-versa. But extensibility is still possible;
31+
implementations can choose to decode user-defined types at a higher level and
32+
map them onto arbitrary data types.
33+
34+
- The specification is likewise conservative. Simple implementations of message
35+
decoders and encoders can be written inside of an afternoon.
36+
37+
- An optional DSL is provided to document message schemas and provide a source
38+
for code generation. However, if you prefer, you may also define your schema
39+
using the type system already available in your programming language.

0 commit comments

Comments
 (0)