Update type-byte-array.md

Minor wording tweak
This commit is contained in:
Arseny Kapoulkine 2023-10-16 11:15:38 -07:00 committed by GitHub
parent 7435a829d5
commit 2bc8de17ee
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -174,6 +174,6 @@ The workarounds without this feature are significantly inefficient:
* Strings are immutable and cant be used to efficiently construct binary data without exponential allocations.
* Built in `string.pack` and `string.unpack` cant cover more complex schemas on their own or formats which are edited mid-creation.
The proposed buffer object has no cursor/position as part of its state; while it would be possible to implement this along with a separate set of APIs like `pushTYPE` and `takeTYPE`, this addition can be possible to implement later and it makes the buffer structure more complicated; additionally, external offset management might be easier to optimize and is more orthogonal as we do not need to duplicate stateful and stateless functions.
The proposed buffer object has no cursor/position as part of its state; while it would be possible to implement this along with a separate set of APIs like `pushTYPE` and `takeTYPE`, this addition is always possible to implement later and it makes the buffer structure more complicated; additionally, external offset management might be easier to optimize and is more orthogonal as we do not need to duplicate stateful and stateless functions.
The proposed buffer object is not resizeable; this is possible to implement later using explicit `buffer.resize` call, however this may result in a performance impact for native implemenation as the data will be read through a pointer redirection and will be more difficult to optimize; thus this version of the RFC only proposes fixed length buffers. That said, if resizeable buffers are desired in the future, we would plan to enhance the current buffer type instead of making a parallel resizeable buffer type to reduce complexity.