Logs: liberachat/#haskell
| 2021-06-01 13:24:54 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 264 seconds) |
| 2021-06-01 13:25:04 | × | mjs2600 quits (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) (Quit: ZNC 1.8.2 - https://znc.in) |
| 2021-06-01 13:25:18 | → | mjs2600 joins (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) |
| 2021-06-01 13:27:06 | × | fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Remote host closed the connection) |
| 2021-06-01 13:27:15 | → | fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) |
| 2021-06-01 13:28:04 | × | mjs2600 quits (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) (Client Quit) |
| 2021-06-01 13:28:19 | → | mjs2600 joins (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) |
| 2021-06-01 13:29:13 | → | AgentM joins (~agentm@pool-162-83-130-212.nycmny.fios.verizon.net) |
| 2021-06-01 13:29:23 | × | hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1) |
| 2021-06-01 13:29:49 | → | hendursaga joins (~weechat@user/hendursaga) |
| 2021-06-01 13:32:02 | → | arrowd joins (~arr@2.94.203.147) |
| 2021-06-01 13:32:04 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 2021-06-01 13:33:40 | → | chomwitt joins (~Pitsikoko@athedsl-20549.home.otenet.gr) |
| 2021-06-01 13:33:47 | → | niflce joins (~IceChat95@user/niflce) |
| 2021-06-01 13:35:34 | <boxscape> | Has anyone tried to make STG run on a GPU? |
| 2021-06-01 13:36:32 | → | fm joins (~fm@user/fm) |
| 2021-06-01 13:36:45 | <[exa]> | boxscape: but why |
| 2021-06-01 13:36:58 | <boxscape> | idle curiosity, mostly :) |
| 2021-06-01 13:37:08 | <[exa]> | GPUs are _terribly bad_ at that precise kind of computation |
| 2021-06-01 13:37:13 | <merijn> | boxscape: tbh, that sounds like a bad idea |
| 2021-06-01 13:37:23 | × | wonko quits (~wjc@62.115.229.50) (Quit: See You Space Cowboy..) |
| 2021-06-01 13:37:34 | <boxscape> | what is the part of STG that they are bad at? |
| 2021-06-01 13:37:37 | <[exa]> | pointers |
| 2021-06-01 13:37:41 | <boxscape> | Ah, I see |
| 2021-06-01 13:37:44 | <merijn> | Lots of pointers, lots of branches |
| 2021-06-01 13:37:55 | <[exa]> | "control flow" too |
| 2021-06-01 13:38:16 | <merijn> | Poor cache locality, no easy way to do latency hiding due to irregular control flow |
| 2021-06-01 13:38:33 | <boxscape> | okay |
| 2021-06-01 13:38:50 | <[exa]> | technically, it would be extremely interesting to do an experiment of STG vs. nursery in the shared memory |
| 2021-06-01 13:38:56 | <merijn> | boxscape: Basically, GPU memory is rather high latency (high bandwidth, but also high latency) |
| 2021-06-01 13:39:08 | × | shiraeeshi quits (~shiraeesh@109.166.57.115) (Quit: Leaving) |
| 2021-06-01 13:39:15 | <merijn> | boxscape: Which is not a problem if you can do latency hiding due to high levels of parallelism |
| 2021-06-01 13:39:17 | → | slowButPresent joins (~slowButPr@user/slowbutpresent) |
| 2021-06-01 13:39:30 | <[exa]> | but likely that's the same esoterism level of "interesting" as "you can do programming with drawing an interpretable bitmap" |
| 2021-06-01 13:39:37 | <merijn> | But the parallelism in current GPUs really wants regular access patterns/control flow, which STG doesn't really have |
| 2021-06-01 13:39:49 | <boxscape> | I see, that makes sense |
| 2021-06-01 13:41:05 | × | keutoi quits (~keutoi@157.48.91.62) (Ping timeout: 264 seconds) |
| 2021-06-01 13:41:08 | <bor0> | `(axiom1 (Var A) >>= \ax1 -> ruleSpec ax1 (Var A))` So I thought something like `ruleSpec <$> axiom1 (Var A) <*> Var A` would work, but not. I need to "lift"(?) the last Var A somehow? |
| 2021-06-01 13:41:50 | <boxscape> | it's more like you're lifting it when it shouldn't be lifted IIUC |
| 2021-06-01 13:42:00 | <bor0> | Or that :) |
| 2021-06-01 13:42:11 | <boxscape> | flip ruleSpec (Var A) <$> axiom1 (Var A) |
| 2021-06-01 13:42:12 | <boxscape> | does that work? |
| 2021-06-01 13:42:34 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 2021-06-01 13:42:43 | → | keutoi joins (~keutoi@157.48.91.62) |
| 2021-06-01 13:43:15 | <bor0> | With a join prepended, yeah. ghci evals True == (join $ flip ruleSpec (Var A) <$> axiom1 (Var A)) == (axiom1 (Var A) >>= \ax1 -> ruleSpec ax1 (Var A)) |
| 2021-06-01 13:43:49 | <bor0> | There's no unlift or something? `flip` seems to be specific,.. what if the argument was 3rd |
| 2021-06-01 13:44:10 | <boxscape> | right, I guess we're not really gaining anywhere here, it's just (axiom1 (Var A) >>= flip ruleSpec) |
| 2021-06-01 13:44:49 | <bor0> | I am happy with it as it is, unless it can look better :) |
| 2021-06-01 13:45:21 | <boxscape> | bor0 I don't think there's a nice way to unlift something at the moment, at least in base |
| 2021-06-01 13:45:21 | × | unyu quits (~pyon@user/pyon) (Quit: WeeChat 3.1) |
| 2021-06-01 13:45:43 | <boxscape> | flip is pretty specific , sometimes there isn't a better way than writing a lambda |
| 2021-06-01 13:45:45 | <boxscape> | e.g. |
| 2021-06-01 13:45:49 | <boxscape> | @pl f a b = f b a |
| 2021-06-01 13:45:49 | <lambdabot> | f = fix flip |
| 2021-06-01 13:45:55 | <boxscape> | eh wait I don't want fix |
| 2021-06-01 13:46:01 | <boxscape> | @pl f a b = g b a |
| 2021-06-01 13:46:01 | <lambdabot> | f = flip g |
| 2021-06-01 13:46:04 | <boxscape> | that's fine |
| 2021-06-01 13:46:20 | <boxscape> | @pl f a d e = g a b c d e f |
| 2021-06-01 13:46:20 | <lambdabot> | f = fix (flip (flip . (flip .) . flip (flip g b) c)) |
| 2021-06-01 13:46:27 | <boxscape> | that's definitely not fine, and a lambda is better |
| 2021-06-01 13:46:33 | <bor0> | Haha! |
| 2021-06-01 13:47:29 | <bor0> | That seems like a nice way to make a friendly coworker, if I ever get to write Haskell in production |
| 2021-06-01 13:47:41 | <boxscape> | true |
| 2021-06-01 13:47:47 | <flowz> | hi, haskell newbie with a quick question here. I need to create a tree structure with some special handling of the root node. I tried to encode my idea like the following "MWE": https://pastebin.com/bHdtkJvy . But it doesn't allow me to match the "inner" sum type that way. I haven't been able to figure out how to do so. Would need and appreciate a |
| 2021-06-01 13:47:47 | <flowz> | bit of help :) |
| 2021-06-01 13:49:13 | → | ystael joins (~ystael@user/ystael) |
| 2021-06-01 13:50:46 | → | pe200012 joins (~pe200012@119.131.208.84) |
| 2021-06-01 13:51:54 | <[exa]> | flowz: you either need to setup overloading, or have a second function for the "inner" tree |
| 2021-06-01 13:52:35 | <[exa]> | flowz: this kind of ad-hoc overloading a function for multiple types (as known from c++ and others) does not combine well with type inference, so haskell doesn't really support it |
| 2021-06-01 13:53:41 | → | jneira joins (~jneira@166.red-81-39-172.dynamicip.rima-tde.net) |
| 2021-06-01 13:53:42 | <flowz> | @[exa] thanks for the help, will go for secondary functions then. Though it may be possible someway like that and I just couldn't find the right syntax. |
| 2021-06-01 13:53:57 | <ski> | flowz : `data Tree = Root | Node' looks confused |
| 2021-06-01 13:54:22 | → | myShoggoth joins (~myShoggot@97-120-89-117.ptld.qwest.net) |
| 2021-06-01 13:54:46 | <[exa]> | flowz: you might not even need the whole second data structure, I'd go with one Tree structure for everything, and have 2 functions for root and non-root cases (and let the user call the root one always) |
| 2021-06-01 13:54:57 | <ski> | (hint, that declaration is entirely unrelated to the two earlier `data' declarations) |
| 2021-06-01 13:55:03 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-06-01 13:55:59 | <flowz> | @ski oh, good to know. @[exa] thanks for the tip, I'll probably have to rethink my approach |
| 2021-06-01 13:55:59 | <lambdabot> | Maybe you meant: wiki src ask |
| 2021-06-01 13:56:11 | <ski> | flowz : what are you trying to do ? |
| 2021-06-01 13:56:32 | <[exa]> | flowz: btw @ doesn't work for highlighting on IRC, the convention is to just write `nick:` :] |
| 2021-06-01 13:57:30 | × | haskman quits (~haskman@171.48.41.1) (Quit: Going to sleep. ZZZzzz…) |
| 2021-06-01 13:57:51 | <arrowd> | Speaking of STG, there are many posts on this matter in the Internet, but I haven't found any information on how STG gets mapped to machine instructions. |
| 2021-06-01 13:57:54 | → | chddr joins (~Thunderbi@31.148.23.125) |
| 2021-06-01 13:57:55 | <ski> | (from what you've said, i'd go with [exa]'s suggestion) |
| 2021-06-01 13:58:00 | <arrowd> | It isn't being interpreted, right? |
| 2021-06-01 13:58:07 | <flowz> | ski: basically I have to build a balanced tree from some input data and then output the tree in a given format. Choice of language is left to us, so I thought I might use haskell as an exercise (as the task seemed simple enough, and I recently started learning it) |
| 2021-06-01 13:58:21 | × | mattil quits (~mattil@airio.portalify.com) (Remote host closed the connection) |
| 2021-06-01 13:58:27 | × | pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.2-dev) |
| 2021-06-01 13:59:06 | × | Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
| 2021-06-01 13:59:36 | <boxscape> | arrowd https://www.microsoft.com/en-us/research/wp-content/uploads/1992/04/spineless-tagless-gmachine.pdf Chapter 9 is "Compiling the STG language to C" |
| 2021-06-01 13:59:40 | <boxscape> | page 52 |
| 2021-06-01 13:59:41 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 264 seconds) |
| 2021-06-01 13:59:43 | <ski> | flowz : and in what way is that related to handling the root differently ? |
| 2021-06-01 14:00:58 | <flowz> | the definition of the btree we are given the root only has 1 value and 2 childs, while all other nodes have /k/ values and /k+1/ childs. It's a weird definition of the balanced tree, haven't been able to find any other resources that define it like that |
| 2021-06-01 14:01:08 | <arrowd> | boxscape: The current GHC does not compile to C. AFAIK, that "registerization" thing is exactly what I'm looking for. |
| 2021-06-01 14:01:47 | <geekosaur> | in ghc, STG is compiled to Cmm which is compiled to assembly language or LLVM IR depending on backend |
| 2021-06-01 14:04:40 | <arrowd> | So, "registerization" is related to Cmm, not STG? |
| 2021-06-01 14:05:00 | <int-e> | flowz: that's restrictive (each node should allow up to 2k-1 children)... but the root is indeed a bit special in b-trees |
| 2021-06-01 14:05:20 | → | pe200012_ joins (~pe200012@218.107.17.245) |
All times are in UTC.