-
Notifications
You must be signed in to change notification settings - Fork 116
WIP: Replace Array[Byte] by ByteString and Seq[Byte] #221
Conversation
@ceilican what is the choice for wrapper? I've created the base project (https://github.com/ScorexFoundation/scorex-util) and what to move some common parts to it. This wrapper is needed in our different projects, including iodb, scrypto, sigmastate-interpreter, etc. that do not have scorex in dependencies, so we should use it in some base class. |
@catena2w , I have been replacing The problem I encountered in this PR is that That PR (#261) is essentially ready, but @kushti preferred not to merge it yet. I will probably abandon this PR (#221) and start a new PR In this new PR It would be great if What do you think? |
I'll discuss with kushti, if everything is ok, we'll extract ByteString it to |
@ceilican I also found that there are |
@catena2w, I don't know why Akka has two The following may help in understanding the other one: Also look at: My guess is that |
@ceilican I discussed with Alex - he told that ByteString might be the worst choice for Array[Byte] wrapper. May you consider the best choice, we're waiting for decision to start using it in other projects |
@catena2w , that is strange. If I remember correctly, it was @kushti who suggested Also, note that Did @kushti say why he thinks it might be the worst option? Does he think that the rope concept (on which akka's Anyway, what is important to use a collection data structure that inherits the
In general, whenever we fave a public function |
I agree with Bruno, It also uses |
I also don't think that we need Rope here, because we do not perform any insertion, deletion or random access operations. We just need efficient memory storage (like in array) and equality checking operation (like in seq), I believe. Also I think it's nice to have a readable |
Yes. I agree. If we have to choose one or the other, though, I would prefer to keep a good equality operation (i.e. inheriting |
replaced with #290 |
Closes #208 .
Only "src/main" done so far.
ToDo:
Note that external libraries such as scorex.crypto and iodb require
Array[Byte]
. This forces as to convert fromSeq
toArray
, which is not nice, especially because, right now, there are dependencies on these external libraries spread everywhere in Scorex. We should think about a better solution for this problem. At the very least, I think we should have a unique component that depends on each of these external libraries.