2026/02/23

Newest at the top

2026-02-23 15:06:19 +0100 <merijn> Although that still compiles a List[Word8] into your executable and I dunno how GHC bakes that :p
2026-02-23 15:05:49 +0100 <merijn> I have a package that does the conversion at compile time for you
2026-02-23 15:04:58 +0100 <merijn> Also
2026-02-23 15:04:54 +0100sm2n(ae95cb1267@user/sm2n) sm2n
2026-02-23 15:04:46 +0100sm2n(ae95cb1267@user/sm2n) (Server closed connection)
2026-02-23 15:04:30 +0100 <merijn> There's an inline conversion from the dense binary String representation of GHC directly to ByteString
2026-02-23 15:04:10 +0100 <merijn> Well, I guess not quite
2026-02-23 15:04:04 +0100 <merijn> __monty__: Yes
2026-02-23 15:02:10 +0100 <c_wraith> I guess you could do some TH stuff to wrap unsafePackAddressLen at compile time, so it's O(1) at runtime
2026-02-23 15:01:03 +0100 <int-e> (And I believe `unpackCString` exists because the amount of code generated for large string literals would otherwise be quite substantial.)
2026-02-23 15:00:19 +0100 <c_wraith> see https://hackage-content.haskell.org/package/bytestring-0.12.2.0/docs/Data-ByteString-Unsafe.html#v…
2026-02-23 15:00:15 +0100forell(~forell@user/forell) forell
2026-02-23 14:59:57 +0100forell(~forell@user/forell) (Server closed connection)
2026-02-23 14:59:50 +0100 <Milan_Vanca> If I were...
2026-02-23 14:59:35 +0100 <c_wraith> You can use Addr# literals with -XMagicHash, and then use them with unsafePackAddress
2026-02-23 14:59:10 +0100raincomplex(~rain@user/raincomplex) raincomplex
2026-02-23 14:58:57 +0100 <Milan_Vanca> __monty__: It is something that could theoretically be done. But had I been developer of GHC I would not do it.
2026-02-23 14:58:56 +0100 <int-e> (`unpackCstring#` is used by GHC to compile string literals)
2026-02-23 14:58:36 +0100 <int-e> __monty__: kind of, because of https://github.com/haskell/bytestring/blob/master/Data/ByteString/Internal/Type.hs#L423-L426
2026-02-23 14:57:15 +0100raincomplex(~rain@user/raincomplex) (Read error: Connection reset by peer)
2026-02-23 14:56:45 +0100 <__monty__> Are there any that are converted at compile time?
2026-02-23 14:55:57 +0100 <Milan_Vanca> Question... even with using OverloadedStrings there are still String instances that are converted to ByteString in runtime right? Compiler is not smart enough to "bake" ByteStrings to executable right?
2026-02-23 14:54:42 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2026-02-23 14:54:33 +0100 <Milan_Vanca> Yes I know, but isn't problem about Wai/Warp using ByteStrings? SO I have to provide ByteString. So Either I create my own function String -> ByteString, and use it everywhere. Or I use OverloadedStrings and use default implementation of IsString instance. (Which don't work for all UTF8 chars that could be specified in String)
2026-02-23 14:51:32 +0100DragonMaus(~DragonMau@user/dragonmaus) DragonMaus
2026-02-23 14:51:17 +0100DragonMaus(~DragonMau@user/dragonmaus) (Server closed connection)
2026-02-23 14:50:45 +0100 <merijn> You're not required to use that
2026-02-23 14:50:41 +0100 <merijn> I mean, that's just an example
2026-02-23 14:49:55 +0100 <Milan_Vanca> merijn: If you look here https://www.stackage.org/package/wai it uses OverloadedStrings
2026-02-23 14:42:20 +0100 <merijn> Milan_Vanca: What are you using the IsString for bytestring for anyway?
2026-02-23 14:38:52 +0100CloneOfNone(~CloneOfNo@user/CloneOfNone) CloneOfNone
2026-02-23 14:38:37 +0100CloneOfNone(~CloneOfNo@user/CloneOfNone) (Server closed connection)
2026-02-23 14:30:37 +0100dyniec(~dyniec@dybiec.info) dyniec
2026-02-23 14:28:21 +0100califax(~califax@user/califx) califx
2026-02-23 14:27:02 +0100dyniec(~dyniec@dybiec.info) (Remote host closed the connection)
2026-02-23 14:26:58 +0100tromp(~textual@2001:1c00:3487:1b00:309d:e3b0:b1c4:2c66) (Quit: My iMac has gone to sleep. ZZZzzz…)
2026-02-23 14:26:12 +0100califax_(~califax@user/califx) (Ping timeout: 252 seconds)
2026-02-23 14:25:06 +0100califax(~califax@user/califx) (Ping timeout: 252 seconds)
2026-02-23 14:24:52 +0100GoldsteinQ(~goldstein@goldstein.lol)
2026-02-23 14:24:37 +0100GoldsteinQ(~goldstein@goldstein.lol) (Server closed connection)
2026-02-23 14:20:54 +0100califax_(~califax@user/califx) califx
2026-02-23 14:19:42 +0100dyniec(~dyniec@dybiec.info)
2026-02-23 14:15:47 +0100merijn(~merijn@77.242.116.146) merijn
2026-02-23 14:15:00 +0100mrvdb(~mrvdb@2001:19f0:5000:8582:5400:ff:fe07:3df5) mrvdb
2026-02-23 14:14:46 +0100mrvdb(~mrvdb@185.92.221.186) (Server closed connection)
2026-02-23 14:12:26 +0100 <int-e> . o O ( Not only is this a truly astonishing insight, it's also absolutely brilliant! )
2026-02-23 14:11:29 +0100philopsos1(~caecilius@user/philopsos) philopsos
2026-02-23 14:10:10 +0100dibblego(~dibblego@haskell/developer/dibblego) dibblego
2026-02-23 14:10:10 +0100dibblego(~dibblego@116-255-1-119.ip4.superloop.au) (Changing host)
2026-02-23 14:10:10 +0100dibblego(~dibblego@116-255-1-119.ip4.superloop.au)