1. 10 Nov, 2018 6 commits
  2. 31 Oct, 2018 1 commit
    • Eric Myhre's avatar
      Admit to a draft exploring type systems last week. · f7e93c59
      Eric Myhre authored
      The very first draft tried to get away with *one* "Kind" enumeration,
      but that quickly became odd and shakey; *two* separate "Kind" enums
      (one for the Data Model, one for the lower level Representation;
      working terms, and mine) fits a lot better.  The latter is what we're
      committing here.
      
      Also of interest here is a proposal for a distinction between whether
      fields are *required* vs *nullable*.  I'm not sure this has been done
      before in any of the other systems I've examined so far; it's a concept
      I think we'll want for dealing with the subtle distinction between
      whether some piece of data *matches* our schema vs whether it's *valid*
      within our schema.  But it's quite hypothetical; it's possible this
      whole concept of "matching" will turn out a lot more complex than that.
      
      There's a tossed out syntax for a schema DSL in a comment.  This is
      utterly unscrutinized and should not be taken too seriously yet.
      
      The example code at the bottom declaring some type system is code that
      *could* be used, but is mostly for demonstration and early dev
      purposes: in the long run, we *do* want to come up with a DSL, and all
      the relevant grammers, parsers, and so on for using that as an
      implementation-agnostic source of truth.  At that (far future) point,
      this kind of code would be used internally to represent what's been
      parsed out of the DSL; but users shouldn't really be writing it.
      (That's a long-winded way of saying "yes, some parts of that code are
      extremely not DRY and would be error prone if written manually"; and
      indeed, they would, and thus the point is not to.)
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      f7e93c59
  3. 21 Oct, 2018 3 commits
    • Eric Myhre's avatar
      Node for all. Last phase deref. · 34a8b3c7
      Eric Myhre authored
      Finally got the bind and free impls on the same page.
      
      Surprisingly, the bind node can work without being a ptr itself.
      I'm not sure if that'll last, but let's try to roll with it.
      If we *can* keep that property, it might reduce GC impact in a pretty
      significant way.
      
      Added a 'fluent' package.  It's just a twinkle in my eye so far, but it
      might represent the nicest way through all the discussed issues.
      Nodes shouldn't have to be panicful; and users shouldn't have to do all
      error handling manually either.  A package full of fluent interfaces
      that know what's going on seems to be the only way to get both.
      But we'll see how this shakes out.  Maybe typeful traversers will
      make the whole thing end up more coreward than being relegated to a
      helper package.  I have no idea.
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      34a8b3c7
    • Eric Myhre's avatar
      Switch to single-step deref'ering methods. · c35f4393
      Eric Myhre authored
      And add a bunch of type-specific ones for helpfulness.
      
      But immediately re-reviewing this further.  What we've done here is
      handle leafs very oddly, because it would seem to avoid unnecessary
      wrapping on the leaf nodes.  But the result seems to be much uglier
      code than it needs to be, and implies that we've got all sorts of
      additional special cases required to either handle or reject binds
      of primitive-kind fields.  And that seems... maybe not a great trade.
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      c35f4393
    • Eric Myhre's avatar
      Add cid lib and deps. · e16f4019
      Eric Myhre authored
      Note: I am not very pleased with how many deps this core and simple
      data type has.  These are basically all for the hashing, and very, very
      little actual hashing code at that, and I really wish the rule about
      "a little vendoring is better than a little dependency" would be
      applied here -- pulling in x/crypto and x/sys so that I can use a
      type that's *a wrapper around string* is thoroughly ridiculous.
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      e16f4019
  4. 19 Oct, 2018 2 commits
    • Eric Myhre's avatar
      Draft ipldfree.Node. · e997142e
      Eric Myhre authored
      Some comments on the interface as well.  Almost certain that traversal
      should be pulled off the node interface itself.
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      e997142e
    • Eric Myhre's avatar
      Bit 'o flesh for the bindnode impl. · 21a9fa21
      Eric Myhre authored
      This has been sitting on my hard drive quite a while already, so I
      decided to clean it up juuuust enough that it compiles so I can push
      it.  But as you can see, there's a LOT of TODOs dangling here.
      
      I'm not at all still sure those comments about "root node" in the
      interface are going to stand up to scrutiny over time.  There's
      definitely going to be some distinction between "Node we're traversing"
      and "Node we are putting in a serialized block of bytes and can
      think it's reasonable to address by hash", but figuring out the best
      ergonomics of that is probably going to take a while.
      
      I'm going to start on another simpler just-backed-by-maps-n-stuff Node
      impl before going deeper with this one, because I suspect it'll make
      tests easier to write, which will then make this whole pile of
      reflection easier to test down the road as well.
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      21a9fa21
  5. 29 Aug, 2018 2 commits
    • Eric Myhre's avatar
      Five minutes in: not all nodes are serializable. · 80386cb8
      Eric Myhre authored
      Hopefully if we come up with a good way to flip one node impl into another,
      we'll be able to come up with an easy interface for "this is referencing
      an in-memory structure type of mine, but hashed as CBOR native standard".
      80386cb8
    • Eric Myhre's avatar
      Initial commit go-ipld-prime · 18d1705b
      Eric Myhre authored
      We'll see if this is a good idea or not.  It's either a newer, cleaner,
      lessons-learned set of libraries for using IPLD; or, it'll turn into a
      "lesson-learned" itself and we'll fold the learnings back into the
      existing libraries.  Time will tell!
      18d1705b