Skip to content

Add a bytestring library containing a rope-like immutable data structure as a Scala module #137

Open
@mdedetrich

Description

@mdedetrich

The Akka codebase implemented ByteString which is a highly optimized datastructure for dealing with strings that are backed by bytes in an immutable rope like data structure. There is a strong argument for having this as a self contained community module since the problem that ByteString is solving is a common one that is experienced in many other Scala projects particularly webservers (and bringing in entirety of Akka just for ByteString is overkill). Having it as a Scala module can also mean it can be extended for other Scala platforms (Scala.js/scala-native) which I am planning to do if its accepted.

There is a sample project at https://github.com/mdedetrich/bytestring which already contains a general outline of the module. The project also contains an AUTHORS which details the notable past committers of the contained source files. The ByteString has been placed into the scala.collection.immutable package (one can also add a type alias in scala.lang.ByteString to scala.collection.immutable.ByteString but I think that is a bit aggressive since scala.lang is meant to be a sanctioned space for the Scala compiler).

In terms of stability, the ByteString datastructure has been contained within Akka in a binary compatible manner for a long period of time. It has also been optimized over the same period of time for one of the most performance sensitive projects in Scala and there is a benchmarking suite also to verify this. Support for the ByteString has also been extended to older Scala versions (my personal stance on this is that as long as its not an inconvenience to support older versions, for a Scala module there may be some benefit to this but removing support for older Scala versions when it becomes problematic is definitely desirable).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions