-
Notifications
You must be signed in to change notification settings - Fork 108
Primitives Proposal #56
Comments
Conclusion: block on L0, we need parametric types.
|
|
|
Current state: At the research retreat, we discussed this and realized:
Our solution was to say:
What does this mean here? Well, it means that no existing format is fully expressive. Really, this is a logical conclusion that can be drawn from the fact that no existing format can define/understand new types. |
Is it fair to say that we do require codec's to support JSON Types? Could we describe "Links" as another type that dag codec's are required to know how to encode? Would it be possible to come up with a loose definition for a "Binary" type which we can reference in specifications built on IPLD? |
Unfortunately, no.
Basically, we want to interop with existing systems so we can't impose requirements like "all systems will support x, y, z". This issue was really concerned with what we were calling "fully featured" formats. The idea was that some formats would support all primitives and would be able to encode all possible IPLD objects in these formats. We could (and probably should) introduce a concept of "JSON superset" (or JSON + binary + CIDs) formats. |
Ok, let me re-frame. For "IPLD Data Model" would we want to have layers along these lines:
Complex data-structures (generic hamt node, unixfs-v2) and other data format specs can rely on L0, L1, or L2 data model support. This would allow us to say something along the lines of "This specification requires IPLD Data Model L1" in the The Path spec can define behavior for things that do not conform with the IPLD data model (this is already a source of confusion, as the property names in our The CID spec does not require the "IPLD Data Model." It's the other way around, IPLD L1 Data Model support depends on the CID spec for the Link type. Does this make sense? I worry that I'm re-using a few terms we've previously defined like "IPLD Data Model." |
Closing due to staleness as per team agreement to clean up the issue tracker a bit (ipld/team-mgmt#28). This doesn't mean this issue is off the table entirely, it's just not on the current active stack but may be revisited in the near future. If you feel there is something pertinent here, please speak up, reopen, or open a new issue. [/boilerplate] |
So, there are two modes of operation with respect to IPLD:
information.
IPLD needs a set of primitives supported by all fully-expressive formats. Not all formats need be fully expressive (i.e., JSON can be a special beast). However, when converting to a non-fully-expressive format, data that can't be expressed without loosing type information should be thrown away.
The ones we can all agree on:
The big question: What number types to we support?
In Crete, those of us who met up to discuss this agreed on a single magical Decimal type (a superset of all number types we might care about except rationals and irrationals). However, @jbenet (reasonably) objected on the basis that we lose important type information this way. This is especially important for systems that use L0 (a type schema system for IPLD).
Unfortunately:
The only way I can think of properly solving this is by saying that CBOR is not, in fact, a fully-expressive format. Instead, L0 would be the only fully-expressive format and CBOR would also be a subset format (joining the ranks of JSON).
In that case, I'd propose the following number primitives:
Eventually, I'd like to implement these in L1 so we don't have so many.
The L1 language will also have tagged enums but those will be expressible in other formats as:
Note: I'm not happy with this. I'd prefer a minimal set of primitives or a maximal (extensible) set. This set is already missing, e.g., int128 (supported by rust) but, as most languages don't have that, I'd rather not include it. Really, I'd prefer to have generic ints (over the size) but no language that I know of except LLVM bytecode support them.
The text was updated successfully, but these errors were encountered: