RFC: split primitive datatypes and their high-level implementations #5458

pull theuni wants to merge 1 commits into bitcoin:master from theuni:datatypes-split changing 5 files +234 −142
  1. theuni commented at 1:16 AM on December 11, 2014: member

    Submitting this now because I'd like to see if it's a workable concept before continuing. I started by adding the structures from primitives/* because they were the most obvious target. No need to bother reviewing the changes in detail, I'm just looking for some concept ACK/NACKs.

    The goal here is to separate the definitions and serializations of basic core structures from their higher-level features. My primary motivation at the moment revolves around making future library work easier. With the definitions/serializations separated, many of bitcoind's dependencies melt away.

    Another nice benefit is that base.h becomes rather self-documenting for the wire format. A bit of doxy there would go a long way.

    High-level classes inherit from the newly separated low-level ones. The base classes provide only constructors and (de)serialization. Templates are used as a bit of nested trickery, so that high-level classes can continue to stack on top of each-other.

  2. RFC: split primitive datatypes and their high-level implementations
    WIP.
    a286ce669a
  3. theuni commented at 1:17 AM on December 11, 2014: member

    @sipa I've seen you discuss the idea of very bare base classes before, is this similar to what you had in mind?

  4. sipa commented at 1:27 AM on December 11, 2014: member

    I was more thinking about just stripping all non-trivial features off of classes in base/*, and moving them up to application code as functions. Things like SetNull and IsNull are low-level enough IMHO, but anything that forces more dependencies or has validation logic in, doesn't belong there.

    Specifically, I think uint256 should be separated into a bytes32 type or something which is just storage (but does have comparison operators, so it can be used as key in a map), but doesn't have any arithmetic logic.

  5. laanwj added the label Improvement on Dec 16, 2014
  6. theuni closed this on Jun 19, 2015

  7. MarcoFalke locked this on Sep 8, 2021
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me