Logs on 2022-08-23 (liberachat/#haskell)
| 00:02:35 | → | merijn joins (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) |
| 00:02:53 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 00:04:03 | <Benzi-Junior> | c_wraith: yes, the issue is that since I'm doing a calculation with the constant all of the variables which I wanted to have just a "Floating a" constraint get constrained to the type myConstant, which is Double but I want to leave the type of this constant ambiguous (it's just a placeholder until I get a more complete problem specification anyways) only constrained by "Floating a" |
| 00:05:03 | <c_wraith> | I think you missed my point. that error message directly implies you've conflated types and classes. fix that first! |
| 00:06:20 | × | polyphem_ quits (~rod@2a02:810d:840:8754:224e:f6ff:fe5e:bc17) (Ping timeout: 244 seconds) |
| 00:06:36 | → | hgolden joins (~hgolden2@cpe-172-251-233-141.socal.res.rr.com) |
| 00:06:42 | <geekosaur> | Benzi-Junior, I think you need to pastebin an actual example plus full error message |
| 00:06:45 | <geekosaur> | @where paste |
| 00:06:45 | <lambdabot> | Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com |
| 00:07:23 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 00:08:13 | <lbseale> | I'm trying to parse a big text file (~1.5m lines, 316MB). It needs to find certain lines and save their line numbers. I wrote something with attoparsec that works on a small subset of the file, but is super slow on the whole thing. I haven't implemented any kind of streaming library, could that be it? |
| 00:09:02 | <c_wraith> | possibly, if you're holding on to a large portion of the contents of the file. |
| 00:09:40 | <c_wraith> | but it's more likely that your grammar has triggered some backtracking case and there's some O(n²) logic someplace |
| 00:09:44 | <lbseale> | It saves them into an IntMap, maybe 30 lines out of every 20000 |
| 00:09:59 | <lbseale> | Hm yeah that sounds more like it |
| 00:10:00 | <dsal> | lbseale: There's a conduit attoparsec thing that should manage that pretty well if a line is an independent unit. |
| 00:11:02 | → | polyphem_ joins (~rod@2a02:810d:840:8754:224e:f6ff:fe5e:bc17) |
| 00:11:34 | <Benzi-Junior> | geekosaur: nevermind, I should have the full spech to be able to get rid of this issue tomorrow, not really worth burning through cycles for |
| 00:11:43 | <lbseale> | Ok that sounds good. The way I'm tracking the line numbers is unsatisfying. I'm kinda parsing them as I parse what I care about |
| 00:11:55 | <lbseale> | It feels like there should be a better way |
| 00:12:22 | <c_wraith> | oh, yikes. that definitely sounds like a performance trap. |
| 00:12:34 | → | Polo joins (~Gambino@user/polo) |
| 00:12:51 | × | mmhat quits (~mmh@p200300f1c7086024ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.6) |
| 00:13:44 | → | segfaultfizzbuzz joins (~segfaultf@192-184-223-154.static.sonic.net) |
| 00:13:51 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 00:13:58 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 00:14:17 | × | Polo quits (~Gambino@user/polo) (Client Quit) |
| 00:14:25 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 00:14:34 | <segfaultfizzbuzz> | okay so if i am on an m1 is there a favored way to use haskell (like,... cabal?) or is that still in flux |
| 00:15:49 | <dsal> | I've been on m1 since it came out. I mostly just use nix, but ghcup should also work for you. |
| 00:17:40 | <segfaultfizzbuzz> | install ghcup via curl? |
| 00:18:11 | × | gurkenglas quits (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 248 seconds) |
| 00:19:02 | <lbseale> | c_wraith: do you have thoughts on how to do this? At a small scale, I would do something like zip the lines with their numbers and parse that. Would that idea work for this? |
| 00:19:54 | <lbseale> | Or maybe do something like find the lines I want without their numbers, then do another pass and find what number they're on? That seems dumb because I should only have to do one pass |
| 00:19:57 | <c_wraith> | it's how I'd start, but I'd keep an eye on memory use. |
| 00:20:43 | <c_wraith> | something that handles streaming the file line-by-line would be my next step if that gave me trouble. |
| 00:21:03 | <c_wraith> | any of the streaming libraries handle that case well enough |
| 00:21:30 | <lbseale> | Ok I think looking into streaming is the next step |
| 00:21:37 | <lbseale> | Ty |
| 00:22:15 | × | motersen_ quits (~motersen@user/motersen) (Remote host closed the connection) |
| 00:23:21 | → | motersen joins (~motersen@user/motersen) |
| 00:23:48 | <segfaultfizzbuzz> | ghcup installs 8.10.7 instead of 9.x,... |
| 00:24:33 | <c_wraith> | 8.10.7 is still the latest release that people are confident doesn't have issues. |
| 00:24:41 | <segfaultfizzbuzz> | i see ok. thanks :-) |
| 00:24:48 | <c_wraith> | but ghcup knows about a lot more versions |
| 00:25:04 | <c_wraith> | try "ghcup tui" to see what it knows about |
| 00:25:18 | <segfaultfizzbuzz> | oh fun :-) |
| 00:25:46 | <segfaultfizzbuzz> | i assume this is a haskell tui library? if so which? |
| 00:27:20 | <c_wraith> | looks like brick, based on its cabal file |
| 00:28:14 | <segfaultfizzbuzz> | ok thanks i will go try to hack bye |
| 00:28:16 | × | segfaultfizzbuzz quits (~segfaultf@192-184-223-154.static.sonic.net) (Quit: segfaultfizzbuzz) |
| 00:29:47 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 00:29:53 | × | dos__^^ quits (~user@user/dos/x-1723657) (Read error: Connection reset by peer) |
| 00:30:58 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 00:33:07 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 248 seconds) |
| 00:34:43 | × | vglfr quits (~vglfr@145.224.94.72) (Ping timeout: 248 seconds) |
| 00:36:01 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 00:36:51 | × | merijn quits (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Ping timeout: 248 seconds) |
| 00:40:20 | → | vysn joins (~vysn@user/vysn) |
| 00:52:18 | × | mvk quits (~mvk@2607:fea8:5ce3:8500::a1ec) (Ping timeout: 244 seconds) |
| 00:54:19 | <Axman6> | lbseale: is there anything wrong with doing filter (isJust . snd) . zipWith (\n l -> (n, parse myParser l)) [0..] . lines $ myData ? |
| 01:00:15 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 252 seconds) |
| 01:04:34 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 01:08:31 | → | money_ joins (~Gambino@pool-100-11-18-203.phlapa.fios.verizon.net) |
| 01:09:08 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 01:10:23 | × | xff0x quits (~xff0x@2405:6580:b080:900:732a:bfb0:2264:97bb) (Ping timeout: 244 seconds) |
| 01:10:34 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 01:10:56 | × | stef204 quits (~stef204@user/stef204) (Quit: WeeChat 3.6) |
| 01:12:20 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 01:13:16 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 01:14:12 | × | Midjak quits (~Midjak@82.66.147.146) (Quit: This computer has gone to sleep) |
| 01:15:20 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 01:16:41 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 01:17:56 | → | nate4 joins (~nate@98.45.169.16) |
| 01:18:08 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 01:21:30 | → | segfaultfizzbuzz joins (~segfaultf@192-184-223-154.static.sonic.net) |
| 01:22:01 | <segfaultfizzbuzz> | i ran into llvm missing when trying to run cabal build after installing via ghcup despite having used brew to install llvm,... |
| 01:22:16 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 01:23:03 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 256 seconds) |
| 01:23:21 | × | money_ quits (~Gambino@pool-100-11-18-203.phlapa.fios.verizon.net) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 01:25:03 | → | abraham joins (~abraham@159.89.183.132) |
| 01:26:55 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 01:32:29 | × | pieguy128_ quits (~pieguy128@bas8-montreal02-65-93-195-183.dsl.bell.ca) (Ping timeout: 268 seconds) |
| 01:33:23 | → | merijn joins (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) |
| 01:34:23 | <maerwald[m]> | segfaultfizzbuzz: needs to be in PATH |
| 01:34:49 | <segfaultfizzbuzz> | i'll check up on that but brew in my experience normally takes care of that (??) |
| 01:35:25 | <geekosaur> | brew has casks, especially for things that can be installed with multiple versions like llvm |
| 01:35:39 | <geekosaur> | it's on you to add the appropriate cask to $PATH |
| 01:36:38 | <segfaultfizzbuzz> | oh it's because people commonly use different versions and are quite sensitive to the version number, ok |
| 01:39:04 | × | dkh^ quits (~dkh@96.70.11.181) (Remote host closed the connection) |
| 01:42:47 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 252 seconds) |
| 01:45:42 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 256 seconds) |
| 01:45:43 | × | euandreh quits (~euandreh@179.214.113.107) (Ping timeout: 252 seconds) |
| 01:47:11 | × | fserucas quits (~fserucas@89.214.149.93) (Ping timeout: 252 seconds) |
| 01:49:28 | → | euandreh joins (~euandreh@179.214.113.107) |
| 01:52:45 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 01:53:03 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 01:54:36 | → | xff0x joins (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) |
| 01:56:51 | × | segfaultfizzbuzz quits (~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 248 seconds) |
| 02:03:01 | → | money joins (~Gambino@pool-100-11-18-203.phlapa.fios.verizon.net) |
| 02:05:57 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 02:05:57 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 02:05:57 | finn_elija | is now known as FinnElija |
| 02:07:43 | × | merijn quits (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds) |
| 02:10:36 | × | abraham quits (~abraham@159.89.183.132) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 02:10:38 | × | bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 256 seconds) |
| 02:11:27 | → | abraham joins (~abraham@159.89.183.132) |
| 02:12:01 | → | kannon joins (~NK@135-180-47-54.fiber.dynamic.sonic.net) |
| 02:14:06 | × | money quits (~Gambino@pool-100-11-18-203.phlapa.fios.verizon.net) (Remote host closed the connection) |
| 02:15:44 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection) |
| 02:16:49 | × | zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!) |
| 02:17:55 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 02:18:01 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 02:18:34 | × | td_ quits (~td@muedsl-82-207-238-019.citykom.de) (Ping timeout: 256 seconds) |
| 02:19:24 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 268 seconds) |
| 02:19:41 | × | kannon quits (~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 255 seconds) |
| 02:20:13 | → | dsrt^ joins (~dsrt@96.70.11.181) |
| 02:20:16 | → | td_ joins (~td@muedsl-82-207-238-030.citykom.de) |
| 02:20:32 | × | abraham quits (~abraham@159.89.183.132) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 02:21:33 | → | abraham joins (~abraham@159.89.183.132) |
| 02:22:55 | → | kimjetwav joins (~user@2607:fea8:235e:b600:ed0:fc28:dc0a:d8c3) |
| 02:28:35 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 02:29:12 | → | nate4 joins (~nate@98.45.169.16) |
| 02:29:45 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 02:29:47 | × | ezzieyguywuf quits (~Unknown@user/ezzieyguywuf) (Remote host closed the connection) |
| 02:29:51 | × | abraham quits (~abraham@159.89.183.132) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 02:33:04 | → | segfaultfizzbuzz joins (~segfaultf@192-184-223-154.static.sonic.net) |
| 02:33:16 | → | vglfr joins (~vglfr@145.224.94.199) |
| 02:34:02 | × | jargon quits (~jargon@174-22-194-180.phnx.qwest.net) (Remote host closed the connection) |
| 02:35:05 | → | ezzieyguywuf joins (~Unknown@user/ezzieyguywuf) |
| 02:37:56 | × | wrengr quits (~wrengr@201.59.83.34.bc.googleusercontent.com) (Quit: leaving) |
| 02:40:39 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 02:42:08 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 268 seconds) |
| 02:42:22 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 256 seconds) |
| 02:42:49 | × | terrorjack quits (~terrorjac@2a01:4f8:1c1e:509a::1) (Quit: The Lounge - https://thelounge.chat) |
| 02:43:49 | → | terrorjack joins (~terrorjac@2a01:4f8:1c1e:509a::1) |
| 02:46:36 | → | nate4 joins (~nate@2600:1010:b06b:152:9c94:ff0b:6bbb:1d01) |
| 02:46:42 | → | kannon joins (~NK@135-180-47-54.fiber.dynamic.sonic.net) |
| 02:46:46 | → | pieguy128 joins (~pieguy128@bras-base-mtrlpq5031w-grc-49-67-70-103-208.dsl.bell.ca) |
| 02:51:08 | × | kannon quits (~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 244 seconds) |
| 02:56:17 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 02:56:28 | → | polykernel[m] joins (~polykerne@user/polykernel) |
| 02:56:46 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 02:58:51 | → | jargon joins (~jargon@174-22-194-180.phnx.qwest.net) |
| 03:13:55 | × | jero98772 quits (~jero98772@2800:484:1d80:d8ce:efcc:cbb3:7f2a:6dff) (Remote host closed the connection) |
| 03:14:16 | → | Kaipei joins (~Kaiepi@142.68.249.28) |
| 03:16:51 | × | Kaiepi quits (~Kaiepi@142.68.249.28) (Ping timeout: 248 seconds) |
| 03:17:55 | × | segfaultfizzbuzz quits (~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 248 seconds) |
| 03:23:40 | → | segfaultfizzbuzz joins (~segfaultf@192-184-223-154.static.sonic.net) |
| 03:23:47 | × | nate4 quits (~nate@2600:1010:b06b:152:9c94:ff0b:6bbb:1d01) (Ping timeout: 248 seconds) |
| 03:25:27 | × | vglfr quits (~vglfr@145.224.94.199) (Ping timeout: 252 seconds) |
| 03:26:50 | → | nate4 joins (~nate@98.45.169.16) |
| 03:27:42 | → | kannon joins (~NK@135-180-47-54.fiber.dynamic.sonic.net) |
| 03:27:59 | × | tomboy64 quits (~tomboy64@user/tomboy64) (Quit: Off to see the wizard.) |
| 03:31:04 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 03:31:40 | × | segfaultfizzbuzz quits (~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 256 seconds) |
| 03:31:57 | × | kannon quits (~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 244 seconds) |
| 03:32:14 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 256 seconds) |
| 03:32:15 | × | Vajb quits (~Vajb@2001:999:705:3c86:e7ea:442b:1e01:22d8) (Read error: Connection reset by peer) |
| 03:33:04 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3ad-40.dhcp.inet.fi) |
| 03:38:00 | → | ddellacosta joins (~ddellacos@143.244.47.100) |
| 03:40:08 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 03:44:43 | → | abraham joins (~abraham@159.89.183.132) |
| 03:44:44 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 03:45:50 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 03:50:33 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 03:50:38 | → | vglfr joins (~vglfr@145.224.94.199) |
| 03:51:36 | × | vysn quits (~vysn@user/vysn) (Ping timeout: 244 seconds) |
| 03:58:53 | → | kannon joins (~NK@135-180-47-54.fiber.dynamic.sonic.net) |
| 03:59:34 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 04:00:33 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 04:03:54 | → | merijn joins (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) |
| 04:07:16 | × | abraham quits (~abraham@159.89.183.132) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 04:11:36 | × | shriekingnoise quits (~shrieking@186.137.167.202) (Quit: Quit) |
| 04:12:53 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 04:13:32 | → | fraznel joins (~fuag1@c-73-221-56-19.hsd1.wa.comcast.net) |
| 04:15:04 | → | nate4 joins (~nate@98.45.169.16) |
| 04:16:51 | → | segfaultfizzbuzz joins (~segfaultf@192-184-223-154.static.sonic.net) |
| 04:17:35 | × | martin02 quits (~silas@141.84.69.76) (Ping timeout: 256 seconds) |
| 04:19:43 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 252 seconds) |
| 04:21:37 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3ad-40.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 04:21:51 | → | Vajb joins (~Vajb@2001:999:705:3c86:e7ea:442b:1e01:22d8) |
| 04:24:13 | <fraznel> | i'm running into an issue with postgresql-simple i think gobbling up some useful error messaging. I'm pooling database connections that are used very infrequently. On reading I see that I should probably be using the tcp_keepalive options on my connection string |
| 04:25:04 | <fraznel> | but whats worrying is that in the scenario where the postgresql-simple connection gets dropped, any further queries lock up the thread they are attempting to execute from and dont display any error or whatnot |
| 04:26:04 | <fraznel> | I'm putting in a fix that I assume will fix the problem for a bit via adding the keepalive options on the connection string but was wondering if anyone in here knows of a way to get postgresql-simple to give any feedback on a broken connection |
| 04:28:20 | × | benin0 quits (~benin@183.82.206.27) (Ping timeout: 256 seconds) |
| 04:31:13 | → | martin02 joins (~silas@141.84.69.76) |
| 04:34:38 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 04:35:11 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 04:35:35 | → | mbuf joins (~Shakthi@122.165.55.71) |
| 04:37:58 | × | qrpnxz quits (~qrpnxz@fsf/member/qrpnxz) (Ping timeout: 256 seconds) |
| 04:38:03 | × | merijn quits (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds) |
| 04:44:57 | → | nate4 joins (~nate@98.45.169.16) |
| 04:45:55 | <fraznel> | huh, in the docs it says these throw exceptions, I must be eating exceptions from this thread :| |
| 04:49:25 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 252 seconds) |
| 04:51:19 | → | lisbeths joins (uid135845@id-135845.lymington.irccloud.com) |
| 05:08:42 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 05:09:29 | <Axman6> | Is there an applicative newtype wrapper that runs effects in the reverse order? (Foo af) <*> (Foo ax) = Foo ((\x f -> f x) <$> ax <*> af) |
| 05:09:35 | × | hgolden quits (~hgolden2@cpe-172-251-233-141.socal.res.rr.com) (Quit: Konversation terminated!) |
| 05:09:56 | → | hgolden joins (~hgolden2@cpe-172-251-233-141.socal.res.rr.com) |
| 05:10:30 | <Axman6> | fraznel: sounds worth making an issue oni the project for, particularly if the behaviour seems to not math the docs, or it's confusing |
| 05:11:44 | <Axman6> | Re: above, we have some code that does reverse <*> mapM f (reverse xs) and I was wondering if we could avoid the double reverse (also trying to decide if it would actually be beneficial) |
| 05:19:21 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 05:20:35 | × | segfaultfizzbuzz quits (~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 248 seconds) |
| 05:25:31 | <fraznel> | Axman6, roger that, will do |
| 05:29:36 | × | hgolden quits (~hgolden2@cpe-172-251-233-141.socal.res.rr.com) (Quit: Konversation terminated!) |
| 05:30:37 | → | hgolden joins (~hgolden2@cpe-172-251-233-141.socal.res.rr.com) |
| 05:42:00 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 05:44:54 | → | pagnol joins (~me@213-205-209-87.ftth.glasoperator.nl) |
| 05:48:27 | → | nilradical joins (~nilradica@user/naso) |
| 05:51:58 | × | kimjetwav quits (~user@2607:fea8:235e:b600:ed0:fc28:dc0a:d8c3) (Ping timeout: 244 seconds) |
| 05:52:40 | → | zeenk joins (~zeenk@2a02:2f04:a311:2d00:6865:d863:4c93:799f) |
| 05:53:04 | → | nate4 joins (~nate@98.45.169.16) |
| 05:56:22 | × | nilradical quits (~nilradica@user/naso) (Remote host closed the connection) |
| 05:57:52 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 256 seconds) |
| 06:07:28 | × | kannon quits (~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 244 seconds) |
| 06:08:37 | <jackdk> | Axman6: https://hackage.haskell.org/package/transformers-0.6.0.4/docs/Control-Applicative-Backwards.html |
| 06:08:59 | <jackdk> | Also `Compose Dual Ap`, possibly? |
| 06:14:43 | → | kannon joins (~NK@135-180-47-54.fiber.dynamic.sonic.net) |
| 06:15:19 | <pareto-optimal-d> | <fraznel> "I'm putting in a fix that I..." <- You probably want this: |
| 06:15:19 | <pareto-optimal-d> | https://github.com/haskellari/postgresql-simple/pull/71 |
| 06:16:31 | → | nilradical joins (~nilradica@user/naso) |
| 06:22:36 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 06:26:02 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 06:27:08 | <fraznel> | pareto-optimal-d: thats super useful :) Thanks! |
| 06:28:20 | <pareto-optimal-d> | fraznel: Have fun on the async exceptions resource cleanup rabbit hole! |
| 06:29:25 | <fraznel> | yeah it looks scary, and i'm doing this inside a thread as well. set this stuff up long ago and need to take out the shovel and dig at what exceptions work where again... |
| 06:30:44 | <fraznel> | seems like even with that fix i should be using something like safe-exceptions to do clean up w.r.t ResourcePool |
| 06:30:51 | <fraznel> | er, Data.Pool |
| 06:31:47 | <fraznel> | wait, pool is supposed to handle that... hopefully the core issue was postgresql eating the exception and now things will "just work" |
| 06:32:04 | <fraznel> | unlikely but that's what i'm going to tell myself till the server falls over next :P |
| 06:34:28 | → | merijn joins (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) |
| 06:34:59 | × | nilradical quits (~nilradica@user/naso) (Remote host closed the connection) |
| 06:36:05 | → | nilradical joins (~nilradica@user/naso) |
| 06:36:09 | <pareto-optimal-d> | That PR and using safe-exceptions should solve Data.Pool being poisoned with broken postgres connections. |
| 06:38:13 | × | nilradical quits (~nilradica@user/naso) (Remote host closed the connection) |
| 06:38:29 | → | nilradical joins (~nilradica@user/naso) |
| 06:39:15 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 06:40:52 | → | mmhat joins (~mmh@p200300f1c7086024ee086bfffe095315.dip0.t-ipconnect.de) |
| 06:41:45 | <dminuoso> | tomsmeding: Fun thing, it turns out Andrew Martin has stepped into similar issues with regards to pretty printing, and ended up writing a custom builder for very short strings in his `ip` package. (Well in fact he build packages bytebuild and bytesmith to deal with this in a generalized manner) |
| 06:42:43 | <dminuoso> | It would be nice if I could just reuse my ShortByteString buffers in an UTF8 buffer, but `ip` incurs a `text < 1.3` constraint. |
| 06:43:07 | <dminuoso> | Does GHC come with some interleaveZero C function to copy an ASCII buffer into a UTF8 buffer? |
| 06:43:10 | <dminuoso> | *UTF16 |
| 06:45:11 | × | califax quits (~califax@user/califx) (Ping timeout: 268 seconds) |
| 06:45:11 | × | adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Ping timeout: 268 seconds) |
| 06:45:57 | → | adanwan joins (~adanwan@gateway/tor-sasl/adanwan) |
| 06:46:04 | → | azimut_ joins (~azimut@gateway/tor-sasl/azimut) |
| 06:46:23 | → | califax joins (~califax@user/califx) |
| 06:46:25 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds) |
| 06:47:02 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 268 seconds) |
| 06:47:02 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 268 seconds) |
| 06:47:02 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 268 seconds) |
| 06:47:02 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 268 seconds) |
| 06:47:36 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 06:47:48 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 06:47:57 | <fraznel> | pareto-optimal-d, thanks, that link is gold, i need to work on a repro for the failure case in isolation but will chime in on that pr, hopefully it gets merged soon |
| 06:49:15 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 06:49:53 | × | adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Client Quit) |
| 06:50:25 | → | stiell joins (~stiell@gateway/tor-sasl/stiell) |
| 06:51:38 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 06:51:46 | → | alternateved joins (~user@staticline-31-183-146-203.toya.net.pl) |
| 06:52:17 | → | adanwan joins (~adanwan@gateway/tor-sasl/adanwan) |
| 06:53:17 | → | `2jt joins (~jtomas@56.red-88-17-82.dynamicip.rima-tde.net) |
| 06:56:22 | → | coot joins (~coot@213.134.176.158) |
| 06:57:41 | <pareto-optimal-d> | <fraznel> "pareto-optimal-dev, thanks, that..." <- There are some in the related issues |
| 06:59:04 | × | kannon quits (~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 256 seconds) |
| 06:59:36 | <pareto-optimal-d> | pareto-optimal-d: https://github.com/haskellari/postgresql-simple/issues/69#issuecomment-1167690911 |
| 07:02:06 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:4fe7:bccf:37a6:be4b) |
| 07:03:09 | → | waldo joins (~waldo@user/waldo) |
| 07:08:42 | × | merijn quits (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 07:10:49 | × | alternateved quits (~user@staticline-31-183-146-203.toya.net.pl) (Remote host closed the connection) |
| 07:13:16 | → | Techcable joins (~Techcable@user/Techcable) |
| 07:13:20 | → | alternateved joins (~user@staticline-31-183-146-203.toya.net.pl) |
| 07:16:14 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 07:16:48 | → | cfricke joins (~cfricke@user/cfricke) |
| 07:16:50 | → | benin0 joins (~benin@183.82.205.32) |
| 07:20:19 | × | zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection) |
| 07:21:26 | → | zaquest joins (~notzaques@5.130.79.72) |
| 07:21:43 | → | merijn joins (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) |
| 07:21:48 | → | akegalj joins (~akegalj@135-40.dsl.iskon.hr) |
| 07:22:19 | × | nilradical quits (~nilradica@user/naso) (Remote host closed the connection) |
| 07:23:23 | → | nilradical joins (~nilradica@user/naso) |
| 07:23:54 | → | vysn joins (~vysn@user/vysn) |
| 07:24:27 | <akegalj> | Is there a way to run `cabal repl` from command line with some package sandboxed. Something like `cabal repl --package vector` which would give me repl with vector installed ? |
| 07:24:39 | × | azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds) |
| 07:24:50 | <tomsmeding> | akegalj: `cabal repl --build-depends vector`, or shorter `cabal repl -b vector` |
| 07:24:51 | <dminuoso> | `cabal repl --build-depends optics` |
| 07:25:10 | <tomsmeding> | dminuoso: how long are your buffers that you want to interleaveZero |
| 07:25:28 | <akegalj> | thanks <3 , couldn't find that info in cabal --help |
| 07:25:39 | <dminuoso> | tomsmeding: Potentially up to 255 bytes, realistically as long as usual domain labels. |
| 07:25:54 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 07:26:02 | <dminuoso> | akegalj: Try `cabal repl --help` |
| 07:26:21 | × | merijn quits (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds) |
| 07:26:26 | <dminuoso> | akegalj: Right at the bottom, above where your prompt returns, would have been some examples. :) |
| 07:26:29 | <akegalj> | dminuoso: i did, but couldn't find that info... I mean there is a lot of options so I must have missed it |
| 07:27:49 | × | nilradical quits (~nilradica@user/naso) (Ping timeout: 252 seconds) |
| 07:28:14 | <akegalj> | dminuoso: there are no examples of said commands when `cabal repl --help` is entered with cabal version 3.0.0.0 on my machine. |
| 07:28:51 | → | acidjnk joins (~acidjnk@p200300d6e7137a19a561eed7706d09b0.dip0.t-ipconnect.de) |
| 07:28:52 | <dminuoso> | Consider updating cabal, 3.0.0.0 is over 2 years old already |
| 07:28:52 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 07:30:00 | × | rembo10 quits (~rembo10@main.remulis.com) (Quit: ZNC 1.8.2 - https://znc.in) |
| 07:30:16 | <akegalj> | dminuoso: good point |
| 07:31:04 | → | rembo10 joins (~rembo10@main.remulis.com) |
| 07:34:13 | × | vysn quits (~vysn@user/vysn) (Ping timeout: 256 seconds) |
| 07:35:15 | <sm> | well, I'm removing all name shadowing.. it does add noise to the code |
| 07:35:40 | <tomsmeding> | sm: condolences with your ' |
| 07:35:53 | × | `2jt quits (~jtomas@56.red-88-17-82.dynamicip.rima-tde.net) (Quit: Leaving) |
| 07:36:08 | → | merijn joins (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) |
| 07:37:57 | → | jonathanx_ joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) |
| 07:40:36 | × | jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Ping timeout: 268 seconds) |
| 07:41:32 | → | fserucas joins (~fserucas@89.214.149.93) |
| 07:43:49 | → | nattiestnate joins (~nate@202.138.250.62) |
| 07:45:25 | → | `2jt joins (~jtomas@56.red-88-17-82.dynamicip.rima-tde.net) |
| 07:45:51 | × | `2jt quits (~jtomas@56.red-88-17-82.dynamicip.rima-tde.net) (Client Quit) |
| 07:49:57 | <dminuoso> | Okay its decided. I will make modifications to haskell-ip to allow for text-2.0, so that I can simply copy the ASCII byte buffers into the underlying text ByteArray# |
| 07:50:22 | <dminuoso> | The other thing would just be a temporary workaround |
| 07:51:10 | → | chele joins (~chele@user/chele) |
| 07:53:26 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 07:56:50 | → | odnes joins (~odnes@5-203-132-117.pat.nym.cosmote.net) |
| 07:57:20 | → | kuribas joins (~user@ptr-17d51ep2y03n1mswpe5.18120a2.ip6.access.telenet.be) |
| 07:57:55 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 248 seconds) |
| 07:58:43 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 08:07:35 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 08:07:35 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 08:07:35 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 08:07:38 | <tomsmeding> | dminuoso: https://paste.tomsmeding.com/aRMTTRPu |
| 08:07:50 | <tomsmeding> | requires AVX2 |
| 08:08:20 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 08:08:24 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 08:08:25 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
| 08:08:26 | → | califax joins (~califax@user/califx) |
| 08:09:27 | → | __monty__ joins (~toonn@user/toonn) |
| 08:09:49 | → | stiell joins (~stiell@gateway/tor-sasl/stiell) |
| 08:10:39 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 08:10:58 | → | ubert joins (~Thunderbi@77.119.220.133.wireless.dyn.drei.com) |
| 08:11:19 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
| 08:11:37 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 08:11:47 | → | stiell joins (~stiell@gateway/tor-sasl/stiell) |
| 08:12:03 | → | yvan-sraka joins (~yvan-srak@laubervilliers-656-1-51-219.w193-252.abo.wanadoo.fr) |
| 08:13:11 | <dminuoso> | Mmm, thats fast enough for an unsafe FFI call - added advantage would that I can just pass the unpinned bytearray buffer in an unsafe call |
| 08:13:25 | <tomsmeding> | (forgot to compile the functions into a separate translation units to prevent inlining; doing that, the times don't really change) |
| 08:14:13 | × | yvan-sraka quits (~yvan-srak@laubervilliers-656-1-51-219.w193-252.abo.wanadoo.fr) (Remote host closed the connection) |
| 08:14:13 | <tomsmeding> | YMMV on different CPUs though, so benchmark :p |
| 08:14:24 | → | yvan-sraka joins (~yvan-srak@laubervilliers-656-1-51-219.w193-252.abo.wanadoo.fr) |
| 08:14:52 | <dminuoso> | avx/avx2 is available on our hypervisors. |
| 08:14:59 | <tomsmeding> | yay! |
| 08:15:38 | <tomsmeding> | (license public domain, attribution not required) |
| 08:16:03 | <dminuoso> | Cheers, then. |
| 08:16:22 | <dminuoso> | I guess you have experience writing MIMO code? |
| 08:17:15 | × | coot quits (~coot@213.134.176.158) (Quit: coot) |
| 08:22:15 | <dminuoso> | tomsmeding: What's that second for-loop doing inside ascii_to_utf16? |
| 08:22:20 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 08:22:22 | <dminuoso> | Is that an accidental left over? |
| 08:23:01 | <dminuoso> | ohh no, hold on. That's just to deal with some modulo 16 leftovers, right? |
| 08:29:39 | × | nattiestnate quits (~nate@202.138.250.62) (Quit: WeeChat 3.6) |
| 08:30:21 | → | nate4 joins (~nate@98.45.169.16) |
| 08:30:25 | <tomsmeding> | dminuoso: indeed to deal with the 100%16 leftover bytes |
| 08:30:42 | <tomsmeding> | I had a course in my masters that dealt with stuff like this :p |
| 08:31:37 | → | wonko joins (~wjc@2a0e:1c80:2::130) |
| 08:32:38 | <tomsmeding> | oh it's incorrect :') |
| 08:32:44 | <tomsmeding> | (I hadn't even tested the code) |
| 08:34:16 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 256 seconds) |
| 08:34:42 | <tomsmeding> | oh lol |
| 08:34:51 | <tomsmeding> | heu |
| 08:35:00 | <int-e> | > 256/8 |
| 08:35:02 | × | adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Quit: _) |
| 08:35:04 | <lambdabot> | 32.0 |
| 08:35:25 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 256 seconds) |
| 08:35:34 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds) |
| 08:35:46 | → | adanwan joins (~adanwan@gateway/tor-sasl/adanwan) |
| 08:37:31 | → | jgeerds joins (~jgeerds@55d46bad.access.ecotel.net) |
| 08:41:20 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 08:41:49 | → | nilradical joins (~nilradica@user/naso) |
| 08:41:56 | <dminuoso> | tomsmeding: Im trying to really understand the point of _mm256_unpacklo_epi8 mmm |
| 08:42:09 | <tomsmeding> | yeah that's the instruction where it goes wrong lol, I'm debugging |
| 08:42:18 | <tomsmeding> | that's supposed to do the interleaving |
| 08:42:31 | <dminuoso> | Well, it only interleaves low-order elements |
| 08:42:41 | <dminuoso> | See https://doc.rust-lang.org/core/arch/x86_64/fn._mm256_unpacklo_epi8.html |
| 08:43:36 | <int-e> | but that's fine if you process 16 bytes at a time? |
| 08:43:38 | <tomsmeding> | dminuoso: https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#techs=SSE,SSE2,SSE3,SSSE3,SSE4_1,SSE4_2,AVX,AVX2,FMA,AVX_VNNI,Other&ig_expand=3896,3906,4018,595,6188,488,3897,4505,6873,4505,7415,6254,4505,4505,7415,4107,4107,7415,7415&text=_mm256_unpacklo_epi8 |
| 08:43:52 | × | nilradical quits (~nilradica@user/naso) (Remote host closed the connection) |
| 08:43:59 | <tomsmeding> | I'm reading 16 bytes from src, expanding (hopefully) that to 32 bytes with interleaved zeros using unpacklo, then writing 32 bytes to dst |
| 08:44:11 | <dminuoso> | Yeah, I just used the rust one because it had a reasonable presentation of what it does :P |
| 08:44:48 | <dminuoso> | tomsmeding: Check the rust one, can only read 8 and expand to 16 |
| 08:44:49 | → | nilradical joins (~nilradica@user/naso) |
| 08:45:01 | <tomsmeding> | owait |
| 08:45:03 | <tomsmeding> | lol |
| 08:45:29 | <dminuoso> | Hence: |
| 08:45:30 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 08:45:30 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
| 08:45:30 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 08:45:30 | × | califax quits (~califax@user/califx) (Write error: Connection reset by peer) |
| 08:45:33 | × | nilradical quits (~nilradica@user/naso) (Remote host closed the connection) |
| 08:45:33 | <dminuoso> | Im trying to really understand the point of _mm256_unpacklo_epi8 mm" |
| 08:45:37 | <tomsmeding> | :') |
| 08:45:49 | → | nilradical joins (~nilradica@user/naso) |
| 08:45:54 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 08:45:57 | → | califax joins (~califax@user/califx) |
| 08:46:09 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 08:46:15 | <tomsmeding> | bummer we'll need a shuffle then |
| 08:46:20 | → | stiell joins (~stiell@gateway/tor-sasl/stiell) |
| 08:46:36 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 08:46:42 | <tomsmeding> | oh latency and throughput are the same on skylake? fancy |
| 08:46:42 | <dminuoso> | No, we can just follow this up with _mm256_unpacklo_epi8 + offset no? |
| 08:46:51 | <dminuoso> | _mm256_unpackhi_epi8 |
| 08:46:58 | <tomsmeding> | apparently a single shuffle is equally fast as a single unpacklo |
| 08:47:03 | <tomsmeding> | lemme check and bench |
| 08:47:08 | <int-e> | Ah, there's a gap. That is nasty. |
| 08:47:57 | <dminuoso> | If I look at the _mm512 implementation, I think there's something instinsic about 128 bit lanes in there. |
| 08:48:10 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 08:48:19 | <dminuoso> | So all the unpacklo work on the lower order per 128 bit lane |
| 08:48:21 | <int-e> | tomsmeding: What happens when you do that masked read 16 bytes before the end of the page and the next page isn't mapped? |
| 08:48:47 | <tomsmeding> | int-e: the intel docs sample code don't do loads for the masked positions |
| 08:48:54 | <tomsmeding> | I checked that |
| 08:49:20 | <tomsmeding> | and IIRC that means the cpu will throw away any exception it gets for the masked-out bytes |
| 08:49:28 | <tomsmeding> | thereby becoming a lot slower probably for end-of-page cases, but eh |
| 08:49:33 | <int-e> | cool |
| 08:49:36 | <dminuoso> | tomsmeding: Is alternating _mm256_unpacklo_epi8 and _mm256_unpackhi_epi8 an option? |
| 08:49:39 | <tomsmeding> | yes |
| 08:49:40 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Ping timeout: 268 seconds) |
| 08:49:42 | <int-e> | also crazy :P |
| 08:49:49 | <tomsmeding> | but shuffle is supposed to be equally fast as a single unpacklo |
| 08:50:03 | <dminuoso> | Or does _mm256_unpackhi_epi8 have an alignment requirement? |
| 08:50:10 | <dminuoso> | `shuffle` is that an instruction? |
| 08:50:27 | <tomsmeding> | _mm256_shuffle_epi8 |
| 08:51:16 | <dminuoso> | Somehow I find the documentation on that not helpful |
| 08:51:20 | <tomsmeding> | no |
| 08:51:25 | → | geekosaur joins (~geekosaur@xmonad/geekosaur) |
| 08:51:28 | <dminuoso> | "Performs shuffle operations of the signed or unsigned 8-bit integers in the source vector as specified by the shuffle control mask in the second source operand." |
| 08:51:39 | <tomsmeding> | but the rust docs aren't much better, the reference code has a contradiction between the comments and the code |
| 08:52:35 | <dminuoso> | So what does that even do? |
| 08:52:43 | <tomsmeding> | it shuffles bytes in the simd vector! |
| 08:52:52 | <tomsmeding> | according to some index mapping |
| 08:52:58 | <tomsmeding> | the question is, how is the index mapping represented |
| 08:53:01 | <int-e> | "the halves are shuffled separately" |
| 08:53:11 | <int-e> | as bytes |
| 08:53:19 | <tomsmeding> | damn |
| 08:53:24 | <tomsmeding> | int-e++ |
| 08:53:36 | <tomsmeding> | I was almost there figuring it out from the intel docs |
| 08:53:57 | <int-e> | once again, the code may be the most informative part of those docs |
| 08:54:05 | <tomsmeding> | the code _is_ the docs |
| 08:54:14 | <tomsmeding> | the description is vage and ambiguous at best |
| 08:54:53 | <int-e> | I had not read it... yeah, that's pretty awful. |
| 08:56:17 | <int-e> | Somehow I have to relearn those intrinsics every time I want to use them... they're so random. |
| 08:56:25 | <tomsmeding> | yeah |
| 08:56:43 | <dminuoso> | Mmm, maybe I need to do more SIMD, I dont grok what this shuffling does |
| 08:58:01 | × | fraznel quits (~fuag1@c-73-221-56-19.hsd1.wa.comcast.net) (Ping timeout: 252 seconds) |
| 08:58:10 | <int-e> | dminuoso: The 128 bit version takes 16 bytes, each treated as an index into another 16-byte vector (if the highest bit is unset), or as indicating zero (highest bit set). |
| 08:58:36 | <int-e> | The 256 bit version does this separately for the halves of the arguments. So you get awkward 16 offsets for the second half. |
| 08:58:40 | → | fraznel joins (~fuag1@c-73-221-56-19.hsd1.wa.comcast.net) |
| 08:59:04 | <dminuoso> | Okay, this "separately" makes sense, as Im seeing a pattern of a lot of AVX instructions working per 128 bit lane |
| 08:59:47 | <dminuoso> | Presumably the underlying physical register file is divided into 128 chunks or something along those lines |
| 09:00:00 | <int-e> | Hi, we saw that you love vectorization so we vectorized our vector operations! |
| 09:00:09 | <dminuoso> | heh |
| 09:00:45 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 09:01:27 | <dminuoso> | well presumably you can save some instruction decoding type if the vectorization is just a simple microop loop |
| 09:04:26 | <kuribas> | _mm256_shuffle_epi8 is basically a lookup table |
| 09:04:31 | <kuribas> | where the lookup gets overwritten. |
| 09:05:36 | <dminuoso> | int-e: Okay I think I get it. So per 128 slice the second argument, per byte, the lowbits declare where the source byte at the same index is copied. If the hibit of that byte is set, instead of copying a 0 byte is inserted at the lowbit address. |
| 09:05:39 | <dminuoso> | Does this sound about right? |
| 09:06:01 | <int-e> | yes |
| 09:06:41 | <dminuoso> | Then yeah, I think _mm_shuffle_epi8 will do fine. |
| 09:06:44 | <kuribas> | there are some nice hacks using this, like a leading zero count. |
| 09:06:55 | <kuribas> | dminuoso: what do you want to do? |
| 09:07:09 | <dminuoso> | Im golfing a prettyprinter. |
| 09:08:01 | <tomsmeding> | I tried _mm256_permute4x64_epi64 + _mm256_unpacklo_epi8 + _mm256_unpackhi_epi8 + _mm256_or_si256 and it makes all the _other_ code twice as slow |
| 09:08:10 | <tomsmeding> | I thought only avx512 pulled that shit |
| 09:08:13 | <kuribas> | how do you use intrinsics in haskell? |
| 09:08:19 | × | cfricke quits (~cfricke@user/cfricke) (Ping timeout: 248 seconds) |
| 09:08:19 | <tomsmeding> | C |
| 09:08:30 | <kuribas> | so #haskell-offtopic then? |
| 09:08:31 | <merijn> | Or ghc-prim + LLVM backend :p |
| 09:08:33 | <dminuoso> | Or: {-# LANGUAGE InlineAssembly #-} |
| 09:08:45 | <dminuoso> | That should be a thing. |
| 09:08:49 | <merijn> | (or does NCG support the ghc-prim vector ops now too) |
| 09:08:53 | <merijn> | +? |
| 09:09:08 | <dminuoso> | kuribas: Given that this is a Haskell library, its very ontopic. |
| 09:09:14 | <kuribas> | dminuoso: right |
| 09:09:17 | <dminuoso> | I just want to pretty print domain names as fast as possible. |
| 09:09:40 | <merijn> | kuribas: ghc-prim has a crapton of vector primitives, but you'd have to ping carter or #ghc to know how stable they are |
| 09:09:45 | <dminuoso> | So tomsmeding came up with AVX for doing an ASCII-to-UTF16 trick to copy already-ascii-encoded byte buffers directly into a text (pre 2.0) buffer |
| 09:09:48 | <tomsmeding> | dminuoso: I fear you'd have to use the avx (not-avx2) versions, i.e. 128-wide, because apparently unpacklo+unpackhi is bad? https://paste.tomsmeding.com/tCbbfnCe |
| 09:10:02 | <tomsmeding> | but I have to run so good luck :p |
| 09:10:02 | <kuribas> | tomsmeding: avx512 has some bad reputation. |
| 09:10:04 | <tomsmeding> | might have time later |
| 09:10:07 | × | akegalj quits (~akegalj@135-40.dsl.iskon.hr) (Ping timeout: 252 seconds) |
| 09:10:07 | <tomsmeding> | kuribas: I'm using avx2 |
| 09:10:13 | <tomsmeding> | but I'm getting the same shenanigans somehow |
| 09:10:24 | <dminuoso> | tomsmeding: thanks for the efforts nevertheless, Ill take it from there. :) |
| 09:10:33 | <dminuoso> | Ill let you know what I end up using |
| 09:10:43 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 268 seconds) |
| 09:11:17 | × | notzmv quits (~zmv@user/notzmv) (Ping timeout: 268 seconds) |
| 09:11:39 | <dminuoso> | Though I think a shuffle will suffice |
| 09:11:53 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz) |
| 09:12:05 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 09:13:01 | <int-e> | kuribas: Does it still suffer from forced frequency scaling? https://blog.cloudflare.com/on-the-dangers-of-intels-frequency-scaling/ struck me as pretty embarrassing 5 years ago. |
| 09:13:15 | → | Pickchea joins (~private@user/pickchea) |
| 09:17:02 | <kuribas> | int-e: not sure |
| 09:17:38 | <kuribas> | But speeding up some code with only 30%, but then having the rest of the computer go slower seems pretty uninteresting to me... |
| 09:20:13 | <kuribas> | And there is Torvads criticism that the die space could be put to better use. |
| 09:20:40 | <kuribas> | tomsmeding: avx2 is widely supported now. |
| 09:20:42 | × | wonko quits (~wjc@2a0e:1c80:2::130) (Ping timeout: 244 seconds) |
| 09:20:54 | <int-e> | avx2 makes good sense since it matches cache line size |
| 09:23:49 | <kuribas> | dminuoso: you may want to check daniel lemire's blog for a sorts of SIMD projects. |
| 09:24:06 | <kuribas> | like parsing JSON, printing doubles, etc... |
| 09:25:28 | <dminuoso> | kuribas: Its not without cause. In production, the largest hotspot is a tight pretty printer loop where I foldl over a bytestring |
| 09:25:39 | <dminuoso> | *foldl' |
| 09:25:53 | × | stefan-_ quits (~cri@42dots.de) (Ping timeout: 252 seconds) |
| 09:26:12 | <dminuoso> | At the end it only accounts for 10% of the time, but because it makes for a small portion of it, this will scale poorly |
| 09:26:25 | <dminuoso> | (We're pretty printing a low number of domain names right now, but this will become much larger) |
| 09:26:46 | <kuribas> | foldl' over bytestring bytes? |
| 09:28:01 | <dminuoso> | Yeah |
| 09:28:54 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 09:29:39 | → | beteigeuze joins (~Thunderbi@bl11-28-222.dsl.telepac.pt) |
| 09:31:23 | <kuribas> | Did you check the core, to see if it's being optimized into a loop? |
| 09:32:09 | <dminuoso> | I honestly dont want to cater to the optimizer, I want guaranteed performance. |
| 09:32:20 | <dminuoso> | Otherwise Ill have to repeat this every time GHC is updated |
| 09:32:38 | × | fraznel quits (~fuag1@c-73-221-56-19.hsd1.wa.comcast.net) (Ping timeout: 256 seconds) |
| 09:32:50 | × | odnes quits (~odnes@5-203-132-117.pat.nym.cosmote.net) (Ping timeout: 268 seconds) |
| 09:33:23 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 248 seconds) |
| 09:33:25 | → | stefan-_ joins (~cri@42dots.de) |
| 09:33:49 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 09:36:01 | → | gurkenglas joins (~gurkengla@p548ac72e.dip0.t-ipconnect.de) |
| 09:36:12 | × | yvan-sraka quits (~yvan-srak@laubervilliers-656-1-51-219.w193-252.abo.wanadoo.fr) (Ping timeout: 252 seconds) |
| 09:36:58 | <kuribas> | dminuoso: maybe the foldl' itself is not slow, but the thing you are accumulating? |
| 09:37:08 | <kuribas> | (I assume another Bytestring) |
| 09:37:15 | <dminuoso> | Im constructing a text builder |
| 09:38:18 | <kuribas> | A Text Builder is a closure, so it will first build the closure from the ByteString, then execute it. |
| 09:38:23 | <kuribas> | That could be very slow. |
| 09:38:52 | <kuribas> | A lazy version would be faster, but still rely on ghc magic. |
| 09:40:19 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 09:40:20 | <dminuoso> | You know whats faster even still? Shuffling ASCII bytes into an UTF16 buffer, and just unsafely construct a `Text` out of that. :) |
| 09:40:33 | <kuribas> | sure |
| 09:40:39 | <dminuoso> | Hence AVX |
| 09:40:51 | <kuribas> | I just wonder if the SIMD isn't overkill. |
| 09:41:24 | <dminuoso> | Well you have to interleave all the bytes with 0s. |
| 09:41:31 | <kuribas> | did you try with lazy foldl? |
| 09:41:54 | <dminuoso> | I dont see how a lazy foldl could possibly cheaper |
| 09:42:06 | <dminuoso> | It just causes accumulation of intermediate results |
| 09:42:22 | <dminuoso> | Given that I foldl' and (<>) a *lot* of builders, its not going to be good. |
| 09:43:00 | <geekosaur> | doesn't that fix you at text < 2? |
| 09:43:16 | <dminuoso> | geekosaur: Its the other way around. Im already fixed to text < 2, otherwise I could just steal the buffer. |
| 09:43:22 | <kuribas> | dminuoso: hmm, maybe you need foldr then? |
| 09:43:50 | <dminuoso> | kuribas: foldr is only useful *if* you want to stream lazy results. For a computational loop a foldl' is going to be better |
| 09:44:15 | <kuribas> | dminuoso: yes, but you are creating a Text Builder, which is a closure. |
| 09:44:20 | <kuribas> | That's not a computation loop. |
| 09:45:23 | × | nilradical quits (~nilradica@user/naso) (Remote host closed the connection) |
| 09:45:43 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 09:45:58 | <dminuoso> | kuribas: same cost, its really just the builders that are costly |
| 09:46:17 | <int-e> | you may want laziness between chunks, but not while building a chunk |
| 09:46:18 | <dminuoso> | I dont get useful cost centers because everything is inlined into the foldr |
| 09:46:47 | → | nilradical joins (~nilradica@user/naso) |
| 09:46:52 | <dminuoso> | Even now I experimented by using T.decodeLatin1 per domain label, but thats also too expensive |
| 09:47:09 | <dminuoso> | (its comparable to just foldl'ing over the bytes and using Data.Text.Builder.singleton |
| 09:48:49 | → | mima joins (mmh@gateway/vpn/airvpn/mima) |
| 09:48:55 | <kuribas> | int-e: how do you do that with ByteString? You don't control chunks do you? |
| 09:49:41 | <kuribas> | int-e: you cannot read the bytes lazily, but create the Text eagerly? |
| 09:50:38 | <int-e> | kuribas: Which kind of ByteString? We're producing Text, which /may/ be chunked. I'm only half following, I don't know how big the strings are. |
| 09:51:12 | <kuribas> | int-e: as I understand, dminuoso is reading the characters of a (lazy?) ByteString, then creating a Text Builder out of that. |
| 09:51:20 | × | nilradical quits (~nilradica@user/naso) (Ping timeout: 268 seconds) |
| 09:51:48 | <int-e> | In any case, you don't have to use the same chunking as the source. |
| 09:51:55 | <dminuoso> | Imagine just [ShortByteString] where each bytestring is just a domain label, like ["www", "google", "de"] |
| 09:52:08 | <int-e> | And if the strings are short then you'll not want to chunk the Text at all. |
| 09:52:16 | <int-e> | Which means you won't want any laziness. |
| 09:52:23 | <kuribas> | int-e: why would I think about chunking, when the Text Builder library does that for me? |
| 09:52:52 | <int-e> | kuribas: It's not your problem at all, is it? |
| 09:52:55 | <dminuoso> | kuribas: text builder is very inefficient for appending very small fragments. |
| 09:54:17 | <int-e> | kuribas: I'm spouting generalities but I think your call for laziness is misguided in this context. |
| 09:54:48 | × | berberman_ quits (~berberman@user/berberman) (Ping timeout: 244 seconds) |
| 09:54:49 | <dminuoso> | kuribas: In our degenerate case where we build ip6.arpa zones we end up with something like "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.a.e.c.5.a.b.c.1.2.b.b.d.f.ip6.arpa." |
| 09:55:21 | <int-e> | dminuoso: Hah, you may want tables of hex digits and small ASCII numbers (up to 255). |
| 09:55:24 | → | kannon joins (~NK@135-180-47-54.fiber.dynamic.sonic.net) |
| 09:55:34 | <dminuoso> | So we have a foldl' over each 1-byte ShortByteString, so we end up doing something like: TB.singleton '0' <> TB.singleton '0' ... |
| 09:55:44 | <kuribas> | int-e: I am just saying that using foldl' to create a Text Builder is very, very inefficient. |
| 09:55:59 | <dminuoso> | int-e: Heh we already do just that for case folding already. :) |
| 09:56:15 | <dminuoso> | int-e: https://gist.github.com/dminuoso/d263aefb9d60cad2c46a72c9e69a001d |
| 09:57:26 | <dminuoso> | int-e: But it wont work for what you suggest well |
| 09:57:53 | <dminuoso> | There's some gross impedance mismatch between how ip6.arpa zones are represented and how IPv6 addresses work. |
| 09:58:17 | <int-e> | I don't have the context. Are you splitting domain names or building them from chunks? Or both? |
| 09:58:19 | <kuribas> | int-e: because you have to go over each character just to create the closure, before anything is written to the output Text. |
| 09:58:27 | <kuribas> | int-e: tell me if I am wrong? |
| 09:59:00 | <dminuoso> | int-e: So a domain is formally a list of domain labels, each of which is just a series of up to 64 arbitrary octets. So I represent a Domain as [ShortByteString] |
| 09:59:21 | <dminuoso> | This representation is very useful in a bunch of places |
| 09:59:35 | × | kannon quits (~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 255 seconds) |
| 09:59:41 | <dminuoso> | But at some point I want to pretty print that back into a text |
| 10:00:06 | <int-e> | kuribas: Ah. Awkward. |
| 10:00:47 | <dminuoso> | kuribas: either way, foldr yields the exact same runtime duration |
| 10:01:01 | → | dschrempf joins (~dominik@mobiledyn-62-240-134-145.mrsn.at) |
| 10:01:07 | <kuribas> | dminuoso: ok |
| 10:01:29 | × | dschrempf quits (~dominik@mobiledyn-62-240-134-145.mrsn.at) (Client Quit) |
| 10:04:14 | <kuribas> | dminuoso: I also read that the strict builder is much more efficient. |
| 10:04:33 | <kuribas> | But ok, a direct loop with avx and mutation will outperform anything else :) |
| 10:04:48 | <int-e> | I don't see TextBuilder doing a great job for this at all. You want `foldl'` to get the length but the compiler will never see through the closures and turn them into good code. |
| 10:05:03 | → | nilradical joins (~nilradica@user/naso) |
| 10:05:12 | → | coot joins (~coot@213.134.176.158) |
| 10:05:54 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 10:06:11 | → | califax joins (~califax@user/califx) |
| 10:08:54 | × | xff0x quits (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 256 seconds) |
| 10:10:55 | <int-e> | kuribas: Anyway, the way the abstraction works, I agree that `foldr` will usually do better than `foldl'`. But I think none of this will be very fast except in simple cases that don't involve any folds at all. |
| 10:11:05 | <int-e> | emphasis on *very* |
| 10:11:06 | <kuribas> | agreed |
| 10:11:18 | <int-e> | it's still a step up from concatenating Text values. |
| 10:11:51 | <int-e> | except when the result gets big... because there's no chunking at all |
| 10:13:16 | → | wonko joins (~wjc@2a0e:1c80:2::130) |
| 10:13:49 | <kuribas> | maybe text-builder is just slow... |
| 10:14:17 | × | waldo quits (~waldo@user/waldo) (Ping timeout: 252 seconds) |
| 10:17:11 | <int-e> | Well as you said, it is building clousres (except when everything gets inlined; buildText (char 'a' <> char 'b' <> char 'c') should produce pretty good code: allocate an array and fill it with 3 or 6 bytes, depending on the Text version. Though it's up to ghc to do all the constant folding.) |
| 10:19:10 | <kuribas> | what if you write an explicit loop, and use linear text builder instead? |
| 10:20:32 | × | lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 10:27:24 | <dminuoso> | kuribas: The haskell way would be to calculate the length of the required buffer, and then looping over the bytes and poking them directly into a MutableByteArray |
| 10:27:33 | <dminuoso> | I think this is the fastest way |
| 10:31:02 | × | vjoki quits (~vjoki@2a00:d880:3:1::fea1:9ae) (Quit: ...) |
| 10:40:12 | <int-e> | Right. An elaborate fusion framework might achieve that with folds on top of TextBuilder but it doesn't have such a framework. (Not a complaint; fusion is hard and a lot of work.) |
| 10:41:31 | → | vjoki joins (~vjoki@2a00:d880:3:1::fea1:9ae) |
| 10:41:32 | <int-e> | text-builder-linear doesn't do any of this either; it's mostly using a buffer size doubling strategy and doesn't build closures. |
| 10:42:10 | <int-e> | so it should land somewhere in the middle between text-builder and the manual direct loop. |
| 10:42:12 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 10:42:46 | <int-e> | But it also pulls in linear types. |
| 10:46:52 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds) |
| 10:49:17 | → | nate4 joins (~nate@98.45.169.16) |
| 10:54:14 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 268 seconds) |
| 10:56:42 | × | pagnol quits (~me@213-205-209-87.ftth.glasoperator.nl) (Remote host closed the connection) |
| 10:57:57 | → | lambro joins (~lambro@user/lambro) |
| 10:58:38 | → | xff0x joins (~xff0x@2405:6580:b080:900:19d1:e58d:306e:9622) |
| 10:59:48 | × | nilradical quits (~nilradica@user/naso) (Remote host closed the connection) |
| 11:00:26 | × | foul_owl quits (~kerry@23.82.194.107) (Read error: Connection reset by peer) |
| 11:00:43 | → | nilradical joins (~nilradica@user/naso) |
| 11:05:39 | × | nilradical quits (~nilradica@user/naso) (Ping timeout: 248 seconds) |
| 11:06:38 | × | wonko quits (~wjc@2a0e:1c80:2::130) (Ping timeout: 255 seconds) |
| 11:08:25 | × | acidjnk quits (~acidjnk@p200300d6e7137a19a561eed7706d09b0.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
| 11:14:24 | → | nilradical joins (~nilradica@user/naso) |
| 11:17:31 | → | foul_owl joins (~kerry@23.82.194.108) |
| 11:20:08 | → | notzmv joins (~zmv@user/notzmv) |
| 11:29:09 | × | nilradical quits (~nilradica@user/naso) () |
| 11:32:28 | → | acidjnk joins (~acidjnk@p200300d6e7137a19a561eed7706d09b0.dip0.t-ipconnect.de) |
| 11:33:46 | <dminuoso> | tomsmeding: By the way, your code has alignment assumptions that wont work (unless GHC has some guarantee that ByteArray# was 16-byte aligned |
| 11:34:13 | <dminuoso> | I find it quite confusing and hard to navigate all the AVX intrinsics that are supported on AVX1/2, but would work here |
| 11:35:41 | × | lambro quits (~lambro@user/lambro) (Quit: quit) |
| 11:36:49 | × | califax quits (~califax@user/califx) (Quit: ZNC 1.8.2 - https://znc.in) |
| 11:37:03 | × | lieven quits (~mal@ns2.wyrd.be) (Quit: WeeChat 3.0) |
| 11:38:17 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 11:38:25 | → | califax joins (~califax@user/califx) |
| 11:39:41 | <tomsmeding> | dminuoso: I don't think it had many alignment requirements? the load intrinsic didn't have any alignment requirements specified in the docs, and I used `storeu` instead of `store` precisely to avoid alignment requirements |
| 11:39:42 | → | lieven joins (~mal@ns2.wyrd.be) |
| 11:39:52 | × | jgeerds quits (~jgeerds@55d46bad.access.ecotel.net) (Ping timeout: 268 seconds) |
| 11:40:05 | <geekosaur> | I think ghc may guarantee 16 byte alignment on x86 anyway |
| 11:40:12 | <tomsmeding> | dminuoso: to filter on __m128i stuff, filter on _mm_ |
| 11:41:45 | <dminuoso> | Uh maybe I looked at the wrong thing. |
| 11:42:51 | <dminuoso> | For a load without mask Id have to use _mm_maskload_si128 right? |
| 11:42:59 | <dminuoso> | (or si32/si64) |
| 11:43:19 | <dminuoso> | Err _mm_loadu_si128 |
| 11:43:29 | <tomsmeding> | yeah that last one |
| 11:43:31 | <dminuoso> | because it seems that _mm_loadu_epi8 is avx512 |
| 11:43:37 | <dminuoso> | Sadly |
| 11:43:49 | <tomsmeding> | that makes zero sense, what's the difference |
| 11:44:07 | <carter> | Avx 512 isn’t always a win though |
| 11:44:12 | <dminuoso> | i8 vs i128 |
| 11:44:15 | <carter> | Depending on the cpu |
| 11:44:17 | <dminuoso> | _m128i |
| 11:44:18 | <tomsmeding> | carter: no one here is using avx512 |
| 11:44:36 | <carter> | Good |
| 11:45:28 | <dminuoso> | __m128i _mm_loadu_epi8 (void const* mem_addr) |
| 11:45:30 | <dminuoso> | __m128i _mm_loadu_si128 (__m128i const* mem_addr) |
| 11:45:36 | <carter> | Shuffles are great |
| 11:45:51 | <dminuoso> | tomsmeding: Its just frustrating because I have to figure out how to cleanly pun that pointer now. :( |
| 11:45:58 | <tomsmeding> | dminuoso: the only difference in the operation description is that _mm_loadu_epi8 zeros the part above the lower 128 bits |
| 11:46:08 | <tomsmeding> | dminuoso: just pun it |
| 11:46:13 | <tomsmeding> | since there are no alignment requirements |
| 11:46:28 | <dminuoso> | tomsmeding: You do realizse that punning is not allowed in C right? :) |
| 11:46:44 | <tomsmeding> | you either make your life impossible, or you pun here |
| 11:46:50 | <tomsmeding> | there is no intrinsic to do that punning for you |
| 11:46:55 | <dminuoso> | Can you add C flags in the cabal file? |
| 11:47:06 | <dminuoso> | tomsmeding: there's a GCC builtin |
| 11:47:07 | <tomsmeding> | cc-flags: ... |
| 11:47:09 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 11:47:10 | <dminuoso> | Ah |
| 11:47:19 | <tomsmeding> | dminuoso: O.o which |
| 11:48:57 | → | CiaoSen joins (~Jura@p200300c95738a5002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 11:50:36 | <dminuoso> | tomsmeding: __attribute__ ((__may_alias__)) |
| 11:51:16 | <dminuoso> | But its impossible to use in this case, because the AVX implementation would have to use this |
| 11:51:27 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds) |
| 11:51:31 | × | Pickchea quits (~private@user/pickchea) (Ping timeout: 248 seconds) |
| 11:51:32 | <dminuoso> | So -fno-strict-aliasing is required then |
| 11:51:52 | <dminuoso> | Or I could rely on GCCs extension to permit union punning |
| 11:54:05 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 11:56:32 | <carter> | What do you mean by pun? |
| 11:58:32 | <merijn> | carter: accessing data through a pointer of the wrong type |
| 11:59:23 | <merijn> | carter: Also, glorious news I don't think I told you yet |
| 11:59:30 | <carter> | Oh? |
| 11:59:43 | <carter> | We can switch apps if you want |
| 11:59:46 | <merijn> | carter: Guess who has two thumbs and has his phd defense scheduled in less than a month ;) |
| 11:59:55 | <carter> | Ohhhhh man congrats |
| 12:04:26 | <kuribas> | dminuoso: I still think you are prematurely optimizing. |
| 12:04:44 | <kuribas> | With the simd intrinsics |
| 12:07:00 | → | akegalj joins (~akegalj@135-40.dsl.iskon.hr) |
| 12:12:54 | × | benin0 quits (~benin@183.82.205.32) (Quit: The Lounge - https://thelounge.chat) |
| 12:13:54 | → | benin0 joins (~benin@183.82.205.66) |
| 12:27:36 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
| 12:27:43 | → | abraham joins (~abraham@159.89.183.132) |
| 12:29:40 | → | famubu joins (~famubu@14.139.174.50) |
| 12:29:40 | × | famubu quits (~famubu@14.139.174.50) (Changing host) |
| 12:29:40 | → | famubu joins (~famubu@user/famubu) |
| 12:30:25 | <kuribas> | OTOH SIMD intrinsics are cool :) |
| 12:30:25 | <famubu> | Hi. I got two lists [1,2,3] and [1,2]. I needed to left pad the shorter list with zeros so that they are both of the same length. What would be a good way to do that in haskell? |
| 12:31:31 | ← | abraham parts (~abraham@159.89.183.132) () |
| 12:31:34 | <kuribas> | famubu: and return which one? |
| 12:32:49 | × | img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
| 12:33:06 | → | img joins (~img@user/img) |
| 12:33:54 | <kuribas> | > let l1 = length [1, 2, 3]; l2 = length [1, 2] in (replicate (l2 - l1) 0 : l1, replicate (l1 - l2) 0: l2) |
| 12:33:55 | <lambdabot> | error: |
| 12:33:56 | <lambdabot> | • Couldn't match expected type ‘[[a]]’ with actual type ‘Int’ |
| 12:33:56 | <lambdabot> | • In the second argument of ‘(:)’, namely ‘l1’ |
| 12:34:15 | <kuribas> | > let l1 = length [1, 2, 3]; l2 = length [1, 2] in (replicate (l2 - l1) 0 ++ l1, replicate (l1 - l2) 0 ++ l2) |
| 12:34:17 | <lambdabot> | error: |
| 12:34:17 | <lambdabot> | • Couldn't match expected type ‘[a]’ with actual type ‘Int’ |
| 12:34:17 | <lambdabot> | • In the second argument of ‘(++)’, namely ‘l1’ |
| 12:35:27 | <kuribas> | > let l1 = [1, 2, 3]; l2 = [1, 2]; len1 = length l1; len2 = length l2 in (replicate (len2 - len1) 0 ++ l1, replicate (len1 - len2) 0 ++ l2) |
| 12:35:29 | <lambdabot> | ([1,2,3],[0,1,2]) |
| 12:36:19 | <famubu> | kuribas: I wanted both lists, but with the smaller one zero-padded so that they are both of smae lenght. |
| 12:36:49 | <famubu> | Yeah something like that. Thanks. |
| 12:40:38 | × | kmein quits (~weechat@user/kmein) (Quit: ciao kakao) |
| 12:42:40 | → | kmein joins (~weechat@user/kmein) |
| 12:49:00 | <dminuoso> | famubu: do you know, beforehand, which list is shorter? |
| 12:54:28 | <dminuoso> | If yes, you can have a lazy option that admits the longer list to be infinite (and save work as well) |
| 12:54:34 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 12:55:18 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 12:55:55 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Read error: Connection reset by peer) |
| 12:56:04 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 12:56:21 | <famubu> | dminuoso: No for my current problem, I can't know which one would be shorter, but this might come in useful. What is the lazy option? |
| 12:56:29 | <famubu> | Had another doubt: I was looking to generate `[(0,0), (1,0), (1,1), (2,0), (2,1), (2,2)]`. Can we use nest list comprehension for that? I tried `[(n,k) | k <- [0..n] | n <- [0..2] ]` but that gave error. |
| 12:56:54 | <merijn> | famubu: n isn't in scope there |
| 12:57:00 | <merijn> | Reverse the <- parts |
| 12:57:35 | × | kmein quits (~weechat@user/kmein) (Quit: ciao kakao) |
| 12:58:06 | Lord_of_Life_ | is now known as Lord_of_Life |
| 12:58:26 | <famubu> | merijn: You mean, make `n <- [0..2]` to `[0..2] <- n`? Or to reverse the arrow direction? |
| 12:58:34 | <dminuoso> | famubu: Mmm, maybe not. I was thinking of right padding actually |
| 12:58:37 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 12:58:58 | <merijn> | > [(n,k) | n <- [0..2] | k <- [0..n]] |
| 12:58:59 | <lambdabot> | *Exception: not an integer: n |
| 12:59:15 | <merijn> | wait, wut? |
| 12:59:23 | <merijn> | oh, wait |
| 12:59:38 | → | kmein joins (~weechat@user/kmein) |
| 12:59:38 | <dminuoso> | Num polymorphism? |
| 12:59:39 | <merijn> | > [(n,k) | n <- [0..2], k <- [0..n]] -- cartesian product is , not parallel list comprehension |
| 12:59:40 | <geekosaur> | > [(n,k) | n <- [0..2], k <- [0..n]] |
| 12:59:41 | <lambdabot> | [(0,0),(1,0),(1,1),(2,0),(2,1),(2,2)] |
| 12:59:42 | <lambdabot> | [(0,0),(1,0),(1,1),(2,0),(2,1),(2,2)] |
| 12:59:45 | <geekosaur> | yes |
| 13:00:11 | <famubu> | Oh the n got to come first. Got it. Thanks! |
| 13:00:16 | <dminuoso> | > [(n,k) | n <- [0..2] | k <- [0..n]] |
| 13:00:17 | <lambdabot> | *Exception: not an integer: n |
| 13:00:18 | <dminuoso> | How does that even parse? |
| 13:00:30 | <geekosaur> | look up ParallelListComprehension extension |
| 13:01:11 | <famubu> | I had come across an error saying something about parallel list as well when I was trying things out (wrongly). |
| 13:01:17 | <famubu> | :) |
| 13:01:29 | × | causal quits (~user@50.35.83.177) (Quit: WeeChat 3.6) |
| 13:02:16 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 13:02:42 | <famubu> | Is there a way to generate it like: `[[(0,0)],[(1,0),(1,1)],[(2,0),(2,1),(2,2)]]`? |
| 13:02:57 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 13:02:59 | <famubu> | Maybe a careful insertion of square bracket can help? |
| 13:03:03 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 13:03:10 | <merijn> | > sortOn snd $ [(n,k) | n <- [0..2], k <- [0..n]] |
| 13:03:12 | <lambdabot> | [(0,0),(1,0),(2,0),(1,1),(2,1),(2,2)] |
| 13:03:31 | <merijn> | ah, wait, no |
| 13:03:46 | <famubu> | Oh I think I got it: [[(n,k) | k <- [0..n]] | n <- [0..3] ] |
| 13:03:46 | <merijn> | > groupBy fst . sort $ [(n,k) | n <- [0..2], k <- [0..n]] |
| 13:03:48 | <lambdabot> | error: |
| 13:03:48 | <lambdabot> | • Occurs check: cannot construct the infinite type: |
| 13:03:48 | <lambdabot> | b ~ (b, b) -> Bool |
| 13:03:58 | <famubu> | [[(n,k) | k <- [0..n]] | n <- [0..3] ] |
| 13:04:16 | <famubu> | How do we trigger lambdabot? |
| 13:04:39 | <merijn> | > groupBy ((==) `on` fst) . sort $ [(n,k) | n <- [0..2], k <- [0..n]] |
| 13:04:41 | <lambdabot> | [[(0,0)],[(1,0),(1,1)],[(2,0),(2,1),(2,2)]] |
| 13:05:11 | <merijn> | famubu: "> " in front |
| 13:05:27 | <famubu> | > [[(n,k) | k <- [0..n]] | n <- [0..3] ] |
| 13:05:28 | <lambdabot> | [[(0,0)],[(1,0),(1,1)],[(2,0),(2,1),(2,2)],[(3,0),(3,1),(3,2),(3,3)]] |
| 13:05:46 | <famubu> | Thanks! |
| 13:07:15 | → | cfricke joins (~cfricke@user/cfricke) |
| 13:12:41 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 13:17:18 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds) |
| 13:18:03 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 13:18:41 | → | nate4 joins (~nate@98.45.169.16) |
| 13:23:51 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 256 seconds) |
| 13:30:17 | → | jgeerds joins (~jgeerds@55d46bad.access.ecotel.net) |
| 13:34:40 | × | coot quits (~coot@213.134.176.158) (Quit: coot) |
| 13:34:41 | → | nschoe joins (~quassel@2a04:cec0:116d:ab5f:e90c:6f4d:989:53d0) |
| 13:38:03 | <tomsmeding> | merijn: good luck! |
| 13:39:02 | <dminuoso> | Did he submit his thesis? |
| 13:39:18 | <merijn> | dminuoso: I did *that* literal months ago :p |
| 13:39:29 | <dminuoso> | Hey I did not get the memo |
| 13:39:35 | <dminuoso> | Wasn't very active recently |
| 13:39:41 | <merijn> | dminuoso: The last few weeks were the painful last finishing touches :p |
| 13:39:56 | <dminuoso> | I thought you submitted already, now you're back to finishing? |
| 13:40:02 | <dminuoso> | Which one is it? |
| 13:40:19 | <merijn> | dminuoso: Easy, submit unfinished thesis ;) |
| 13:40:43 | <dminuoso> | Does that even work? |
| 13:40:47 | <merijn> | dminuoso: Specifically, acknowledgements, overall summary, Dutch translation of the summary, cover, etc. don't need to be done to send it to the committee |
| 13:40:57 | <dminuoso> | Like, can you publish an altered thesis? |
| 13:41:11 | <dminuoso> | Or do the alternations need to be accepted as well? |
| 13:41:52 | <merijn> | dminuoso: You're not allowed to make alterations to content (i.e. the science bits), but it doesn't have to be print ready so stuff like acknowledgements, layout, etc. |
| 13:43:42 | <merijn> | dminuoso: So it was just designing a cover, messing with styling and fighting the dreaded overfull/underfull hbox demons :p |
| 13:44:24 | → | caffery156 joins (~caffery@user/caffery156) |
| 13:45:03 | <caffery156> | guys does haskell creates a new list or map when we change certain value |
| 13:45:18 | <kuribas> | caffery156: yes, but it can share |
| 13:45:24 | <dminuoso> | caffery156: You cannot "change" values, you can only create new ones. |
| 13:45:48 | <dminuoso> | (Well we do have mutability if you need it, but you likely are not referring to that) |
| 13:46:09 | <kuribas> | > let x = [1, 2..] in 2:drop 1 x |
| 13:46:11 | <lambdabot> | [2,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,... |
| 13:46:16 | → | Pickchea joins (~private@user/pickchea) |
| 13:46:36 | <kuribas> | caffery156: this doesn't copy all of x, but shares the tail of x |
| 13:47:20 | <caffery156> | yes i am not referring to mutability.I am java programmer and i am curious about haskell. |
| 13:47:51 | <dminuoso> | If I want guaranteed deforestation of Maybe, should I just use a continuation? Or is there some kind of fusion trick like Codensity/Yoneda? |
| 13:48:15 | <tomsmeding> | caffery156: in-memory representation of kuribas' example https://tomsmeding.com/ss/get/tomsmeding/ZXhJj9 |
| 13:48:18 | <dminuoso> | caffery156: Well you were asking about mutation. :) |
| 13:49:51 | <caffery156> | tomsmeding: ah i see.so you guys have linkedlist as list?so haskell does not has an "array" i guess |
| 13:49:58 | <merijn> | Sure it does |
| 13:49:59 | <dminuoso> | caffery156: we do have arrays too. |
| 13:50:19 | <caffery156> | dminuoso: ah i meant evalution of value |
| 13:50:45 | <tomsmeding> | but changing an element of an _array_ means copying the array (not necessarily its values -- the array backing structure) |
| 13:50:47 | <dminuoso> | caffery156: Yes, and Im saying: during evaluation we do not have mutation (this is strictly speaking also not true, we can sneak in mutations) |
| 13:51:19 | <tomsmeding> | we do also have actual mutable arrays, but those are slightly harder to use |
| 13:52:12 | <tomsmeding> | you can express your favourite imperative algorithm in haskell, but it's not what the haskell designers were focusing on to make easy or natural |
| 13:54:02 | <dminuoso> | caffery156: To explain my remark, we have facilities to do something like an `in-place quicksort` inside pure code. So we get to have the best of all worlds. Pure code without mutation, limited mutation usable inside pure code, and full imperative code. :) |
| 13:54:04 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 13:54:15 | <caffery156> | so if i have array of [1..20] if i wanted to change value 3 to 4.How does haskell changes/replaces value in the list/map without copying the all the contents of the list/map?if the datastructure used is array |
| 13:54:32 | <[Leary]> | dminuoso: You could try `Maybe a ~ forall r. r -> (a -> r) -> r`, but I don't actually know how that will affect performance. I'd be interested to hear, if you benchmark it. |
| 13:55:07 | <dminuoso> | [Leary]: Yeah that's what I was thinking of with continuations. Ill definitely benchmark and let you know |
| 13:55:10 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 13:55:26 | <lortabac> | caffery156: if you use an immutable array then the whole array is copied |
| 13:55:58 | → | kannon joins (~NK@135-180-47-54.fiber.dynamic.sonic.net) |
| 13:56:00 | <geekosaur> | note that [1..20] is a linked list, not an array. tails can be shared |
| 13:56:02 | <lortabac> | caffery156: if you use a list, part of the list can be shared |
| 13:56:10 | <dminuoso> | caffery156: I find this question quite interesting, because it turns out situations where you mutate arrays in place are not very common in functional code. |
| 13:56:12 | <geekosaur> | arrays come in mutable and immutable varieties |
| 13:56:33 | <dminuoso> | caffery156: In Haskell a list is less data structure, its more control flow. |
| 13:56:45 | <dminuoso> | Most lists in Haskell represent loops rather |
| 13:57:07 | <caffery156> | by concept wise or actually? |
| 13:57:08 | <geekosaur> | and immutable ones use "cards": the array is split into chunks internally for mutation purposes, and only the chunks that have changes need to be copied |
| 13:57:38 | <caffery156> | oh thats really a beautiful idea which haskell has |
| 13:57:43 | <caffery156> | very efficient |
| 13:58:08 | <dminuoso> | caffery156: Yes and yes. Once you get into "impure access" we're talking about data structure, which puts you into Array/Vector territories. |
| 13:58:20 | × | img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
| 13:58:48 | <dminuoso> | The major exception to this "lists represent loops" is String, which is [Char] as a historical accident rather. |
| 13:59:07 | <caffery156> | oh |
| 13:59:33 | <geekosaur> | enh, it's still useful |
| 13:59:37 | <dminuoso> | But it may help explain why lists are singly linked lists in Haskell. The only useful operation is just taking the head off and doing something, which leaves you with the tail (another list). |
| 13:59:38 | <caffery156> | monads were quiet hard to digest concept |
| 13:59:42 | <tdammers> | even String is arguably a loop more than a data structure |
| 14:00:08 | <dminuoso> | caffery156: And what can you do with the tail? Well again, you can only take its head off and do something, which leaves you with the tail (another list).. and so on. |
| 14:00:12 | <dminuoso> | Until the tail is empty. |
| 14:00:13 | × | kannon quits (~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 244 seconds) |
| 14:00:15 | <dminuoso> | That is just a loop. |
| 14:00:34 | <caffery156> | ah you mean loop in recursive sense |
| 14:00:44 | <dminuoso> | Recursion is how we encode loops. |
| 14:01:20 | → | img joins (~img@user/img) |
| 14:01:43 | <caffery156> | in all the languages? |
| 14:02:09 | <dminuoso> | Most languages can encode the idea of a loop via recursion, but in many implementations it may not be efficient |
| 14:02:55 | <caffery156> | ya since not all compilers/interpreters do not provide tail recursion |
| 14:03:00 | <caffery156> | optimization |
| 14:03:46 | <dminuoso> | tdammers: Mmm, is it? |
| 14:04:19 | × | acidjnk quits (~acidjnk@p200300d6e7137a19a561eed7706d09b0.dip0.t-ipconnect.de) (Ping timeout: 248 seconds) |
| 14:04:28 | <tdammers> | dminuoso: people may not think of it that way, but it's still a "data structure" that is only efficient for loop-like traversal operations |
| 14:05:51 | <dminuoso> | Doesnt GHC at least offer ways to do buffer stealing, so things like fromString wont be frustratingly slow? |
| 14:06:00 | → | toeffel joins (~toeffel@user/toeffel) |
| 14:06:16 | <dminuoso> | for say Text |
| 14:06:41 | <dminuoso> | Or no.. looking at the implementation they are streamed into Text |
| 14:07:12 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:4fe7:bccf:37a6:be4b) (Quit: WeeChat 2.8) |
| 14:09:10 | <caffery156> | geekosaur: what if i have a mutable array in haskell?how does it handles change i want to perform? does haskell has somekind of pointer arrays which is abstracted to us? |
| 14:09:41 | <dminuoso> | caffery156: We have Array, which offers a mutable interface. We also have Vector, which also offers a mutable interface. |
| 14:09:51 | <kuribas> | caffery156: a mutable array in haskell is just like one in Java. |
| 14:09:58 | <caffery156> | ah ok |
| 14:10:00 | <dminuoso> | These can do mutations either in-plane (using ST or IO), or by copying (as pure code) |
| 14:10:05 | <dminuoso> | Let me show you |
| 14:10:08 | <kuribas> | caffery156: the "immutable" bit is the reference to the array. |
| 14:10:22 | <dminuoso> | For simplicity I will just refer to Vector for now, but we have a wealth of other, similar, data types |
| 14:10:40 | <caffery156> | ok i see |
| 14:11:54 | <dminuoso> | https://hackage.haskell.org/package/vector-0.13.0.0/docs/Data-Vector.html gives you something that is similar to java lists. You get to do either pure updates using: https://hackage.haskell.org/package/vector-0.13.0.0/docs/Data-Vector.html#v:-47--47- |
| 14:12:02 | × | famubu quits (~famubu@user/famubu) (Quit: leaving) |
| 14:13:03 | <dminuoso> | You can also turn a Vector into a mutable Vector https://hackage.haskell.org/package/vector-0.13.0.0/docs/Data-Vector.html#v:thaw, and then write https://hackage.haskell.org/package/vector-0.13.0.0/docs/Data-Vector-Mutable.html#v:write to a given location and modify it in place. |
| 14:13:32 | <dminuoso> | And if you're done with your modifications, you can freeze https://hackage.haskell.org/package/vector-0.13.0.0/docs/Data-Vector.html#v:freeze it and get a non-mutable vector back |
| 14:14:22 | <dminuoso> | (thaw copies the underlying vector, and then inside the ST/IO region you can do all kinds of imperative modifications with it, and freeze copies it back into an immutable vector |
| 14:15:52 | <caffery156> | nice thats quiet lot of inbuilt functionaliy |
| 14:16:52 | <dminuoso> | It's not really built-in, they are Haskell libraries (though they are official Haskell libraries and come with GHC) |
| 14:17:45 | <geekosaur> | there is built in functionality that's used by Array, Vector, ByteString, Text, etc. though |
| 14:18:15 | → | segfaultfizzbuzz joins (~segfaultf@192-184-223-154.static.sonic.net) |
| 14:22:31 | × | segfaultfizzbuzz quits (~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 252 seconds) |
| 14:22:50 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 255 seconds) |
| 14:23:15 | → | waleee joins (~waleee@h-176-10-137-138.NA.cust.bahnhof.se) |
| 14:24:43 | → | o-90 joins (~o-90@gateway/tor-sasl/o-90) |
| 14:26:30 | × | o-90 quits (~o-90@gateway/tor-sasl/o-90) (Remote host closed the connection) |
| 14:28:38 | → | zmt01 joins (~zmt00@user/zmt00) |
| 14:30:01 | → | mastarija joins (~mastarija@2a05:4f46:e03:6000:2897:ebb0:5975:dab9) |
| 14:30:42 | × | zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 244 seconds) |
| 14:34:14 | → | shriekingnoise joins (~shrieking@186.137.167.202) |
| 14:40:01 | <dminuoso> | tomsmeding: Hah, I came up with another solution that apparently works *well* enough. |
| 14:41:34 | <dminuoso> | I unpack the ShortByteString into [Word8], convert them into DList, map with w2c, and then I build them with Data.Text.unpack (which has a streaming framework underneath). As an extra optimization I can precalculate the buffer size and construcft the underlying Stream by hand, so only a single allocation ever takes place |
| 14:41:57 | <dminuoso> | The core trick is the DList, which allows me to just concatenate all the domain labels together quickly |
| 14:43:26 | <dminuoso> | https://paste.tomsmeding.com/SzdhzWGC |
| 14:44:17 | <dminuoso> | It wasnt until this discussion just a moment ago, that I took a look at how `IsString Text` was implemented. At that point I realized Text had a suitable character-by-character streaming framework |
| 14:50:41 | → | bitmapper joins (uid464869@id-464869.lymington.irccloud.com) |
| 14:53:55 | × | waleee quits (~waleee@h-176-10-137-138.NA.cust.bahnhof.se) (Ping timeout: 248 seconds) |
| 14:54:27 | → | segfaultfizzbuzz joins (~segfaultf@192-184-223-154.static.sonic.net) |
| 14:59:02 | × | segfaultfizzbuzz quits (~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 256 seconds) |
| 15:01:26 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 15:02:00 | → | Achylles joins (~Achylles_@2804:431:d725:6988:1e6b:2df1:d746:824) |
| 15:02:27 | × | CiaoSen quits (~Jura@p200300c95738a5002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 248 seconds) |
| 15:10:45 | <tomsmeding> | dminuoso: cool! |
| 15:11:11 | <dminuoso> | With this in place, I can just inject the escaping into the stream of characters. :) |
| 15:11:16 | <tomsmeding> | it feels to me like having a chain of closures, i.e. what DList gives you, should not be very efficient; but perhaps the RTS is so good that it does actually work well :p |
| 15:11:31 | <tomsmeding> | do ping back about benchmarks |
| 15:11:57 | <dminuoso> | Yeah, I will provide a few alternate implementations and benchmark them. |
| 15:12:20 | <dminuoso> | With the sample size from our production compiler its more than sufficient to bring the pretty printing back to 0.01% of total runtime |
| 15:12:39 | <tomsmeding> | oh wow |
| 15:12:41 | <tomsmeding> | so it does really work |
| 15:13:03 | <tomsmeding> | I would never have expected a chain of closures to be really constant-factor efficient |
| 15:13:29 | <dminuoso> | Well that is what DList is for, no? |
| 15:13:35 | <tomsmeding> | does it get optimised to a tight loop by GHC? Feels super hard to me. Or do processors just not care as much about indirect calls as I thought they did? |
| 15:13:58 | <tomsmeding> | dminuoso: DList is for fixing complexity issues, not for necessarily getting great constant-factor performance |
| 15:14:34 | <dminuoso> | complexity issues? and here I was, thinking it was a vehicle for getting constant append on lists. |
| 15:14:39 | <tomsmeding> | or was the original implementation so grossly inefficient that a tight loop would still be faster than DList, but DList is already more than fast enough? |
| 15:14:43 | × | cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.6) |
| 15:14:46 | <tomsmeding> | dminuoso: that's a complexity issue |
| 15:15:02 | <tomsmeding> | ((a ++ b) ++ c) ++ d has quadratic complexity, whereas doing it via DList has linear complexity |
| 15:15:14 | <tomsmeding> | not constant, linear |
| 15:15:28 | <dminuoso> | tomsmeding: Well so the underlying trick is not necessarily DList, but the Stream framework of `text` |
| 15:15:43 | <tomsmeding> | (well, the <> is constant-time, but to convert it back to a list takes linear time) |
| 15:16:02 | <dminuoso> | So if I do a simple `pprLabel :: DomainLabel -> String`, I would still suffer from a complexity problem as I would have to ((a ++ b) ++ c) these labels together |
| 15:16:28 | → | vysn joins (~vysn@user/vysn) |
| 15:16:28 | <tomsmeding> | I have never understood those RULE-based streaming frameworks, and I still don't |
| 15:16:29 | <dminuoso> | tomsmeding: The linear time price is irrelevant, because to consume a list you *eventually* have to go through it |
| 15:16:35 | <tomsmeding> | so that might be where the magic is |
| 15:16:40 | <tomsmeding> | dminuoso: true |
| 15:17:07 | <dminuoso> | As far as I can tell, its not really RULE based |
| 15:17:23 | <tomsmeding> | then how is it all compiled down to a tight loop??? |
| 15:17:29 | <dminuoso> | https://hackage.haskell.org/package/text-2.0.1/docs/src/Data.Text.Internal.Encoding.Fusion.html#unstream |
| 15:17:51 | <dminuoso> | tomsmeding: because it just *is* a tight loop |
| 15:18:10 | <tomsmeding> | that traverses this linked list of instructions |
| 15:18:17 | <dminuoso> | Oh I see what you mean |
| 15:18:21 | <tomsmeding> | hm, it can't be that simple |
| 15:18:50 | <tomsmeding> | what I mean with a tight loop in this case is a tight loop that reads from a buffer and writes to a buffer |
| 15:18:56 | <dminuoso> | The stream builder just injects each characfter at a time |
| 15:19:01 | × | caffery156 quits (~caffery@user/caffery156) (Quit: WeeChat 3.6) |
| 15:19:08 | <dminuoso> | Yeah |
| 15:19:09 | <tomsmeding> | not some haskell code that produces a linked list and a tight loop that consumes said linked list |
| 15:19:16 | <dminuoso> | Ultimately the main problem is lack of text-2.0 |
| 15:19:18 | <tomsmeding> | maybe those get fused together! |
| 15:19:22 | <tomsmeding> | I don't know!@ |
| 15:19:26 | <tomsmeding> | But it feels really hard |
| 15:19:29 | <dminuoso> | Otherwise this would just be bunch of buffer copies at various offsets |
| 15:19:49 | <tomsmeding> | right, and buffer copies are ✨ |
| 15:20:15 | <dminuoso> | Yeah, which is why Im tempted to do still do this in C |
| 15:20:20 | <dminuoso> | at least for text < 2 |
| 15:20:33 | <tomsmeding> | at least compare it with my naive2 if at all reasonable in terms of time investment |
| 15:20:50 | <dminuoso> | Your naive2 is what I was going for. :) |
| 15:21:04 | <tomsmeding> | though you'd have to inject the escaping, I guess |
| 15:21:08 | <dminuoso> | I was just busy rebuilding the escaping logic and offset calculations with continuattions |
| 15:21:17 | <dminuoso> | Sure, I would just do that in C. |
| 15:21:40 | <dminuoso> | Know whats still sad about it? |
| 15:21:48 | <dminuoso> | I have to use a pinned buffer each time |
| 15:22:11 | <tomsmeding> | why? |
| 15:23:02 | <dminuoso> | Because there's no way to get Ptr into a non-pinned ByteArray |
| 15:23:09 | <dminuoso> | https://hackage.haskell.org/package/primitive-0.7.4.0/docs/Data-Primitive-ByteArray.html#v:byteArrayContents |
| 15:23:28 | <tomsmeding> | ah you need the pinning to be able to pass it to C |
| 15:23:31 | <tomsmeding> | that makes sense |
| 15:23:32 | <dminuoso> | No! |
| 15:23:34 | <tomsmeding> | oh |
| 15:23:35 | <dminuoso> | That's the sadness of it. |
| 15:23:44 | <dminuoso> | If you use an unsafe call, you can pass pointers to unpinned memory just fine. |
| 15:23:55 | <dminuoso> | But apparently there's no safe way to get a Ptr to unpinned memory |
| 15:23:59 | <dminuoso> | *unpinned ByteArray# |
| 15:24:17 | <tomsmeding> | then how would you normally pass a pointer to unpinned memory to C |
| 15:24:36 | <dminuoso> | No clue ¯\_(ツ)_/¯ |
| 15:24:40 | <dminuoso> | I wondered that myself |
| 15:24:45 | <tomsmeding> | like, if not this, then what |
| 15:25:07 | <tomsmeding> | there _is_ no other sensible thing to pass to C that is not a primitive type |
| 15:25:16 | <dminuoso> | Maybe it works for other primitive things? |
| 15:25:23 | <tomsmeding> | such as? |
| 15:25:28 | <dminuoso> | dminuoso | No clue ¯\_(ツ)_/¯ |
| 15:25:31 | <tomsmeding> | :') |
| 15:25:32 | <tomsmeding> | my point |
| 15:25:56 | <dminuoso> | All I know is, the documentation says its unsafe, but the ffi documentation says you can pass unpinned memory in unsafe FFI calls |
| 15:27:09 | <dminuoso> | tomsmeding: More confusing: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/ffi.html |
| 15:27:15 | <dminuoso> | Explicitly mentions `unpinned ByteArray#` |
| 15:27:22 | <dminuoso> | But... |
| 15:27:25 | <dminuoso> | Hey I have an idea. |
| 15:27:41 | <tomsmeding> | dminuoso: see also 6.17.3.6, which explicitly mentions byteArrayContents# even |
| 15:27:42 | <dminuoso> | tomsmeding: I just understood, I think. |
| 15:28:09 | × | dsrt^ quits (~dsrt@96.70.11.181) (Remote host closed the connection) |
| 15:28:11 | <dminuoso> | tomsmeding: WEll that section just says you can use it on a pinned bytearray |
| 15:28:16 | <dminuoso> | The crus is just the Ptr conversion |
| 15:28:18 | <dminuoso> | *crux |
| 15:28:35 | <dminuoso> | Nothing prevents you from declaring an ffi like this: |
| 15:29:01 | <dminuoso> | `foreign import ccall unsafe "foo" foo :: MutableByteArray# RealWorld -> IO ()` |
| 15:29:12 | <dminuoso> | (That RealWorld token there, I love it) |
| 15:29:26 | <tomsmeding> | see also this table https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/ffi.html#id9 |
| 15:29:40 | <dminuoso> | tomsmeding: Yes, read the table carefully. |
| 15:29:42 | <dminuoso> | Actually its all there |
| 15:29:49 | <dminuoso> | "When value is used as asrugment to FFI call that is" |
| 15:30:01 | <dminuoso> | Not "Soundness when casting to PTR" |
| 15:30:08 | <tomsmeding> | I see |
| 15:30:23 | <tomsmeding> | question is, what C type does `MutableByteArray# RealWorld` translate to |
| 15:30:44 | <dminuoso> | `uint8_t*` works according to the example |
| 15:31:02 | tomsmeding | should have scrolled down 3cm further |
| 15:31:06 | <dminuoso> | I know right |
| 15:31:23 | <dminuoso> | Though Im not really sure wabout the logic there |
| 15:31:34 | <tomsmeding> | is there documentation about the precise translation of FFI types to C types |
| 15:31:35 | <dminuoso> | The next example maps ArrayArray# (that name...) to `StgArrBytes **` |
| 15:31:43 | <tomsmeding> | there is also ArrayArrayArray# |
| 15:32:08 | <tomsmeding> | or rather, was, since with some recent GHC version (9.4?) the Array(Array)+# things got redundant |
| 15:32:57 | <dminuoso> | Maybe you can just whatever you want in the C code? |
| 15:33:04 | <dminuoso> | I mean there's just linkage |
| 15:33:05 | <tomsmeding> | like `float`? |
| 15:33:10 | <dminuoso> | Maybe yes? |
| 15:33:11 | <tomsmeding> | that's clearly invalid |
| 15:33:14 | <tomsmeding> | I mean, it would compile |
| 15:33:21 | <tomsmeding> | but wouldn't do anything useful |
| 15:33:25 | <dminuoso> | It would be punning. |
| 15:33:31 | <tomsmeding> | no worse than punning |
| 15:33:39 | <tomsmeding> | if you pun within C, at least you get data |
| 15:33:45 | <tomsmeding> | here you might mess up the calling convention |
| 15:33:45 | <dminuoso> | Well you still get data. |
| 15:33:48 | <dminuoso> | Oh. |
| 15:33:57 | <dminuoso> | I guess there is that, heh |
| 15:34:07 | <dminuoso> | But you dont need any header files |
| 15:34:09 | <tomsmeding> | though if you use "capi" that might be slightly less bad |
| 15:34:16 | <dminuoso> | Or do you? |
| 15:34:58 | <dminuoso> | tomsmeding: Oh hold on! |
| 15:35:03 | <dminuoso> | Reading documentation helps! |
| 15:35:07 | <tomsmeding> | yes |
| 15:35:10 | <dminuoso> | "When passing any of the unlifted array types as an argument to a foreign C call, a foreign function sees a pointer that refers to the payload of the array" |
| 15:35:11 | <tomsmeding> | question is, which |
| 15:35:16 | <tomsmeding> | ah |
| 15:35:16 | <dminuoso> | So you always get a pointer. |
| 15:35:24 | <dminuoso> | And what that points at, I guess it really doesnt matter |
| 15:35:46 | <dminuoso> | So you can specify whatever pointee-type you want in the C function, ideally saving you a cast. |
| 15:35:49 | <tomsmeding> | table 8.2 in the haskell report at least explicitly gives the correspondence https://www.haskell.org/onlinereport/haskell2010/haskellch8.html |
| 15:36:29 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 15:37:10 | × | toeffel quits (~toeffel@user/toeffel) (Quit: quit) |
| 15:37:38 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 15:37:52 | <tomsmeding> | the ghc documentation is not super explicit, but at least you can indeed conclude that for ByteArray# you get an uint8_t* |
| 15:38:02 | <tomsmeding> | seems like you just get the heap representatoin |
| 15:38:12 | <tomsmeding> | "Although GHC allows the user to pass all unlifted boxed types to foreign functions, some of them are not amenable to useful work. Although Array# is unlifted, the elements in its payload are lifted, and a foreign C function cannot safely force thunks. Consequently, a foreign C function may not dereference any of the addresses that comprise the payload of the Array#." |
| 15:38:22 | <tomsmeding> | scaaaary |
| 15:38:43 | × | Pickchea quits (~private@user/pickchea) (Ping timeout: 248 seconds) |
| 15:39:07 | <raehik> | Is there a way I can tell GHC "don't warn on non-exhaustive pattern matches here, because you did it wrong"? |
| 15:39:32 | <raehik> | some singletons code compiles with no warnings on 9.2, but warns on 9.0 |
| 15:39:53 | → | coot joins (~coot@213.134.176.158) |
| 15:40:51 | × | coot quits (~coot@213.134.176.158) (Client Quit) |
| 15:41:20 | → | coot joins (~coot@213.134.176.158) |
| 15:47:15 | → | segfaultfizzbuzz joins (~segfaultf@192-184-223-154.static.sonic.net) |
| 15:47:51 | → | etra0 joins (~quassel@186-78-139-217.baf.movistar.cl) |
| 15:50:47 | × | aeka quits (~aeka@user/hiruji) (Ping timeout: 244 seconds) |
| 15:51:29 | × | segfaultfizzbuzz quits (~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 255 seconds) |
| 15:51:50 | → | nineonine joins (~nineonine@2604:3d08:7780:cd00:5cc0:4b6c:24b1:bf92) |
| 15:53:08 | × | merijn quits (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Quit: testing) |
| 15:53:43 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 15:55:08 | × | ddellacosta quits (~ddellacos@143.244.47.100) (Ping timeout: 256 seconds) |
| 15:57:59 | → | segfaultfizzbuzz joins (~segfaultf@192-184-223-154.static.sonic.net) |
| 15:59:29 | × | jgeerds quits (~jgeerds@55d46bad.access.ecotel.net) (Ping timeout: 268 seconds) |
| 16:00:12 | × | goran[m] quits (~goranoour@2001:470:69fc:105::2:1b44) (Quit: You have been kicked for being idle) |
| 16:00:25 | × | akegalj quits (~akegalj@135-40.dsl.iskon.hr) (Ping timeout: 252 seconds) |
| 16:00:49 | × | ccntrq quits (~Thunderbi@172.209.94.92.rev.sfr.net) (Ping timeout: 256 seconds) |
| 16:05:11 | × | gurkenglas quits (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 16:06:06 | → | econo joins (uid147250@user/econo) |
| 16:06:18 | × | nschoe quits (~quassel@2a04:cec0:116d:ab5f:e90c:6f4d:989:53d0) (Ping timeout: 268 seconds) |
| 16:06:22 | → | nschoe_ joins (~quassel@2a01:e0a:8e:a190:c21d:44a3:63e2:38ba) |
| 16:07:25 | → | ccntrq joins (~Thunderbi@172.209.94.92.rev.sfr.net) |
| 16:08:48 | × | nschoe_ quits (~quassel@2a01:e0a:8e:a190:c21d:44a3:63e2:38ba) (Client Quit) |
| 16:10:04 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 16:10:39 | × | omantere quits (~pi@85-156-109-34.elisa-laajakaista.fi) (Ping timeout: 268 seconds) |
| 16:10:41 | × | szkl quits (uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity) |
| 16:17:14 | × | mbuf quits (~Shakthi@122.165.55.71) (Quit: Leaving) |
| 16:19:05 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 16:19:14 | → | acidjnk joins (~acidjnk@p200300d6e7137a36187ce24caf80a2df.dip0.t-ipconnect.de) |
| 16:26:34 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 16:27:23 | × | remedan quits (~remedan@octo.cafe) (Ping timeout: 268 seconds) |
| 16:31:36 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 16:31:59 | → | remedan joins (~remedan@octo.cafe) |
| 16:42:43 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 16:43:22 | <mastarija> | raehik: {-# OPTIONS_GHC -Wno-incomplete-patterns #-} |
| 16:43:45 | <mastarija> | https://downloads.haskell.org/~ghc/latest/docs/users_guide/flags.html?highlight=fno%20warn%20incomplete%20patterns |
| 16:44:33 | <raehik> | mastarija: thanks, there was a stackoverflow question that indicated it might not work so I hadn't tried |
| 16:44:39 | <raehik> | that ^ might not work* |
| 16:44:59 | <raehik> | I removed the --pedantic flag from the build and I'm a lot happier |
| 16:45:43 | <mastarija> | :) |
| 16:47:06 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 16:48:11 | Andrew | is now known as WaxCPU |
| 16:49:07 | × | ubert quits (~Thunderbi@77.119.220.133.wireless.dyn.drei.com) (Ping timeout: 248 seconds) |
| 16:49:31 | → | ubert joins (~Thunderbi@178.165.182.158.wireless.dyn.drei.com) |
| 16:52:14 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 16:54:08 | × | mastarija quits (~mastarija@2a05:4f46:e03:6000:2897:ebb0:5975:dab9) (Quit: WeeChat 3.5) |
| 16:54:30 | → | ardell joins (~ardell@user/ardell) |
| 16:55:25 | × | segfaultfizzbuzz quits (~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 252 seconds) |
| 17:03:41 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 17:10:35 | → | akegalj joins (~akegalj@135-40.dsl.iskon.hr) |
| 17:10:38 | <lbseale> | Axman6: thanks for your suggestion yesterday ... it absolutely seems like this would work. Is there any reason to worry about memory usage? |
| 17:14:06 | → | Pickchea joins (~private@user/pickchea) |
| 17:14:36 | → | segfaultfizzbuzz joins (~segfaultf@192-184-223-154.static.sonic.net) |
| 17:15:53 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 17:20:11 | → | nate4 joins (~nate@98.45.169.16) |
| 17:20:43 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 256 seconds) |
| 17:21:59 | → | gurkenglas joins (~gurkengla@p548ac72e.dip0.t-ipconnect.de) |
| 17:22:28 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 17:24:51 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 248 seconds) |
| 17:25:30 | × | alternateved quits (~user@staticline-31-183-146-203.toya.net.pl) (Remote host closed the connection) |
| 17:30:14 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
| 17:34:53 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 17:37:25 | <segfaultfizzbuzz> | tried: '/opt/homebrew/opt/ghc/lib/ghc-8.10.7/bytestring-0.10.12.0/libHSbytestring-0.10.12.0-ghc8.10.7.dylib' (no such file), '/usr/local/lib/libHSbytestring-0.10.12.0-ghc8.10.7.dylib' (no such file), '/usr/lib/libHSbytestring-0.10.12.0-ghc8.10.7.dylib' (no such file) ...? |
| 17:37:52 | <segfaultfizzbuzz> | i'm guessing this is a path thing but it is already trying a sensible path, i think? |
| 17:38:37 | → | szkl joins (uid110435@id-110435.uxbridge.irccloud.com) |
| 17:39:44 | <segfaultfizzbuzz> | oh, ... it's a missing dependency it seems... but i was kind of expecting that to automatically resolve...? |
| 17:39:59 | <segfaultfizzbuzz> | wait scratch that, that is not a missing dependency |
| 17:40:28 | × | Achylles quits (~Achylles_@2804:431:d725:6988:1e6b:2df1:d746:824) (Remote host closed the connection) |
| 17:41:02 | → | a6a45081-2b83 joins (~aditya@50.47.112.150) |
| 17:41:15 | <geekosaur> | do you need to install dynamic libs separately? ghjc normally uses static for Haskell dependencies |
| 17:41:35 | <geekosaur> | it's not that unusual for dynamic (and profiling) libs/ways to be separate installs |
| 17:41:48 | <segfaultfizzbuzz> | i'm trying to use either cabal or stack for the first time on an m1 |
| 17:42:01 | <a6a45081-2b83> | Hi, so I'm writing a compiler for a subset of haskell and I am thinking how to handle wildcards. Have a `Maybe (case mapping) (default mapping)` or duplicate code? |
| 17:42:04 | <segfaultfizzbuzz> | and as my first attempt i am adding brick to a project via the cabal file |
| 17:42:17 | Benzi-Junior | fucked up |
| 17:42:21 | <segfaultfizzbuzz> | i also added vty after adding only brick but am continuing to get this dylib error |
| 17:43:39 | <geekosaur> | bytestring should have come with ghc |
| 17:43:49 | <geekosaur> | why are you building -dynamic anyway? |
| 17:44:09 | <segfaultfizzbuzz> | i literally don't know what i am doing here i just told cabal to make a new project |
| 17:44:49 | <segfaultfizzbuzz> | so i ran cabal init --interactive and then only added brick (and then vty) to the myproject.cabal file |
| 17:45:19 | <segfaultfizzbuzz> | i don't see a "-dynamic" option set anywhere at the moment,... |
| 17:45:52 | <segfaultfizzbuzz> | i'm guessing haskell doesn't really work on macos/m1 ..? |
| 17:46:56 | <geekosaur> | many people use it successfully |
| 17:47:09 | <segfaultfizzbuzz> | ok... anyway, i didn't type -dynamic myself at any point |
| 17:49:05 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 17:49:17 | → | qrpnxz joins (~qrpnxz@fsf/member/qrpnxz) |
| 17:49:32 | <geekosaur> | if you used ghcup to install ghc then I have to punt to maerwald because I can't imagine why either it defaulted to -dynamic or why the dynamic libs are missing |
| 17:49:53 | <segfaultfizzbuzz> | this is what my ghcup tui looks like: https://paste.rs/CDA |
| 17:50:05 | <Benzi-Junior> | so have a problem that essentially boils down to "least likely path" or to put it another way "shortest path in a probability space" so I decided to grab the search-algorthims package and use that ... once I start testing I realize I'm getting results that are above 1, because the search algorithm adds up rather than multiplying (of course), is anyone familiar with the search-algorithms package |
| 17:50:08 | <Benzi-Junior> | and sees an easier fix for me than copying the entire package contents to make the change ? |
| 17:52:59 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 255 seconds) |
| 17:53:26 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 17:54:48 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 17:54:56 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 17:56:37 | × | remedan quits (~remedan@octo.cafe) (Quit: Bye!) |
| 17:57:07 | → | odnes joins (~odnes@5-203-171-254.pat.nym.cosmote.net) |
| 17:57:37 | <geekosaur> | oh. do you have DYLD_LIBRARY_PATH set at all? |
| 17:58:07 | <segfaultfizzbuzz> | i'm not familiar with that, is that an LLVM or C or C/C++ on MacOS thing? |
| 17:58:15 | <geekosaur> | if so, stop it. it is not the same as Linux's LD_LIBRARY_PATH and will break things |
| 17:58:20 | <geekosaur> | it's a MacOS thing |
| 17:58:29 | <segfaultfizzbuzz> | yeah i'm not familiar with macos lol |
| 17:58:54 | <geekosaur> | and some people suggest setting it as if it were Linux's LD_LIBRARY_PATH, but it causes confusing breakage |
| 17:59:42 | <segfaultfizzbuzz> | i mean, export | grep DYLD shows nothing... |
| 17:59:44 | <geekosaur> | \anyway at this point I think I have to defer to maerwald, but I don't know if/when he'll be around |
| 17:59:47 | <geekosaur> | good |
| 17:59:48 | <akegalj> | I run into interesting implementation of breadth first search in haskell https://github.com/aaronallen8455/IHaskellNotebooks/blob/master/Breadth%20First%20Search.ipynb and in the second example there is some higher order function kungfu that confuses me. He defines function "let f (Node x xs) fw bw = x : fw (xs : bw)" which has nice expected type "Tree a -> ([Forest a] -> [a]) -> [Forest a] -> [a]" but |
| 17:59:54 | <akegalj> | later he does "foldl (foldr f) b qs []" which breaks my mind. So to check it I replaced Node with tupple and defined in my repl "let f (x:xs) fw bw = x : fw (xs : bw)" and asked for a type "f :: [a] -> ([[a]] -> [a]) -> [[a]] -> [a]". All seems good for now. Then I asked for ":t (foldr f)" and got "(foldr f) :: Foldable t => ([[a]] -> [a]) -> t [a] -> [[a]] -> [a]" . Can someone handhold and explain how |
| 18:00:01 | <akegalj> | `foldr f` got this type? |
| 18:00:16 | → | Hemmo joins (~IceChat95@2001:999:708:eb97:3d6e:5240:1496:7668) |
| 18:01:03 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 18:02:13 | × | kuribas quits (~user@ptr-17d51ep2y03n1mswpe5.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3)) |
| 18:03:03 | <Hemmo> | https://paste.tomsmeding.com/vcfoutjB : Is there a way to compare those two statements to eachother in a one liner? As in anything compared with Unk3 equals Unk3. Seems sort of verbose and I just thought if there's a way to do it otherwise? I tried || between, but eh. Didn't work! |
| 18:03:36 | → | remedan joins (~remedan@octo.cafe) |
| 18:05:06 | <qrpnxz> | Hemmo: no |
| 18:05:34 | <Hemmo> | qrpnxz: Thanks! |
| 18:05:56 | <qrpnxz> | well, you could put them in variables and do | a == Un || b == Un, but is that better? hendi |
| 18:05:59 | <qrpnxz> | Hemmo: |
| 18:06:30 | → | wonko joins (~wjc@2a0e:1c80:2::130) |
| 18:06:39 | <qrpnxz> | to me it seems worse |
| 18:06:45 | <Hemmo> | Yeah probably |
| 18:06:49 | <Hemmo> | Just a random thought, really ;D |
| 18:06:55 | <qrpnxz> | np |
| 18:06:57 | <Hemmo> | Functions well enough with my way =) |
| 18:08:22 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Ping timeout: 268 seconds) |
| 18:09:11 | × | nineonine quits (~nineonine@2604:3d08:7780:cd00:5cc0:4b6c:24b1:bf92) (Ping timeout: 255 seconds) |
| 18:10:13 | <qrpnxz> | a == b = not $ any (== Un) [a, b] |
| 18:10:15 | <qrpnxz> | lol |
| 18:10:29 | <qrpnxz> | if you had like 15 arguments this would be worth it |
| 18:10:58 | → | Tuplanolla joins (~Tuplanoll@91-159-69-12.elisa-laajakaista.fi) |
| 18:10:59 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 18:11:17 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 18:11:44 | → | Midjak joins (~Midjak@82.66.147.146) |
| 18:12:17 | × | segfaultfizzbuzz quits (~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 256 seconds) |
| 18:14:19 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 18:14:45 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 18:16:20 | → | SebastianM joins (~seba@user/sebastianm) |
| 18:17:46 | → | nschoe joins (~quassel@2a01:e0a:8e:a190:c21d:44a3:63e2:38ba) |
| 18:19:55 | <[Leary]> | akegalj: Understanding what's happening in that code might be difficult, but understanding how `foldr f` got its type shouldn't be; it's pretty much mechanical substitution from the type of `f`. Bear in mind that `b` in the type signature of `foldr` can be a function type. |
| 18:20:02 | <[Leary]> | % :t foldr |
| 18:20:03 | <yahb2> | foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b |
| 18:20:11 | <[Leary]> | % :t foldr (undefined :: a -> (c -> d) -> (c -> d)) |
| 18:20:11 | <yahb2> | foldr (undefined :: a -> (c -> d) -> (c -> d)) ; :: Foldable t => (c -> d) -> t a -> c -> d |
| 18:23:33 | × | hrberg quits (~quassel@171.79-160-161.customer.lyse.net) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 18:23:47 | → | hrberg joins (~quassel@171.79-160-161.customer.lyse.net) |
| 18:23:54 | × | vysn quits (~vysn@user/vysn) (Quit: WeeChat 3.5) |
| 18:26:06 | <akegalj> | [Leary]: ok that example clicked ... let me try to do the above step myself again |
| 18:26:53 | × | a6a45081-2b83 quits (~aditya@50.47.112.150) (Remote host closed the connection) |
| 18:27:20 | <qrpnxz> | seems to me that code could use a couple of comments :) |
| 18:28:39 | <qrpnxz> | btw also checkout https://hackage.haskell.org/package/containers-0.6.6/docs/Data-Graph.html the paper there deals with depth-first search |
| 18:29:49 | <akegalj> | [Leary]: thanks a lot - it clicked now |
| 18:29:52 | → | jgeerds joins (~jgeerds@55d46bad.access.ecotel.net) |
| 18:30:09 | <akegalj> | qrpnxz: thanks! |
| 18:32:08 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 255 seconds) |
| 18:32:37 | → | azimut_ joins (~azimut@gateway/tor-sasl/azimut) |
| 18:33:27 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 18:33:44 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds) |
| 18:34:06 | → | gmg joins (~user@user/gehmehgeh) |
| 18:37:23 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 248 seconds) |
| 18:38:46 | × | kmein quits (~weechat@user/kmein) (Quit: ciao kakao) |
| 18:39:07 | → | kmein joins (~weechat@user/kmein) |
| 18:40:15 | → | kannon joins (~NK@135-180-47-54.fiber.dynamic.sonic.net) |
| 18:40:21 | → | lyle joins (~lyle@104.246.145.85) |
| 18:41:03 | × | Hemmo quits (~IceChat95@2001:999:708:eb97:3d6e:5240:1496:7668) (Quit: Few women admit their age. Few men act theirs.) |
| 18:41:49 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 18:44:18 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:9182:8940:bd86:35ac) |
| 18:46:18 | → | fraznel joins (~fuag1@c-73-221-56-19.hsd1.wa.comcast.net) |
| 18:46:26 | <mrianbloom> | Is the Scrap Your Boilerplate with Class, style in wide use or is there a more modern approach? |
| 18:48:06 | <Rembane_> | mrianbloom: Is Generics the one you're thinking of? |
| 18:48:11 | × | ardell quits (~ardell@user/ardell) (Quit: Leaving) |
| 18:48:20 | <Rembane_> | mrianbloom: https://hackage.haskell.org/package/base-4.17.0.0/docs/GHC-Generics.html |
| 18:49:49 | <mrianbloom> | Rembane_: I'll give that a read through, thanks. |
| 18:50:05 | → | ardell joins (~ardell@user/ardell) |
| 18:50:27 | × | raym quits (~raym@user/raym) (Remote host closed the connection) |
| 18:51:15 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 18:52:19 | → | raym joins (~raym@user/raym) |
| 18:52:40 | <Rembane_> | mrianbloom: No worries. |
| 18:53:53 | <mrianbloom> | I think I'm looking more for the gmapQ type functionality described in the paper. Not sure if that's represented in the GHC.Generics framework. |
| 18:54:17 | × | SebastianM quits (~seba@user/sebastianm) (Quit: Bye) |
| 18:54:59 | × | kmein quits (~weechat@user/kmein) (Quit: ciao kakao) |
| 18:55:23 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 18:55:33 | → | kmein joins (~weechat@user/kmein) |
| 18:57:56 | <lyle> | Need help please with some code: https://paste.tomsmeding.com/aNgl5c8F |
| 18:58:15 | × | kmein quits (~weechat@user/kmein) (Client Quit) |
| 18:58:38 | <lyle> | The error is on the line "yield bs". Do I need to use unlift here or is my approach completely off the rails? |
| 18:59:10 | → | kmein joins (~weechat@user/kmein) |
| 18:59:47 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 248 seconds) |
| 19:00:50 | × | kmein quits (~weechat@user/kmein) (Client Quit) |
| 19:01:22 | × | Pickchea quits (~private@user/pickchea) (Quit: Leaving) |
| 19:01:49 | → | kmein joins (~weechat@user/kmein) |
| 19:03:03 | × | remedan quits (~remedan@octo.cafe) (Quit: Bye!) |
| 19:05:12 | × | nschoe quits (~quassel@2a01:e0a:8e:a190:c21d:44a3:63e2:38ba) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 19:06:14 | <geekosaur> | lyle, I think that can't be made to work, because you can't unlift out of State (nothing knows to carry the state around) |
| 19:07:13 | <lyle> | Ok, maybe an IOVar is a better approach than State? |
| 19:07:13 | → | tomboy64 joins (~tomboy64@user/tomboy64) |
| 19:08:19 | × | fserucas quits (~fserucas@89.214.149.93) (Ping timeout: 248 seconds) |
| 19:08:27 | <lyle> | Sorry, I should have said IORef. |
| 19:09:56 | × | kannon quits (~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 255 seconds) |
| 19:11:45 | <geekosaur> | it's not great but it'd work |
| 19:11:46 | <monochrom> | I wonder if it changes nothing: you can't unlift out of IO either. |
| 19:11:55 | <geekosaur> | hm, point |
| 19:12:13 | <geekosaur> | although if it's already in IO it shouldn't matter? |
| 19:12:27 | <monochrom> | Oh heh OK. |
| 19:12:52 | <geekosaur> | given that it's reading from Handles |
| 19:12:56 | <monochrom> | I forgot the "MonadIO m" part. |
| 19:13:23 | × | kmein quits (~weechat@user/kmein) (Quit: ciao kakao) |
| 19:13:51 | <lyle> | I have tried IORef but couldn't make it work I think because you create the IORef first to initialize it to 0, then start a loop but the IORef's variable isn't in scope inside the loop. |
| 19:14:01 | → | kmein joins (~weechat@user/kmein) |
| 19:14:34 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 19:14:43 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 19:16:30 | → | Haskelytic joins (~Haskelyti@37.111.201.4) |
| 19:17:27 | <lyle> | What I'll do is try the IORef approach again--I'll likely run into the same problem again and come back for more help. |
| 19:17:44 | <lyle> | Many thanks for having a look at this! |
| 19:17:49 | → | aeka joins (~aeka@user/hiruji) |
| 19:27:43 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:9182:8940:bd86:35ac) (Quit: WeeChat 2.8) |
| 19:28:18 | × | coot quits (~coot@213.134.176.158) (Quit: coot) |
| 19:38:46 | → | pavonia joins (~user@user/siracusa) |
| 19:40:56 | × | ardell quits (~ardell@user/ardell) (Read error: Connection reset by peer) |
| 19:41:13 | → | ardell joins (~ardell@user/ardell) |
| 19:42:09 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 19:48:24 | justache | is now known as justache_ |
| 19:48:31 | justache_ | is now known as justache |
| 19:49:48 | → | pdroman joins (~pedro@141.red-81-43-1.staticip.rima-tde.net) |
| 19:50:04 | ← | pdroman parts (~pedro@141.red-81-43-1.staticip.rima-tde.net) () |
| 19:52:32 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 19:57:06 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 256 seconds) |
| 19:57:23 | × | Haskelytic quits (~Haskelyti@37.111.201.4) (Quit: Client closed) |
| 19:58:56 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 20:00:24 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 20:02:19 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 20:03:51 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 20:06:32 | × | wonko quits (~wjc@2a0e:1c80:2::130) (Ping timeout: 244 seconds) |
| 20:06:39 | × | lyle quits (~lyle@104.246.145.85) (Quit: WeeChat 3.6) |
| 20:06:40 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 20:06:47 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 20:21:35 | → | instantaphex joins (~jb@c-73-171-252-84.hsd1.fl.comcast.net) |
| 20:22:10 | → | thelounge8164 joins (~thelounge@85.9.20.133) |
| 20:24:03 | × | ec quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
| 20:25:51 | × | thelounge8164 quits (~thelounge@85.9.20.133) (Quit: The Lounge - https://thelounge.chat) |
| 20:26:28 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 20:27:07 | × | aeka quits (~aeka@user/hiruji) (Ping timeout: 268 seconds) |
| 20:27:34 | → | aeka joins (~aeka@user/hiruji) |
| 20:30:41 | <qrpnxz> | lyle are you still in here |
| 20:31:24 | <qrpnxz> | it looks like they just needed to lift the yield into the StateT to me |
| 20:31:25 | → | wonko joins (~wjc@2a0e:1c80:2::130) |
| 20:33:22 | × | odnes quits (~odnes@5-203-171-254.pat.nym.cosmote.net) (Quit: Leaving) |
| 20:36:37 | → | CiaoSen joins (~Jura@p200300c95738a5002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 20:43:09 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 268 seconds) |
| 20:47:32 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 20:48:54 | × | wonko quits (~wjc@2a0e:1c80:2::130) (Ping timeout: 244 seconds) |
| 20:49:43 | × | fraznel quits (~fuag1@c-73-221-56-19.hsd1.wa.comcast.net) (Ping timeout: 252 seconds) |
| 20:51:38 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 20:53:12 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 20:53:22 | → | fraznel joins (~fuag1@c-73-221-56-19.hsd1.wa.comcast.net) |
| 20:55:36 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 20:56:47 | → | Rumham347 joins (~Rumham347@128-193-154-76.ptpg.oregonstate.edu) |
| 20:57:41 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 20:58:20 | → | remedan joins (~remedan@octo.cafe) |
| 21:01:43 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 21:02:13 | × | michalz quits (~michalz@185.246.204.72) (Remote host closed the connection) |
| 21:02:22 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 21:08:44 | × | remedan quits (~remedan@octo.cafe) (Read error: Connection reset by peer) |
| 21:09:37 | → | remedan joins (~remedan@octo.cafe) |
| 21:11:13 | × | chele quits (~chele@user/chele) (Remote host closed the connection) |
| 21:16:11 | × | remedan quits (~remedan@octo.cafe) (Read error: Connection reset by peer) |
| 21:16:36 | × | LambdaDu1k quits (~anka@ksit.fixme.fi) (Ping timeout: 268 seconds) |
| 21:16:42 | → | LambdaDuck joins (~anka@ksit.fixme.fi) |
| 21:17:04 | × | opqdonut quits (opqdonut@pseudo.fixme.fi) (Ping timeout: 268 seconds) |
| 21:17:12 | → | opqdonut joins (opqdonut@pseudo.fixme.fi) |
| 21:17:20 | → | remedan joins (~remedan@octo.cafe) |
| 21:17:35 | × | CiaoSen quits (~Jura@p200300c95738a5002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
| 21:18:49 | × | remedan quits (~remedan@octo.cafe) (Read error: Connection reset by peer) |
| 21:19:27 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 21:20:25 | × | acidjnk quits (~acidjnk@p200300d6e7137a36187ce24caf80a2df.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
| 21:20:28 | → | remedan joins (~remedan@octo.cafe) |
| 21:21:40 | → | nate4 joins (~nate@98.45.169.16) |
| 21:23:23 | → | segfaultfizzbuzz joins (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) |
| 21:26:39 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 256 seconds) |
| 21:35:36 | × | Natch quits (~natch@c-9e07225c.038-60-73746f7.bbcust.telenor.se) (Remote host closed the connection) |
| 21:52:00 | → | fserucas joins (~fserucas@89.214.149.93) |
| 22:05:27 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 22:07:57 | × | jinsun quits (~jinsun@user/jinsun) (Ping timeout: 244 seconds) |
| 22:08:14 | × | Rumham347 quits (~Rumham347@128-193-154-76.ptpg.oregonstate.edu) (Ping timeout: 252 seconds) |
| 22:09:34 | → | jinsun joins (~jinsun@user/jinsun) |
| 22:10:51 | × | remedan quits (~remedan@octo.cafe) (Ping timeout: 256 seconds) |
| 22:12:45 | → | causal joins (~user@2001:470:ea0f:3:329c:23ff:fe3f:1e0e) |
| 22:13:56 | → | remedan joins (~remedan@octo.cafe) |
| 22:14:39 | → | Natch joins (~natch@c-9e07225c.038-60-73746f7.bbcust.telenor.se) |
| 22:15:36 | → | Guest85 joins (~Guest85@2606:54c0:3960:a8::10e:48) |
| 22:15:42 | × | Guest85 quits (~Guest85@2606:54c0:3960:a8::10e:48) (Client Quit) |
| 22:17:49 | → | tvandinther joins (~tvandinth@2404:4408:8740:3800:950f:d0b3:e0d9:5195) |
| 22:20:07 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 22:20:38 | <tvandinther> | I sometimes get this error and I never really understand how to fix it. Using HLS in VS Code, I often get the language server failing 5 times in a row, and the output mentions something about hie.yaml not being found. I created the project using the default stack template, which I figure should work out of the box. I mainly just get this issue in |
| 22:20:38 | <tvandinther> | WSL, but on a Mac, it seems to not be an issue. What's going on here? |
| 22:23:34 | <geekosaur> | hie.yaml should generally be optional, but I've had to create it in a few cases to keep HLS from getting confused. |
| 22:23:57 | <geekosaur> | it is an HLS project description file |
| 22:24:07 | × | jinsun quits (~jinsun@user/jinsun) (Read error: Connection reset by peer) |
| 22:24:07 | <geekosaur> | (HLS grew out of HIE) |
| 22:24:22 | → | jinsun joins (~jinsun@user/jinsun) |
| 22:24:26 | × | mmhat quits (~mmh@p200300f1c7086024ee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
| 22:24:51 | <geekosaur> | that said, you might check to see if there are other errors than that |
| 22:25:24 | <geekosaur> | the cases where I've needed to create one, the actual errors were about not finding projects inside other projects (because they weren't supposed to be there) |
| 22:25:33 | <geekosaur> | maybe pastebin the full error log |
| 22:25:35 | <geekosaur> | @where paste |
| 22:25:36 | <lambdabot> | Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com |
| 22:25:46 | <geekosaur> | also try #haskell-language-server |
| 22:25:47 | × | remedan quits (~remedan@octo.cafe) (Ping timeout: 252 seconds) |
| 22:26:18 | × | jinsun quits (~jinsun@user/jinsun) (Read error: Connection reset by peer) |
| 22:26:34 | → | jinsun joins (~jinsun@user/jinsun) |
| 22:28:39 | → | remedan joins (~remedan@octo.cafe) |
| 22:32:18 | <tvandinther> | https://paste.tomsmeding.com/KA4CDRkl |
| 22:33:20 | <dmj`> | is there a type-level Read? given 'type Name = "Person"` can I get a `Person` from `data Person`, etc. |
| 22:33:22 | <tvandinther> | It also says something about ABIs dont match |
| 22:34:14 | <geekosaur> | yes, that's the real error |
| 22:34:39 | <geekosaur> | it correctly uses a built-in cradle because there's no hie.yaml |
| 22:34:48 | × | ccntrq quits (~Thunderbi@172.209.94.92.rev.sfr.net) (Ping timeout: 268 seconds) |
| 22:35:01 | <tvandinther> | Should I try upgrading ghc? |
| 22:35:26 | <geekosaur> | hm. is ghc installed from ghcup, or do you have a system ghc or bindist installed somewhere? |
| 22:36:31 | <tvandinther> | ghcup. I read somewhere (as of 3 months ago) that ghc has a known bug regarding this |
| 22:36:43 | <geekosaur> | the "ABIs don't match" means the HLS executable was built against a different ghc |
| 22:37:03 | <hpc> | dmj`: somewhere in TH probably? |
| 22:37:29 | → | mmhat joins (~mmh@p200300f1c70860b0ee086bfffe095315.dip0.t-ipconnect.de) |
| 22:37:35 | <geekosaur> | you might ask in #haskell-language-server. this isn't a ghc bug as such, it's just a ghc mismatch from what HLS expects |
| 22:37:42 | <geekosaur> | which could be HLS's fault |
| 22:37:48 | <tvandinther> | alright I'll ask over there. thanks |
| 22:39:13 | <dmj`> | hpc: Was hoping not to use any TH :/ ... I can get from Person to "Person" by way of GHC.Generics and some closed type families on `(C1 ('MetaCons name _ _) _) = name`. But I realized I'm actually interested in the opposite direction. |
| 22:39:56 | <geekosaur> | more to the point, there's a "haskell-language-server-wrapper" which is supposed to run the correct HLS binary for your ghc version and ABI |
| 22:40:06 | <geekosaur> | which it apparently isn't |
| 22:40:38 | <geekosaur> | dmj`, that sounds like singletons |
| 22:40:49 | <geekosaur> | or something involving it |
| 22:41:11 | <geekosaur> | I guess not literally singletons since that'd be a Symbol, not a String |
| 22:41:18 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 22:41:22 | <qrpnxz> | tvandinther: when it says about HLS failing many time in a row. It's either really actually broken, or if i know it actually should woork then i reload then windows a couple times. I have to restart HLS and/or reload window kinda often. Particularly if i change my dependencies, or move things around. |
| 22:41:23 | <geekosaur> | but you might well have to demote to promote or something |
| 22:46:22 | <dmj`> | I really don't think it's possible yet tbh ... but if it were we could do type-level parsing into haskell types. |
| 22:50:42 | → | off^ joins (~off@96.70.11.181) |
| 22:53:34 | <johnw> | How is HIE these days? I haven't checked for, oh, 6 years? |
| 22:53:51 | → | Rumham347 joins (~Rumham347@128-193-154-76.ptpg.oregonstate.edu) |
| 22:55:34 | <tvandinther> | Looking at the output of `ghcup list` I am a little bit confused. So there's a tag on ghc "hls-powered", does this mean I can only use these versions with HLS? Or can I set ghc to the latest version and HLS will work with it? |
| 22:56:11 | <geekosaur> | it means it comes with a suitable HLS |
| 22:56:46 | <geekosaur> | you may be able to build one for the latest ghc, although usually it takes HLS some time to catch up and 9.4.x has only been out for less than a week |
| 22:57:36 | <geekosaur> | and 9.4.1 had enough issues that they may have waited for 9.4.2, which came out yesterday |
| 22:58:15 | <tvandinther> | I see, so I should go to the latest hls-powered version for the easiest experience? |
| 22:58:40 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 22:58:42 | <sm> | johnw, I think HIE is no more, HLS is the replacement |
| 22:59:23 | <sm> | these days it's great, fragile but super useful |
| 22:59:38 | <geekosaur> | HLS grew out of HIE |
| 23:00:06 | <geekosaur> | there were 2 or 3 different haskell editor interface projects that combined forces a few years ago to make HLS |
| 23:00:21 | <geekosaur> | which is why HLS still uses hie.bios |
| 23:00:51 | × | jgeerds quits (~jgeerds@55d46bad.access.ecotel.net) (Ping timeout: 248 seconds) |
| 23:03:10 | → | kimjetwav joins (~user@2607:fea8:235e:b600:156b:fb3:e0c0:ae2) |
| 23:04:16 | <geekosaur> | tvandinther, if it wasn't clear from the ABI issue you came in here with, there has to be a specific HLS binary matching your GHC version and ABI. ghcup installs HLS binaries for the "hls-powered"-tagged ghcs it installs |
| 23:05:16 | <geekosaur> | if you can build your own HLS binary against a different ghc, you can copy it into the HLS binary directory or somewhere else where haskell-language-server-wrapper will find it |
| 23:05:38 | <tvandinther> | Should I be able to set matching versions through ghcup for both tools? I don't need the latest, just the latest stable one. |
| 23:05:58 | <geekosaur> | (HLS is kind of a wrapper for ghc itself, so it needs to match ghc pretty exactly in order to work) |
| 23:06:56 | × | immae1 quits (~immae@2a01:4f8:141:53e7::) (Quit: WeeChat 3.3) |
| 23:07:01 | <geekosaur> | that's wat the "hls-powered" tag is about. if a ghc version has that tag, then ghcup will install a matching HLS binary for that ghc |
| 23:07:05 | → | immae joins (~immae@2a01:4f8:141:53e7::) |
| 23:07:30 | × | Tuplanolla quits (~Tuplanoll@91-159-69-12.elisa-laajakaista.fi) (Quit: Leaving.) |
| 23:07:48 | <geekosaur> | or at least it's supposed to; it sounds like maybe it isn't in your case, or you have a different ghc somewhere (beware that stack likes to install its own ghcs which may not match the ghcup-installed one) |
| 23:08:09 | <geekosaur> | hm, in fact that may be your problem. try putting "system-ghc: true" in your stack.yaml |
| 23:08:33 | <tvandinther> | I did notice I had a ghc binary in `/usr/bin` which I removed |
| 23:09:02 | <geekosaur> | so stack doesn't install a different ghc that doesn't work with the ghcup-installed HLS, since stack doesn't currently install matching HLS binaries for its ghcs |
| 23:09:40 | <tvandinther> | for the vs code extension I specified to use ghcup versions in its settings too |
| 23:10:18 | <geekosaur> | but does your stack.yaml say that? that's what stack will lcare about, not what ghcup or vs code say |
| 23:11:11 | <tvandinther> | Right, well my stack.yaml only specifies a resolver URL and packages |
| 23:12:07 | <tvandinther> | And system-ghc option gives this error on the main module "Please ensure that ghcide is compiled with the same GHC installation as the project." |
| 23:12:41 | <geekosaur> | okay, so you need https://docs.haskellstack.org/en/v2.3.3/yaml_configuration/#system-ghc |
| 23:12:42 | → | wrengr joins (~wrengr@201.59.83.34.bc.googleusercontent.com) |
| 23:13:15 | <geekosaur> | hm, sounds like you may need to clear .stack-work |
| 23:13:31 | <dmj`> | johnw: o/ |
| 23:13:31 | <geekosaur> | since you shouldn't have a compiled project yet |
| 23:15:40 | <tvandinther> | Okay that seemed to work. Is the key line this? "In a Nix-enabled configuration, stack is incompatible with system-ghc: false." |
| 23:15:51 | <tvandinther> | Since I'm running in WSL |
| 23:16:43 | <geekosaur> | you shouldn't have nix enabled in that case (pretty sure nix doesn;t work in WSL yet?) and in any case you needed to set system-ghc to true for HLS to find the supported ghc version instead of stack's |
| 23:16:59 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 23:18:38 | <tvandinther> | Okay, I somewhat understand it. I find the whole ecosystem quite confusing but hopefully, I get to understand it fully eventually. |
| 23:20:03 | × | cyphase quits (~cyphase@user/cyphase) (Ping timeout: 248 seconds) |
| 23:20:24 | × | segfaultfizzbuzz quits (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) (Ping timeout: 268 seconds) |
| 23:21:32 | → | cyphase joins (~cyphase@user/cyphase) |
| 23:25:21 | → | segfaultfizzbuzz joins (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) |
| 23:27:20 | × | instantaphex quits (~jb@c-73-171-252-84.hsd1.fl.comcast.net) (Ping timeout: 256 seconds) |
| 23:28:29 | × | fserucas quits (~fserucas@89.214.149.93) (Ping timeout: 252 seconds) |
| 23:29:39 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 23:39:32 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection) |
| 23:40:54 | <segfaultfizzbuzz> | does the in-crowd use nix for their haskell install on macos? if so, is there a guide which Just Works (tm) ? |
| 23:41:21 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 23:41:32 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 23:47:27 | × | Midjak quits (~Midjak@82.66.147.146) (Quit: Leaving) |
| 23:52:58 | → | mvk joins (~mvk@2607:fea8:5ce3:8500::a1ec) |
| 23:53:10 | × | ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 268 seconds) |
| 23:54:34 | → | luffy joins (~chenqisu1@183.217.200.212) |
All times are in UTC on 2022-08-23.