Logs: liberachat/#haskell
| 2021-07-06 16:39:06 | → | alx741 joins (~alx741@181.196.69.147) |
| 2021-07-06 16:41:22 | × | nschoe quits (~quassel@2a01:e0a:8e:a190:b228:bdd7:be31:d4a6) (Ping timeout: 240 seconds) |
| 2021-07-06 16:42:09 | <safinaskar> | dsal: where it is not idiomatic? |
| 2021-07-06 16:42:18 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 2021-07-06 16:42:31 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Client Quit) |
| 2021-07-06 16:43:10 | <monochrom> | Each readSTRef and writeSTRef incurs more time cost than parameter passing. |
| 2021-07-06 16:43:49 | <safinaskar> | the slowest function is, of course, lowLevelTestAmbiguity, it takes O(exp(count)) time, it is for design (same is true for rust version) |
| 2021-07-06 16:44:30 | <safinaskar> | its slowest part is internal loop (in "(N nn):rest ->") |
| 2021-07-06 16:44:31 | → | yauhsien joins (~yauhsien@61-231-39-135.dynamic-ip.hinet.net) |
| 2021-07-06 16:45:39 | <monochrom> | I once helped a beginner convert a while-loop over "x <- readSTRef v; ... ; writeSTRef v (f x)" to recursion over "foo x = ... foo (f x)" and it became 2 times faster or 5 times faster or something like that. |
| 2021-07-06 16:45:54 | <safinaskar> | monochrom: latest git version ( https://git.sr.ht/~safinaskar/check-cfg-ambiguity/tree/8d6bd0b390f1ca0a607ab8e38117d5a8a26d7f7a/item/CheckCFGAmbiguity.hs ) don't use STRef operations inside inner loop |
| 2021-07-06 16:47:10 | <safinaskar> | monochrom: "Each readSTRef and writeSTRef incurs more time cost than parameter passing" - why? |
| 2021-07-06 16:47:13 | × | zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!) |
| 2021-07-06 16:47:30 | → | dunj3 joins (~dunj3@2001:16b8:30db:ce00:b825:b46d:5278:e0d1) |
| 2021-07-06 16:47:42 | <monochrom> | why not? |
| 2021-07-06 16:47:43 | → | themc47 joins (~mc47@xmonad/TheMC47) |
| 2021-07-06 16:47:59 | <monochrom> | For starters, it's immediately one more level of indirection. |
| 2021-07-06 16:48:08 | × | kayprish quits (~kayprish@cable-188-2-229-172.dynamic.sbb.rs) (Remote host closed the connection) |
| 2021-07-06 16:48:09 | <monochrom> | Did you take a computer organization course? |
| 2021-07-06 16:48:15 | <dsal> | This reads a bit like a direct translation from C (e.g., all the {}s and semicolons). It looks weird enough that I'm kind of confused as to what you think it's doing. Do you know what return does? |
| 2021-07-06 16:48:15 | <dolio> | It relates back to the 'not idiomatic' part. |
| 2021-07-06 16:49:15 | × | yauhsien quits (~yauhsien@61-231-39-135.dynamic-ip.hinet.net) (Ping timeout: 252 seconds) |
| 2021-07-06 16:49:18 | × | chele quits (~chele@user/chele) (Remote host closed the connection) |
| 2021-07-06 16:49:22 | × | mikail quits (~mikail@90.152.14.81) (Ping timeout: 240 seconds) |
| 2021-07-06 16:49:47 | <dolio> | Writing 'loops' as recursive functions with parameters is expected, and the compiler built to optimize those well. |
| 2021-07-06 16:50:21 | × | mc47 quits (~mc47@xmonad/TheMC47) (Ping timeout: 252 seconds) |
| 2021-07-06 16:50:24 | × | kuribas quits (~user@ip-188-118-57-242.reverse.destiny.be) (Quit: ERC (IRC client for Emacs 26.3)) |
| 2021-07-06 16:52:33 | × | chomwitt quits (~Pitsikoko@athedsl-16082.home.otenet.gr) (Ping timeout: 252 seconds) |
| 2021-07-06 16:53:26 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 2021-07-06 16:54:10 | nshepperd2 | finally pushes a cabal-static-3.4.0.0 AUR package |
| 2021-07-06 16:55:03 | <safinaskar> | dsal: "all the {}s and semicolons" - because i don't like haskell indentation rules |
| 2021-07-06 16:55:11 | × | themc47 quits (~mc47@xmonad/TheMC47) (Ping timeout: 252 seconds) |
| 2021-07-06 16:55:23 | <safinaskar> | dsal: they sometimes give results i don't like |
| 2021-07-06 16:56:22 | <safinaskar> | dsal: "Do you know what return does?" - i do. i know that it is not similar to "return" in rust/c++ |
| 2021-07-06 16:56:47 | <safinaskar> | dsal: this code works, it passes tests |
| 2021-07-06 16:58:06 | <safinaskar> | dolio: inner loop in latest git version is written in functional style, i. e. "map"s etc |
| 2021-07-06 16:58:07 | → | mikail joins (~mikail@90.212.77.3) |
| 2021-07-06 16:58:26 | <dsal> | It's not about whether the code works. You don't like aspects of it, but you also don't like some basic parts of Haskell, so you're asking people how to improve it, but it's a bit hard to follow. I asked about `return` because in some of your earlier code you had things like `if x then f else return(); expensiveThing` and it wasn't clear whether you knew `expensiveThing` would run. |
| 2021-07-06 16:58:46 | → | Deide joins (~Deide@wire.desu.ga) |
| 2021-07-06 16:58:46 | × | Deide quits (~Deide@wire.desu.ga) (Changing host) |
| 2021-07-06 16:58:46 | → | Deide joins (~Deide@user/deide) |
| 2021-07-06 17:01:11 | <safinaskar> | dsal: i know that "expensiveThing" will run. this letter my help to understand algorithm: https://mail.haskell.org/pipermail/haskell-cafe/2021-May/134006.html |
| 2021-07-06 17:01:54 | × | xff0x quits (~xff0x@2001:1a81:5361:2500:9aff:3f7d:a108:43b8) (Ping timeout: 252 seconds) |
| 2021-07-06 17:02:15 | <dsal> | It seems like if you used `Either` as your `TerminalOrNonterminal` a lot of things would be easier for you. There's a lot of heavy conversion code that looks like things you'd get for free with built-in types. e.g., all of `checkAmbiguity` seems like it should be one extra guard and ~four lines of binds. |
| 2021-07-06 17:02:22 | × | Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Quit: WeeChat 2.8) |
| 2021-07-06 17:02:29 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:cdb:cabc:a7c7:75c9) |
| 2021-07-06 17:02:39 | <dsal> | That, in particular, is not a performance problem, but it just looks like you're going out of your way to avoid language features. |
| 2021-07-06 17:02:42 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 2021-07-06 17:02:53 | → | xff0x joins (~xff0x@2001:1a81:5361:2500:809c:f58:ea4b:fa4b) |
| 2021-07-06 17:03:13 | <c_wraith> | this just in: Haskell is a bad language when you try! |
| 2021-07-06 17:03:17 | <qrpnxz> | lol just saw that function amazing |
| 2021-07-06 17:03:24 | → | ubert joins (~Thunderbi@p2e5a50e5.dip0.t-ipconnect.de) |
| 2021-07-06 17:03:36 | <qrpnxz> | he probably just don't know |
| 2021-07-06 17:04:37 | → | chomwitt joins (~Pitsikoko@2a02:587:dc0b:0:d8f7:cdfe:4658:bec4) |
| 2021-07-06 17:04:51 | <dsal> | `toGrammar` looks a bit like `traverse` |
| 2021-07-06 17:07:00 | → | hnOsmium0001 joins (uid453710@id-453710.stonehaven.irccloud.com) |
| 2021-07-06 17:07:46 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 240 seconds) |
| 2021-07-06 17:07:53 | × | aman quits (~aman@user/aman) (Quit: aman) |
| 2021-07-06 17:07:58 | <chris-the-slurpa> | does hackage have documentation for the standard library aswell? |
| 2021-07-06 17:08:23 | × | boxscape_ quits (~boxscape_@p4ff0ba7a.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 2021-07-06 17:08:27 | <chris-the-slurpa> | prelude |
| 2021-07-06 17:08:36 | <ahdyt> | https://hackage.haskell.org/package/base ? |
| 2021-07-06 17:09:02 | <monochrom> | I would prefer locally installed doc that comes with GHC. |
| 2021-07-06 17:09:28 | <ahdyt> | monochrom how do you access it? |
| 2021-07-06 17:09:51 | <monochrom> | There is always mismatch between the version you actually use and { the latest version on hackage, the version preferred by Google hits } |
| 2021-07-06 17:09:52 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 2021-07-06 17:09:56 | <chris-the-slurpa> | thx |
| 2021-07-06 17:10:08 | <monochrom> | You know where your GHC is on your disk? |
| 2021-07-06 17:10:11 | <chris-the-slurpa> | what's hoogle? |
| 2021-07-06 17:10:31 | <ahdyt> | it's on the same folder as GHC? |
| 2021-07-06 17:10:37 | <monochrom> | Yes. |
| 2021-07-06 17:10:44 | <ahdyt> | ok lemme check |
| 2021-07-06 17:10:57 | <ahdyt> | I'm not sure where's my ghc is, as I use nix. |
| 2021-07-06 17:11:06 | <ahdyt> | it's probably somewhere in nix store |
| 2021-07-06 17:11:17 | → | cuz joins (~user@38.140.58.234) |
| 2021-07-06 17:11:18 | × | pja quits (~pja@dsl-217-155-153-10.zen.co.uk) (Quit: WeeChat 3.0) |
| 2021-07-06 17:11:22 | × | favonia quits (~favonia@user/favonia) (Ping timeout: 240 seconds) |
| 2021-07-06 17:11:30 | <monochrom> | Actually ghc-pkg can help |
| 2021-07-06 17:12:07 | <monochrom> | ghc-pkg field base haddock-html |
| 2021-07-06 17:12:47 | <ahdyt> | that's what I mean |
| 2021-07-06 17:12:54 | <qrpnxz> | dsal, i couldn't do four lines of binds, but i got a much neater looking if else chain |
| 2021-07-06 17:13:24 | <ahdyt> | monochrom ghc-pkg field base haddock-html |
| 2021-07-06 17:13:24 | <ahdyt> | haddock-html: /nix/store/5rz5drij1a56n03sx0y28hnvpaa8z62w-ghc-8.10.4-doc/share/doc/ghc/html/libraries/base-4.14.1.0 |
| 2021-07-06 17:13:49 | <monochrom> | Now you can give it to your browser |
| 2021-07-06 17:13:53 | <dsal> | safinaskar: So like, you create an STRef that's a boolean. Then you run your whileM modifying and observing that effect. You read the bool you wrote within the loop and then when the loop is over, you read the bool again and convert it to another type and produce that. This is basically a fold, but with a lot of indirection. |
| 2021-07-06 17:14:01 | <ahdyt> | yeah I already open it, looks good monochrom |
| 2021-07-06 17:14:26 | × | shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 252 seconds) |
| 2021-07-06 17:14:32 | <safinaskar> | i think that even if i replace maps with strict hashmaps in my haskell code, the code still will be x5-x10 times slower than rust version. Simply because of omnipresence of singly-linked lists in haskell (and garbage collection) |
| 2021-07-06 17:14:36 | <qrpnxz> | https://termbin.com/i44b is what i got |
| 2021-07-06 17:14:37 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Quit: Lost terminal) |
| 2021-07-06 17:15:00 | × | Pickchea quits (~private@user/pickchea) (Ping timeout: 272 seconds) |
| 2021-07-06 17:15:19 | <qrpnxz> | made a little typo there oops |
| 2021-07-06 17:15:21 | <qrpnxz> | that's ok |
| 2021-07-06 17:15:44 | <safinaskar> | dsal: "It seems like if you used `Either` as your `TerminalOrNonterminal`" - TerminalOrNonterminal is exported to user. I intentionally use this type. So user don't need to remember what means "Left": terminal or nonterminal |
| 2021-07-06 17:15:57 | <qrpnxz> | safinaskar, if you were like actually folding those would probably all get fused |
| 2021-07-06 17:16:11 | <dsal> | qrpnxz: yeah, I think that's better, but if this were just using Either, you wouldn't need the whole bottom part. |
| 2021-07-06 17:16:17 | <dsal> | safinaskar: Haskell programmers are comfortable with Haskell idioms. |
| 2021-07-06 17:16:45 | <safinaskar> | all of `checkAmbiguity` seems like |
| 2021-07-06 17:16:49 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-07-06 17:17:17 | <safinaskar> | dsal: "it should be one extra guard" - you mean case guards? i don't like them |
All times are in UTC.