Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-03-24 19:05:17 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Client Quit)
2021-03-24 19:05:20 <maerwald> monochrom: https://hackage.haskell.org/package/bytestring-0.11.1.0/docs/Data-ByteString-Short.html#t:ShortByteString
2021-03-24 19:05:22 <maerwald> ah...
2021-03-24 19:05:32 × juuandyy quits (~juuandyy@90.106.228.121) (Quit: Konversation terminated!)
2021-03-24 19:06:22 × m0rphism quits (~m0rphism@HSI-KBW-085-216-104-059.hsi.kabelbw.de) (Ping timeout: 244 seconds)
2021-03-24 19:06:57 <maerwald> SBS... that was easy
2021-03-24 19:07:06 × jamm_ quits (~jamm@unaffiliated/jamm) (Ping timeout: 268 seconds)
2021-03-24 19:07:19 <monochrom> heh
2021-03-24 19:08:27 × xelxebar quits (~xelxebar@gateway/tor-sasl/xelxebar) (Remote host closed the connection)
2021-03-24 19:08:47 xelxebar joins (~xelxebar@gateway/tor-sasl/xelxebar)
2021-03-24 19:08:47 × emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer)
2021-03-24 19:09:05 emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com)
2021-03-24 19:10:42 × geekosaur quits (42d52137@66.213.33.55) (Ping timeout: 240 seconds)
2021-03-24 19:10:45 × Rudd0 quits (~Rudd0@185.189.115.108) (Ping timeout: 264 seconds)
2021-03-24 19:10:55 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 258 seconds)
2021-03-24 19:11:28 m0rphism joins (~m0rphism@HSI-KBW-085-216-104-059.hsi.kabelbw.de)
2021-03-24 19:12:07 hyperisco joins (~hyperisco@d192-186-117-226.static.comm.cgocable.net)
2021-03-24 19:13:19 <maerwald> except there's no conversion from ShortByteString to Text
2021-03-24 19:14:30 geekosaur joins (42d52137@66.213.33.55)
2021-03-24 19:18:24 isovector joins (~isovector@172.103.216.166.cable.tpia.cipherkey.com)
2021-03-24 19:18:37 isovector parts (~isovector@172.103.216.166.cable.tpia.cipherkey.com) ("WeeChat 3.1")
2021-03-24 19:19:18 × hyperisco quits (~hyperisco@d192-186-117-226.static.comm.cgocable.net) (Read error: Connection reset by peer)
2021-03-24 19:20:09 molehillish joins (~molehilli@2600:8800:8d06:1800:a4ec:e3c6:6b54:caa8)
2021-03-24 19:21:38 Unhammer joins (~Unhammer@gateway/tor-sasl/unhammer)
2021-03-24 19:21:42 <maerwald> so from ByteArray to String would be copying twice afais
2021-03-24 19:22:06 Lycurgus joins (~niemand@98.4.119.196)
2021-03-24 19:22:09 × dolio quits (~dolio@haskell/developer/dolio) (Ping timeout: 246 seconds)
2021-03-24 19:22:09 × emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer)
2021-03-24 19:22:40 × dawiss quits (~dawiss@178.43.197.203.ipv4.supernova.orange.pl) (Remote host closed the connection)
2021-03-24 19:22:41 emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com)
2021-03-24 19:24:38 × molehillish quits (~molehilli@2600:8800:8d06:1800:a4ec:e3c6:6b54:caa8) (Ping timeout: 264 seconds)
2021-03-24 19:24:58 × todda7 quits (~torstein@2a02:587:1b17:de00:b1fa:5a99:4acf:bd72) (Quit: Konversation terminated!)
2021-03-24 19:25:31 <codygman__> This is interesting. A custom quasi quoter using TH.dataToExpQ crashes haskell-language server with `m32_allocator_init: Failed to map` on8.10.4: https://github.com/haskell/haskell-language-server/issues/1497#issuecomment-806070162
2021-03-24 19:25:35 × zebrag quits (~inkbottle@aaubervilliers-654-1-109-157.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!)
2021-03-24 19:25:57 zebrag joins (~inkbottle@aaubervilliers-654-1-109-157.w86-212.abo.wanadoo.fr)
2021-03-24 19:26:36 elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de)
2021-03-24 19:26:51 <tomsmeding> maerwald: what's your final goal? ByteArray# to Text where each byte is interpreted as Latin-1? Or the whole thing interpreted as UTF-? ?
2021-03-24 19:27:11 dolio joins (~dolio@haskell/developer/dolio)
2021-03-24 19:27:15 <maerwald> tomsmeding: ByteArray# to String, decoded as Utf16LE
2021-03-24 19:27:26 <maerwald> which is two copies
2021-03-24 19:28:00 <maerwald> `T.pack . E.decodeUtf16LE . B.fromShort . B.SBS`
2021-03-24 19:28:13 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
2021-03-24 19:28:15 <maerwald> I'm not satisfied
2021-03-24 19:28:21 <tomsmeding> T.unpack?
2021-03-24 19:29:04 <maerwald> what?
2021-03-24 19:29:05 × emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer)
2021-03-24 19:29:15 <geekosaur> your T.pack seems wrong
2021-03-24 19:29:16 emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com)
2021-03-24 19:29:26 <maerwald> yeah
2021-03-24 19:29:33 apeyroux joins (~alex@78.20.138.88.rev.sfr.net)
2021-03-24 19:29:38 <geekosaur> it's already packed after E.decode16LE
2021-03-24 19:29:39 × augnun quits (~augnun@2804:14c:658b:41bb:9d27:655f:eef9:d872) (Quit: WeeChat 3.1)
2021-03-24 19:31:04 <maerwald> yes, T.unpack is O(n) :)
2021-03-24 19:31:17 <tomsmeding> maerwald: if you're feeling adventurous, this function (which is the backend of E.decodeUtf16LE) looks readily convertible to something that uses SBS.index and (:) https://hackage.haskell.org/package/text-1.2.4.1/docs/src/Data.Text.Internal.Encoding.Fusion.html#streamUtf16LE
2021-03-24 19:31:46 × stree quits (~stree@68.36.8.116) (Ping timeout: 268 seconds)
2021-03-24 19:33:17 <monochrom> If you can find a utf16 decoder that goes from ByteString to String, you will save one level of marshalling.
2021-03-24 19:33:56 <tomsmeding> replace 'Yield c i' with 'c : next i', replace 'Done' with '[]', remove the 'Stream next 0' prefix, replace 'B.unsafeIndex' with 'SBS.index'
2021-03-24 19:34:01 <monochrom> Currently you are unhappy with T.unpack because the decoder emits Text.
2021-03-24 19:34:36 <tomsmeding> the result would be a thing that goes directly from SBS to String, and SBS from ByteArray# is a no-op
2021-03-24 19:35:00 <monochrom> However, I wouldn't worry about it for now. There is some chance fusion eliminates one level of marshalling and you need do nothing.
2021-03-24 19:35:40 Lord_of_Life_ joins (~Lord@unaffiliated/lord-of-life/x-0885362)
2021-03-24 19:35:40 × emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer)
2021-03-24 19:35:52 emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com)
2021-03-24 19:37:33 codygman` joins (~user@209.251.131.98)
2021-03-24 19:38:16 × Lord_of_Life quits (~Lord@unaffiliated/lord-of-life/x-0885362) (Ping timeout: 256 seconds)
2021-03-24 19:38:21 <monochrom> More specifically, stream fusion, which means GHC may do for you what tomsmeding just said.
2021-03-24 19:38:21 × Kaeipi quits (~Kaiepi@47.54.252.148) (Read error: No route to host)
2021-03-24 19:38:21 Kaiepi joins (~Kaiepi@47.54.252.148)
2021-03-24 19:38:32 molehillish joins (~molehilli@2600:8800:8d06:1800:a4ec:e3c6:6b54:caa8)
2021-03-24 19:38:39 Lord_of_Life_ is now known as Lord_of_Life
2021-03-24 19:39:33 × codygman__ quits (~user@47.186.207.161) (Ping timeout: 264 seconds)
2021-03-24 19:39:49 <tomsmeding> yay fusion
2021-03-24 19:40:01 <monochrom> "Conditions apply."
2021-03-24 19:41:05 <tomsmeding> :(
2021-03-24 19:41:20 <monochrom> :)
2021-03-24 19:42:16 <maerwald> haskell performance: let's hope it's ok
2021-03-24 19:42:48 <monochrom> That holds for all code optimizations by all compilers of all languages.
2021-03-24 19:42:49 × emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer)
2021-03-24 19:42:58 emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com)
2021-03-24 19:43:13 <monochrom> all to the same extent
2021-03-24 19:43:22 × molehillish quits (~molehilli@2600:8800:8d06:1800:a4ec:e3c6:6b54:caa8) (Ping timeout: 260 seconds)
2021-03-24 19:43:46 <maerwald> I'd argue rust is easier :)
2021-03-24 19:44:17 yoctocell joins (~user@h87-96-130-155.cust.a3fiber.se)
2021-03-24 19:44:17 stree joins (~stree@68.36.8.116)
2021-03-24 19:44:22 <maerwald> but then you have to deal with the verbosity all the time
2021-03-24 19:44:24 yoctocell parts (~user@h87-96-130-155.cust.a3fiber.se) ("ERC (IRC client for Emacs 28.0.50)")
2021-03-24 19:46:23 <monochrom> For example, in gcc and clang, myvar % 37 is optimized, myvar % anothervar is not, except when constant propagation discovers that anothervar was set to 37 and never changed so it's myvar % 37 again, except when something else confuses constant propagation so it gives up, except when something yet else enables conditional constant propagation so it's all good again, except ... etc etc infinite series of excepts and counterexcepts.
2021-03-24 19:47:03 <monochrom> Heuristics. All is heuristics for code optimization. You can hope or you can rabbit hole.
2021-03-24 19:48:14 Franciman joins (~francesco@host-79-53-62-46.retail.telecomitalia.it)
2021-03-24 19:52:10 <monochrom> What you can bet on is that idiomatic code gets a lot of attention from authors of code optimizations. In the case of Haskell, one such idiom is transducer pipelines like "f . g . h" where the intermediate data structures are lists and arrays.
2021-03-24 19:55:03 <monochrom> Alternatively, if you're cynical (I am on prime-numbered days): Bet on academic-publishable code optimizations such as list fusion and stream fusion (Vector, Text, ByteString... so arrays).
2021-03-24 19:55:36 <monochrom> This cynical theory explains why GHC doesn't optimize myvar % 37. >:)
2021-03-24 19:56:21 × dbmikus quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Ping timeout: 264 seconds)
2021-03-24 19:56:47 geekosaur fingers fromInteger there, and notes that there is active work to improve that so it might eventually happen
2021-03-24 19:57:03 xourt joins (d4c620ea@212-198-32-234.rev.numericable.fr)
2021-03-24 19:57:34 <geekosaur> "might"
2021-03-24 19:57:35 dbmikus joins (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com)
2021-03-24 19:58:07 <monochrom> Less cynically, the stream fusion paper and idea are really clever, I recommend that you read it. Part of it is leverage how GHC already knows to simplify "case x of C1 -> case x of C1 -> ..." because obviously the second check-for-C1 is unnecessary.
2021-03-24 19:59:09 × ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Remote host closed the connection)
2021-03-24 19:59:32 <monochrom> I have forgotten further details, so don't quote it on me. :)

All times are in UTC.