From Jiri Vlasak to ~sircmpwn/sr.ht-discuss
On Wed, Apr 02, 2025 at 02:19:37PM +0000, Brihadeesh wrote: > hi, i was wondering if there's any way by which I could set up a list on > Sourcehut lists that gets updated everytime I publish a new post? I have a question about the problem you are trying to solve. What's the real problem? Don't you want RSS instead?
From Jiri Vlasak to ~sircmpwn/public-inbox
> > Any map key type (directly or via a user-defined type) MUST be of > > a primitive type that is not f32, f64, data, data[length], or > > void. > > Is there any reason to allow `data` and `data[length]` as map key types, > but to allow `str`? I encountered this when I was trying to map Git > object IDs, which are `data[20]` when using classical SHA-1 hashes; and > when communicating environment variable keys, which are not guaranteed > to be UTF-8. This restriction is in BARE since the beginning and I only found two relevant discussions -- first about the reason of distinction between primitive/aggregate data types [1]:
From Jiri Vlasak to ~martijnbraam/public-inbox
--- bare/dump.py | 4 ++-- example/cursor.bare | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bare/dump.py b/bare/dump.py index 4739397..b5f9bb9 100644 --- a/bare/dump.py @@ -9,7 +9,7 @@ from itertools import zip_longest as zipl from bare import _unpack_primitive from bare.__main__ import codegen from bare.bare_ast import BareType, UnionType, BarePrimitive, TypeKind, StructType, MapType, NamedType, ArrayType, \[message trimmed]
From Jiri Vlasak to ~martijnbraam/public-inbox
--- README.md | 58 ++++++------- example/address.bin | Bin 55 -> 52 bytes example/addressmaybe-address.bin | Bin 56 -> 53 bytes example/customer.bin | Bin 148 -> 145 bytes example/employee.bin | Bin 164 -> 161 bytes example/example-read.py | 5 +- example/example.py | 11 +-- example/person-customer.bin | Bin 149 -> 146 bytes example/person-employee.bin | Bin 165 -> 162 bytes example/schema.bare | 46 +++++----- example/schema.py | 142 ++++++++++++++++--------------- 11 files changed, 131 insertions(+), 131 deletions(-) [message trimmed]
From Jiri Vlasak to ~martijnbraam/public-inbox
--- bare/test_encoded_messages.py | 98 +++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 bare/test_encoded_messages.py diff --git a/bare/test_encoded_messages.py b/bare/test_encoded_messages.py new file mode 100644 index 0000000..b0bfd74 --- /dev/null @@ -0,0 +1,98 @@ """Test Example Company from BARE RFC Appendix B.""" SCHEMA = """\[message trimmed]
From Jiri Vlasak to ~martijnbraam/public-inbox
--- bare/__init__.py | 4 ++++ bare/__main__.py | 27 ++++++++++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/bare/__init__.py b/bare/__init__.py index 4bfec34..c9d8110 100644 --- a/bare/__init__.py @@ -169,6 +169,8 @@ def _pack_type(ast_node, data, module): else: return _pack_type(referenced._ast, data, module) elif isinstance(ast_node, ListType): if hasattr(data, 'value'):[message trimmed]
From Jiri Vlasak to ~martijnbraam/public-inbox
--- bare/__init__.py | 14 +-- bare/bare_ast.py | 38 ++++--- bare/parser.py | 238 +++++++++++++++++++++++----------------- bare/test_aggregates.py | 14 +-- bare/test_parser.py | 162 +++++++++++++++++++-------- bare/test_primitives.py | 2 +- 6 files changed, 291 insertions(+), 177 deletions(-) diff --git a/bare/__init__.py b/bare/__init__.py index 02cb298..4bfec34 100644 --- a/bare/__init__.py @@ -2,7 +2,7 @@ import struct [message trimmed]
From Jiri Vlasak to ~martijnbraam/public-inbox
--- bare/lex.py | 86 ++++++++++++++------------ bare/test_lexer.py | 148 ++++++++++++++++++++++++--------------------- 2 files changed, 129 insertions(+), 105 deletions(-) diff --git a/bare/lex.py b/bare/lex.py index e97338b..98deaeb 100644 --- a/bare/lex.py @@ -7,10 +7,7 @@ class LexError(Exception): class Token(Enum): TTYPE = auto()[message trimmed]
From Jiri Vlasak to ~martijnbraam/public-inbox
--- bare/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bare/__main__.py b/bare/__main__.py index 90bf59b..73b18db 100644 --- a/bare/__main__.py @@ -45,7 +45,7 @@ def _gen_type(type): result = '\t_ast = {}\n\n'.format(type.code()) result += '\t@classmethod\n' result += '\tdef pack(cls, member):\n' result += '\t\treturn bare.pack(cls, member)\n\n' result += '\t\treturn bare.pack(member, cls)\n\n'[message trimmed]
From Jiri Vlasak to ~martijnbraam/public-inbox
The schema in the latest BARE RFC [1] has changed. This set of patches updates the bare-py to the newest schema version. Please, let me know if you want the changes ordered or grouped differently. [1]: https://datatracker.ietf.org/doc/draft-devault-bare/ Jiri Vlasak (7): Fix union pack, see 322e8d64 Update lex to current schema Update parser to current schema Make optional, list, and map nameable Add example company test