From Victorien Elvinger to ~sircmpwn/public-inbox
Hi Jiri! I am wondering if this could be simply done by treating the message as an opaque sequence of bytes of another message: ```bare type EmbeddedMessage = ... ``` ```bare type MainMessage = data ```
From Victorien Elvinger to ~sircmpwn/hare-users
Hi Drew! Is there any video recording of your Hare presentation? Have a nice day!
From Victorien Elvinger to ~sircmpwn/public-inbox
> I'm afraid this could complicate debugging. I can imagine situation > when you want to disable/change some type temporarily. Ok. I think we can proceed to publication :)
From Victorien Elvinger to ~sircmpwn/public-inbox
> I'm not sure why is that. Wouldn't this disallow used-in-the-future > types? An example: > > type Nowadays void > type Future void > type Msg union {Nowadays} Yes this disables this schema. This is a kind of unused type. IMO void should always be used (in at least one union). > What is meant by root type?
From Victorien Elvinger to ~sircmpwn/public-inbox
> I will let the recursive types forbidden until some other use-case > arises. Considering BARE's goals Wise decision. I took more time to think again about recursive types. I am now convinced that if we need to support them, then we should support encoding and decoding of data graph. One year ago, I started to explore BARE pointers [1]. I continued the exploration and I finally gave up because it was unlikely to be accepted.
From Victorien Elvinger to ~sircmpwn/public-inbox
If anyone else read this, it could really be helpful to have other opinions :) > > JSON lists are encoded as objects with numeric keys? > > I'm not sure what you mean. I mean in your example arrays and objects are encoded as `map<str><ElementId>`. I think we can merge our solutions: type ElementId uint
From Victorien Elvinger to ~sircmpwn/public-inbox
> the length is encoded as uint that is limited to 64 bits now. Ah? I did not find a patch for that. > I'm sorry for this "loud thinking" of mine. No problem, this enables me to think more about our subject :) > Yes. But I'm still unsure if it's good idea to require all > implementations document the maximum supported length of uint.
From Victorien Elvinger to ~sircmpwn/public-inbox
Hi miniBill! Thanks to bring your thoughts in the discussion :) I am aware of this limitation: I am maintaining a BARE implementation in JS/TS [1]. By default, uint/int/i64/u64 use JS bigints. A CLI option (--use-safe-int) enables to limit these types to safe integers and they are so represented with 64bit-floats. As Drew says [2]: > Exerpt from the RFC:
From Victorien Elvinger to ~sircmpwn/public-inbox
Hi again! > If I understand recursive types correctly, the relation between > encoded values is not preserved. I did not mean that because we have already this issue. For instance the following schema (without recursive types) has the same problem: struct Object { int value; } struct Person {
From Victorien Elvinger to ~sircmpwn/public-inbox
Hi! > I briefly read the ProtocolBuffers [1], > but didn't find the limitation. Protocol buffers seems not be canonical [3]. Thus it does not impose a maximum of bytes for a varint. However, the maximum observable range of values is 64bits. Indeed, only the following scalar types are encoded with varints [1]: int32, int64, uint32, uint64, sint32, sint64, bool, enum enum tags are restricted to 32bit-integers [2]. In a way, protocol buffers limit varints to 64bits,