Crazy suggestion: ByteString -> Bytes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Crazy suggestion: ByteString -> Bytes

Merijn Verstraaten
Ok, so I think there is a fairly wide consensus that the name ByteString is a pretty misleading historical naming mistake. On the other hand, I also realise bytestring is at the very core of the Haskell ecosystem and any breakage has to be avoided at all cost...

So I was just wondering on IRC what (if any?) problems we'd run into if we released a "bytes" package that's just s/ByteString/Bytes of bytestring (Data.Bytes, Bytes type, etc) then turn bytestring into a hollow shell that just re-exports Data.Bytes as Data.ByteString, etc. and defines "type ByteString = Bytes".

I realise there's no way we'll get rid of bytestring itself any time soon (if ever), but at least we could point new code and beginners at a less confusingly named type. Added bonus Bytes is considerably shorter to type!

Cheers,
Merijn

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Crazy suggestion: ByteString -> Bytes

Vladislav Zavialov
ByteString may not be the best way to represent a sequence of bytes, as it contributes to heap fragmentation by using pinned memory.

Its primary use case should be FFI, and it's largely misused today.

If we rename it, let's call it "PinnedBytes", and use the name "Bytes" for ShortByteString, ByteArray, or Array Word8

All the best,
Vlad


On Mon, Jan 7, 2019, 12:25 Merijn Verstraaten <[hidden email] wrote:
Ok, so I think there is a fairly wide consensus that the name ByteString is a pretty misleading historical naming mistake. On the other hand, I also realise bytestring is at the very core of the Haskell ecosystem and any breakage has to be avoided at all cost...

So I was just wondering on IRC what (if any?) problems we'd run into if we released a "bytes" package that's just s/ByteString/Bytes of bytestring (Data.Bytes, Bytes type, etc) then turn bytestring into a hollow shell that just re-exports Data.Bytes as Data.ByteString, etc. and defines "type ByteString = Bytes".

I realise there's no way we'll get rid of bytestring itself any time soon (if ever), but at least we could point new code and beginners at a less confusingly named type. Added bonus Bytes is considerably shorter to type!

Cheers,
Merijn
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Crazy suggestion: ByteString -> Bytes

Carter Schonwald
yeah, if it were to be renamed, those would be good ideas. 

On Mon, Jan 7, 2019 at 4:35 AM Vladislav Zavialov <[hidden email]> wrote:
ByteString may not be the best way to represent a sequence of bytes, as it contributes to heap fragmentation by using pinned memory.

Its primary use case should be FFI, and it's largely misused today.

If we rename it, let's call it "PinnedBytes", and use the name "Bytes" for ShortByteString, ByteArray, or Array Word8

All the best,
Vlad


On Mon, Jan 7, 2019, 12:25 Merijn Verstraaten <[hidden email] wrote:
Ok, so I think there is a fairly wide consensus that the name ByteString is a pretty misleading historical naming mistake. On the other hand, I also realise bytestring is at the very core of the Haskell ecosystem and any breakage has to be avoided at all cost...

So I was just wondering on IRC what (if any?) problems we'd run into if we released a "bytes" package that's just s/ByteString/Bytes of bytestring (Data.Bytes, Bytes type, etc) then turn bytestring into a hollow shell that just re-exports Data.Bytes as Data.ByteString, etc. and defines "type ByteString = Bytes".

I realise there's no way we'll get rid of bytestring itself any time soon (if ever), but at least we could point new code and beginners at a less confusingly named type. Added bonus Bytes is considerably shorter to type!

Cheers,
Merijn
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries