Logs: liberachat/#haskell
| 2026-02-24 19:29:08 | → | disconnect3d joins (~disconnec@user/disconnect3d) |
| 2026-02-24 19:34:28 | → | paddymahoney joins (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) |
| 2026-02-24 19:35:51 | × | paddymahoney quits (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) (Remote host closed the connection) |
| 2026-02-24 19:36:58 | × | humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Quit: Leaving...) |
| 2026-02-24 19:37:17 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-02-24 19:39:21 | → | Psychotic1 joins (~Psychotic@2600:1007:b0a8:2a87:b8ca:d0cd:23e3:1e08) |
| 2026-02-24 19:41:42 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 2026-02-24 19:43:11 | × | machinedgod quits (~machinedg@d172-219-48-230.abhsia.telus.net) (Ping timeout: 268 seconds) |
| 2026-02-24 19:47:10 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 256 seconds) |
| 2026-02-24 19:49:50 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 2026-02-24 19:52:40 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-02-24 19:52:48 | → | paddymahoney joins (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) |
| 2026-02-24 19:54:19 | × | andjjj23 quits (~irc@107.170.228.47) (Server closed connection) |
| 2026-02-24 19:54:37 | → | andjjj23 joins (~irc@107.170.228.47) |
| 2026-02-24 19:57:22 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 2026-02-24 19:59:54 | × | arandombit quits (~arandombi@user/arandombit) (Ping timeout: 245 seconds) |
| 2026-02-24 20:07:40 | × | petrichor quits (~jez@user/petrichor) (Quit: ZNC 1.10.1 - https://znc.in) |
| 2026-02-24 20:08:03 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-02-24 20:12:24 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds) |
| 2026-02-24 20:13:25 | → | humasect joins (~humasect@dyn-192-249-132-90.nexicom.net) |
| 2026-02-24 20:14:33 | → | arandombit joins (~arandombi@2a02:2455:8656:7100:eca0:756e:c98c:4e3f) |
| 2026-02-24 20:14:33 | × | arandombit quits (~arandombi@2a02:2455:8656:7100:eca0:756e:c98c:4e3f) (Changing host) |
| 2026-02-24 20:14:33 | → | arandombit joins (~arandombi@user/arandombit) |
| 2026-02-24 20:16:29 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 2026-02-24 20:18:49 | × | Psychotic1 quits (~Psychotic@2600:1007:b0a8:2a87:b8ca:d0cd:23e3:1e08) (Ping timeout: 248 seconds) |
| 2026-02-24 20:18:56 | × | nonzen quits (~nonzen@user/nonzen) (Quit: Gone) |
| 2026-02-24 20:19:01 | × | sajith quits (~sajith@user/sajith) (Quit: Gone) |
| 2026-02-24 20:19:06 | → | nonzen_ joins (~nonzen@user/nonzen) |
| 2026-02-24 20:19:40 | → | sajith joins (~sajith@user/sajith) |
| 2026-02-24 20:20:26 | × | gmg quits (~user@user/gehmehgeh) (Ping timeout: 252 seconds) |
| 2026-02-24 20:20:28 | × | dtman34 quits (~dtman34@c-73-242-68-179.hsd1.mn.comcast.net) (Ping timeout: 276 seconds) |
| 2026-02-24 20:21:39 | × | eugenrh quits (~eugenrh@user/eugenrh) (Server closed connection) |
| 2026-02-24 20:21:57 | → | eugenrh joins (~eugenrh@user/eugenrh) |
| 2026-02-24 20:22:25 | × | wickedjargon quits (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) (Ping timeout: 276 seconds) |
| 2026-02-24 20:22:39 | → | gmg joins (~user@user/gehmehgeh) |
| 2026-02-24 20:23:26 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-02-24 20:30:09 | × | chele quits (~chele@user/chele) (Remote host closed the connection) |
| 2026-02-24 20:30:17 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 2026-02-24 20:32:19 | × | xacktm quits (xacktm@user/xacktm) (Server closed connection) |
| 2026-02-24 20:32:29 | → | dtman34 joins (~dtman34@2601:447:d183:2302:b0c5:8965:1c3f:d560) |
| 2026-02-24 20:32:32 | × | michalz quits (~michalz@185.246.207.221) (Remote host closed the connection) |
| 2026-02-24 20:32:34 | → | xacktm joins (bnc4free@user/xacktm) |
| 2026-02-24 20:34:06 | × | lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 2026-02-24 20:41:28 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-02-24 20:46:06 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds) |
| 2026-02-24 20:47:05 | × | op_4 quits (~tslil@user/op-4/x-9116473) (Ping timeout: 264 seconds) |
| 2026-02-24 20:47:05 | × | srk quits (~sorki@user/srk) (Ping timeout: 248 seconds) |
| 2026-02-24 20:47:18 | → | srk- joins (~sorki@user/srk) |
| 2026-02-24 20:49:54 | → | prdak joins (~Thunderbi@user/prdak) |
| 2026-02-24 20:49:59 | srk- | is now known as srk |
| 2026-02-24 20:50:00 | → | op_4 joins (~tslil@user/op-4/x-9116473) |
| 2026-02-24 20:55:33 | → | petrichor joins (~jez@user/petrichor) |
| 2026-02-24 20:56:50 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-02-24 21:01:21 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 2026-02-24 21:04:04 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 245 seconds) |
| 2026-02-24 21:04:18 | <lantti> | is there a faster way to print a list of Int, separated by spaces, than "putStrLn (unwords $ map show ints)"? |
| 2026-02-24 21:05:14 | <Rembane> | lantti: Faster as in time from first character to last character? |
| 2026-02-24 21:05:27 | <Rembane> | ...minimizing that time that is |
| 2026-02-24 21:05:31 | <lantti> | yes |
| 2026-02-24 21:06:06 | <Rembane> | Converting it to a chunked bytestring could be faster, but I haven't compared. |
| 2026-02-24 21:06:34 | → | aka_dude joins (~aka_dude@192.71.166.120) |
| 2026-02-24 21:06:39 | <lantti> | I'm doing an algorithms course where I have to choice to do it in C, Rust or Haskell and I chose Haskell, but in my current task just printing the result takes me to the limit on acceptable time use |
| 2026-02-24 21:06:49 | <newmind> | depending on the length of ints, maybe with a builder, but i doubt for any reasonable length outputs there is that much difference to be had here |
| 2026-02-24 21:07:33 | × | aka_dude quits (~aka_dude@192.71.166.120) (Client Quit) |
| 2026-02-24 21:07:38 | <dolio> | You could try `mapM_` with something. But I'd be surprised if it were a lot faster. |
| 2026-02-24 21:07:44 | <newmind> | so, since haskell is a lazy language... how are you calculating ints? |
| 2026-02-24 21:07:45 | <lantti> | although on a positive note, I did pass already. I'm just trying to improve my result from barely passing to something better |
| 2026-02-24 21:07:54 | <Rembane> | lantti: How many ints do you print? |
| 2026-02-24 21:08:08 | <lantti> | 10^6 |
| 2026-02-24 21:08:20 | <mauke> | :t shows |
| 2026-02-24 21:08:22 | <lambdabot> | Show a => a -> ShowS |
| 2026-02-24 21:08:52 | <EvanR> | :t mapM_ print |
| 2026-02-24 21:08:53 | <lambdabot> | (Foldable t, Show a) => t a -> IO () |
| 2026-02-24 21:08:59 | <mauke> | that's not space separated |
| 2026-02-24 21:09:18 | <dolio> | Yeah, you need the space analogue of print. |
| 2026-02-24 21:09:28 | <tomsmeding> | lantti: are you allowed to use dependencies, like 'text' or 'bytestring'? |
| 2026-02-24 21:09:59 | <dolio> | Is there a show-to-text/bytestring that doesn't run through show? |
| 2026-02-24 21:10:17 | <dolio> | Other than the one I stopped maintaining like 10 years ago? |
| 2026-02-24 21:10:48 | <tomsmeding> | well, for a start I'd be curious how `T.putStrLn (T.intercalate " " (map T.show ints))` performs, despite still using Prelude.show |
| 2026-02-24 21:11:00 | <mauke> | :t let f [] = "\n"; f (x : xs) = shows x (' ' : f xs) in f |
| 2026-02-24 21:11:03 | <lambdabot> | Show a => [a] -> [Char] |
| 2026-02-24 21:11:13 | <tomsmeding> | dolio: https://hackage-content.haskell.org/package/text-2.1.4/docs/Data-Text-Lazy-Builder-Int.html ? |
| 2026-02-24 21:11:34 | <dolio> | Oh, nice. |
| 2026-02-24 21:11:48 | <mauke> | > let f [] = "\n"; f (x : xs) = shows x (' ' : f xs) in f [1,2,3] |
| 2026-02-24 21:11:49 | <lambdabot> | "1 2 3 \n" |
| 2026-02-24 21:11:51 | <dolio> | Also, is printing actually the bottleneck? |
| 2026-02-24 21:12:13 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-02-24 21:12:24 | <tomsmeding> | right, possibly laziness makes it look like it is, even if it actually isn't |
| 2026-02-24 21:12:36 | <EvanR> | isn't builder in appropriate here since we already have a lazy list of the things to print, in order |
| 2026-02-24 21:12:45 | <EvanR> | just print them in order |
| 2026-02-24 21:12:51 | <tomsmeding> | well, putStrLn takes an MVar on stdout |
| 2026-02-24 21:13:04 | <tomsmeding> | taking an MVar for outputting like 5 bytes may not be optimal |
| 2026-02-24 21:13:16 | <EvanR> | facepalm |
| 2026-02-24 21:13:29 | <tomsmeding> | writing everything in a big buffer and then sending that buffer into stdout may be quite a bit faster |
| 2026-02-24 21:13:41 | <EvanR> | this sounds so backwards |
| 2026-02-24 21:13:58 | <EvanR> | kind of like buffering your own buffer before it gets to the OS buffers, which are then buffered |
| 2026-02-24 21:14:09 | <lantti> | I'm currently trying to figure out how the profiling works, so I can get a better idea of the bottlenecks |
| 2026-02-24 21:14:20 | <tomsmeding> | EvanR: output is already buffered, the actual write(2) call in the kernel is only called when stdout is flushed, which, if you don't write newlines, happens only every 4096 bytes or so |
| 2026-02-24 21:14:47 | <dolio> | It's already effectively building a 'buffer' as a lazy list of characters. Builder is just generally a better one. |
| 2026-02-24 21:15:08 | <tomsmeding> | EvanR: also, a Text Builder produces a _lazy_ text, so that doesn't actually create a whole separate buffering step |
All times are in UTC.