Logs on 2022-11-14 (liberachat/#haskell)
| 00:00:03 | <Rembane> | bobbingbob: ^^ |
| 00:00:45 | <bobbingbob> | what do folks think of this? https://pastebin.com/LzJBKBVa |
| 00:03:19 | <EvanR> | well it's been a while since I had to ask wtf homoiconicity even is, but that's probably not it because it's not a lisp |
| 00:04:00 | <geekosaur> | code and data have the same shape. haskell doesn't fit it |
| 00:04:30 | → | zmt01 joins (~zmt00@user/zmt00) |
| 00:04:39 | <EvanR> | we do have Show and Read which by default make data print out equal to code that creates the data |
| 00:04:47 | × | acidjnk quits (~acidjnk@p200300d6e7137a015d19df638f338baf.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 00:05:27 | <EvanR> | but there's always a reason anything but lisp can't satisfy it |
| 00:05:40 | <geekosaur> | you could say homoiconicity is when those are both id |
| 00:06:01 | × | forell quits (~forell@user/forell) (Ping timeout: 268 seconds) |
| 00:06:06 | <bobbingbob> | EvanR: alright lets forget that part. its not important. more important is im going to manipulate haskell from inside haskell by making a representation of haskell and then writing in the representation |
| 00:06:18 | <geekosaur> | lisp isn't necessarily the only thing that can theoretically satisfy it, it's just the only thing that practically satisfies it |
| 00:06:46 | <bobbingbob> | so basically i've started a very simplified haskell |
| 00:06:50 | <geekosaur> | in part because anything else that can satisfy it gets defined as a lisp 🙂 |
| 00:06:57 | <Axman6> | MAthematica IIRC is also an example... but it's just lisp with weird syntax |
| 00:07:07 | <bobbingbob> | no parsing because i'm using haskell types |
| 00:07:19 | <EvanR> | mathematica has a lot of syntactic sugar too |
| 00:07:30 | × | zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 240 seconds) |
| 00:07:33 | <geekosaur> | you never used interlisp, did you? |
| 00:07:55 | <bobbingbob> | when i'm satisfied with my abstract program i can then use it to generate the source representation |
| 00:08:24 | → | forell joins (~forell@user/forell) |
| 00:08:55 | <EvanR> | I never HEARD of interlisp |
| 00:09:27 | <EvanR> | bobbingbob, there is at least one library for working with haskell source as a data type |
| 00:09:43 | <EvanR> | other than GHC |
| 00:09:55 | <bobbingbob> | yes i know. but its been awhile since ive coded and ive always had trouble with focus |
| 00:10:03 | <bobbingbob> | so this is programming practice for me |
| 00:10:19 | <bobbingbob> | so im bootstrapping basically |
| 00:10:46 | <EvanR> | your Expression type probably needs at least Variables |
| 00:10:51 | <bobbingbob> | i don't know how to assimilate so much information so ive realized what i need to do is create a source code browser |
| 00:11:09 | × | chomwitt quits (~chomwitt@2a02:587:7a0a:c00:1ac0:4dff:fedb:a3f1) (Ping timeout: 256 seconds) |
| 00:11:22 | <EvanR> | a browser? Like, a GUI? |
| 00:11:28 | <bobbingbob> | i realise it is very hard to visualise graphs of programs as big as gcc and ghc but i want to |
| 00:11:40 | geekosaur | wonders if it's worth pointing at manatee, or if that's too bitrotted now |
| 00:12:07 | <geekosaur> | I think it's like a decade old at this point |
| 00:12:48 | <EvanR> | as far as I'm concerned manatee was dark magic |
| 00:13:56 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:c87d:35ff:3ab7:8a28) (Remote host closed the connection) |
| 00:16:25 | → | perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
| 00:17:00 | <bobbingbob> | it looks cool. i will look at it. reading practise |
| 00:17:22 | → | xcmw joins (~textual@50.93.222.82) |
| 00:17:23 | <bobbingbob> | using other people code practise. im always trying to start from square one |
| 00:17:29 | × | Igloo quits (~ian@matrix.chaos.earth.li) (Ping timeout: 255 seconds) |
| 00:18:08 | <geekosaur> | huh |
| 00:19:51 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 00:21:45 | <bobbingbob> | geekosaur: i mean i don't like any of the guis so i'm always trying to make one. i want to create an visual editor for haskell |
| 00:22:16 | <geekosaur> | sorry, the "huh" was unrelated |
| 00:22:49 | <EvanR> | bobbingbob, what GUI technology would you use |
| 00:23:04 | <EvanR> | manatee was using GTK |
| 00:23:18 | → | Igloo joins (~ian@matrix.chaos.earth.li) |
| 00:23:44 | <geekosaur> | specifically gtk2hs. there's also gi these days |
| 00:24:02 | <geekosaur> | there was a quasi-functional thing based on Qt at some point |
| 00:24:14 | <geekosaur> | if you really want to get daring, there's reflex-platform |
| 00:25:17 | <bobbingbob> | i tried to install obleisk but got install errors i don't understand so im going to use sdl for the time being, then opengl/vulkan or something in a long while |
| 00:26:28 | <bobbingbob> | i will do another paste of the gui i have at the moment but it too is a work in progress |
| 00:26:56 | <bobbingbob> | both the gui and the debugger are meant to be really simple and basic |
| 00:27:19 | → | bilegeek joins (~bilegeek@2600:1008:b064:c747:f92e:461d:82e7:f3a1) |
| 00:27:44 | <bobbingbob> | i do plan to use other peoples work but i need to work out how to get a handle on the complexity of all the source i want to read/know something about |
| 00:28:25 | <EvanR> | you're basically lt barclay in "The Nth Degree" when he says, I need a better interface |
| 00:28:45 | <EvanR> | unfortunately there's no holodeck... |
| 00:29:19 | <bobbingbob> | like i want to have a good grasp of ghc compile process, good grasp of how things work at the linking level, good grasp of git/emacs |
| 00:29:21 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 00:29:21 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 00:29:21 | → | wroathe joins (~wroathe@user/wroathe) |
| 00:29:42 | <bobbingbob> | i could keep going on and on and i just don't know how to take it in |
| 00:30:02 | <EvanR> | there are a lot of existing tools that print out the intermediate / final forms of all that stuff in a way that can be actually read |
| 00:30:27 | <bobbingbob> | concurrency/parallelism, optimizing, big O, so much math and on forever ... |
| 00:32:10 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 240 seconds) |
| 00:32:18 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 00:34:09 | <monochrom> | This is why a university CS program takes 3-4 years. |
| 00:34:40 | <monochrom> | And yet that's already near-optimal because the order of the courses are carefully laid out. |
| 00:35:06 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 268 seconds) |
| 00:35:27 | <monochrom> | Someone did the dependency chasing for you and presents a build plan, and it's time-proved. |
| 00:36:02 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 00:36:31 | <monochrom> | That's the value of university structured education, compared to "I learn everything from the internet". |
| 00:36:37 | <monochrom> | At least for most people. |
| 00:43:05 | → | adium joins (adium@user/adium) |
| 00:43:20 | <hpc> | "someone did the dependency chasing for you" is a good way to put it |
| 00:43:40 | <bobbingbob> | monochrom: yeah problem is focus. dry material just turns my brain off. im learning to treat it the way i was taught to do meditate. when you lose focus put it back in place |
| 00:45:46 | <monochrom> | And then there is brilliant.org, which is the opposite of dry. |
| 00:46:18 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 00:46:18 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 00:47:18 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 00:50:49 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 256 seconds) |
| 00:54:13 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
| 00:54:48 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 00:58:36 | <bobbingbob> | monochrom: oh cool! thanks for sharing that |
| 00:59:46 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 268 seconds) |
| 01:02:10 | × | xff0x quits (~xff0x@2405:6580:b080:900:dd4a:69df:2709:8d37) (Ping timeout: 240 seconds) |
| 01:02:56 | × | Natch quits (~natch@c-9e07225c.038-60-73746f7.bbcust.telenor.se) (Ping timeout: 246 seconds) |
| 01:06:15 | <SrPx> | quick question: why aren't you hyping this? https://twitter.com/VictorTaelin/status/1591959427363573767 |
| 01:06:18 | <SrPx> | you should! |
| 01:08:21 | <Axman6> | Probably because most of us have no idea how it relates to real programs |
| 01:08:47 | <Axman6> | it sounds interesting, but it's definitely not going to speed things up in the real world by 9x |
| 01:09:34 | <Axman6> | it's also unclear how it plays with others - how much Haskell is supported? can I do FFI calls? how does memory management work? |
| 01:11:07 | <SrPx> | Axman6: what would convince you it applies to the real world? |
| 01:11:19 | <SrPx> | that's a sorting algorithm |
| 01:11:20 | → | czuberion[m] joins (~czuberion@2001:470:69fc:105::2:bc47) |
| 01:11:29 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 268 seconds) |
| 01:11:31 | <Axman6> | automatic parallelisation is something that's been tried plenty of times, and rarely actually performs well, you need to know more about what your program does than the compiler can usually infer |
| 01:11:36 | <Axman6> | SrPx: can it run GHC? |
| 01:12:19 | <SrPx> | not until we have a Core->GHC compiler, and that'll only happen if the community shows enough interest to fund the tech. chicken and egg |
| 01:12:40 | <Axman6> | that might be irrelevant if I can call code for HVM from Haskell cheaply, then I can run the things that it does well using it, and everything else with a normal GHC compiled program |
| 01:13:32 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 01:13:35 | <SrPx> | Axman6: yep that is very achievable. it is already possible on Rust, with a little effort. we could add a rich interop with Haskell in little time, but we'd need someone to maintain it |
| 01:14:27 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:c87d:35ff:3ab7:8a28) |
| 01:14:47 | <SrPx> | the criticism used to be that inets had no real-world application because λ-encodings are niche, so I went all the way to build HVM and benchmark on real-world algorithms. the next version parallelizes basically any sorting algorithm, precisely to make a point that it does generalize to basically anything you write |
| 01:15:04 | <SrPx> | here is a draft of that: https://github.com/Kindelia/HVM/blob/master/guide/PARALLELISM.md |
| 01:16:13 | × | poscat quits (~poscat@2408:8206:4823:fd6f:98ab:5c38:136c:5932) (Quit: Bye) |
| 01:16:27 | → | poscat joins (~poscat@114.245.106.84) |
| 01:16:36 | → | nate4 joins (~nate@98.45.169.16) |
| 01:16:41 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 01:17:31 | → | eggplant_ joins (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) |
| 01:17:59 | <Axman6> | I wish we'd stop calling the functional quicksort quicksort, it uses some similar ideas but kinda misses one of the fundamental properties, that it's in place and requires no allocation ("we" = the whole FP community) |
| 01:18:30 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:c87d:35ff:3ab7:8a28) (Ping timeout: 240 seconds) |
| 01:21:07 | <monochrom> | Unpopular opinion: I wish we'd stop emphasizing that as a difference. |
| 01:21:53 | <dolio> | So, what's you're alternate name for, "use the exact same algorithmic strategy as quicksort, but it needs to be called something else anyway"? |
| 01:21:58 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 268 seconds) |
| 01:21:59 | × | eggplant_ quits (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) (Ping timeout: 256 seconds) |
| 01:22:43 | × | ygsjg quits (~quassel@189.124.224.160) (Quit: No Ping reply in 180 seconds.) |
| 01:22:49 | <Axman6> | imma call it partitionsort |
| 01:23:10 | <maerwald[m]> | Algorithms are hard in FP |
| 01:23:26 | <SrPx> | Axman6: I kind of agree, kind of disagree. why requiring allocation should be a relevant factor to be worth pointing? yes, it is slow, but it doesn't need to be. I believe HVM will brute-force its way into making pure functional algorithms (with a lot of allocation) faster than mutable algorithms, given enough cores |
| 01:24:01 | <SrPx> | I mean once we have CPUs with 65536 cores, I find it hard to believe single-threaded procedural algorithms will stand a chance against what HVM is doing |
| 01:24:36 | <maerwald[m]> | Speculation |
| 01:24:41 | → | ygsjg joins (~quassel@189.124.224.160) |
| 01:25:16 | <SrPx> | yes. I could be wrong, who knows? yet it is so clearly worth a shot. I wish we could compile GHC-Core to HVM, optimize it and take Haskell to a new level |
| 01:26:13 | <maerwald[m]> | SrPx: performance doesn't seem like a primary priority for GHC |
| 01:27:11 | <maerwald[m]> | Look at Go. The reason they rejected so many language features is not that they don't like them, but that they don't know how to implement them without additional cost |
| 01:27:26 | <Axman6> | " This made the runtime 50x (!) faster" I want to know why the previous implementation was so bad! |
| 01:27:53 | <Axman6> | s/bad/slow |
| 01:29:51 | <SrPx> | Axman6: what do you mean? |
| 01:29:54 | <SrPx> | 50x faster? |
| 01:30:01 | <Axman6> | I'm reeading https://github.com/Kindelia/HVM/blob/master/guide/HOW.md |
| 01:30:06 | <dolio> | So, my question is: how have you solved the pitfalls of previous attempts to automatically parallelize functional code? |
| 01:31:00 | <SrPx> | Axman6: ah, before HVM people implemented interaction nets in really inefficient ways (including myself) |
| 01:31:27 | <SrPx> | it took a while to realize how to represent nodes in a memory efficient way, and that impacts all the rest |
| 01:32:44 | <Axman6> | there's no support for floating point in the language? that seems surprisingly limiting, particularly when one of the main types of code people want to parallelise is numeric node - is that a feature that's planned? |
| 01:32:49 | <SrPx> | there is! |
| 01:32:54 | <SrPx> | just merged on master, 2 days ago :) |
| 01:33:09 | <Axman6> | great - that doc above needs updating then :P |
| 01:33:53 | <SrPx> | there aren't many people working on it, so things move at a single-man pace. there is SO MUCH to improve. so many low hanging fruits. I really think you should appreciate how this thing is even competitive with a GHC at all, the amount of time and investment it received is 2 orders of magnitude larger |
| 01:34:00 | <SrPx> | Axman6: yep lol |
| 01:34:57 | <SrPx> | dolio: the HOW.md doc that Axman6 linked answers that question, and it is kinda sad that previous attempt made people skeptical of the idea, but trust me, it is different now ™ |
| 01:35:15 | <SrPx> | dolio: the short answer is that HVM replaces references entirely by a lazy duplication primitive |
| 01:35:46 | <SrPx> | so, that's right, there are no references in the language. like, at all. everything is linear and only exists in one place at once |
| 01:36:26 | <Axman6> | I wish there were types in the code examples, particularly since the function/rule syntax is the same as constructor syntax, it's hard for me to understand what any of the code is actually doing |
| 01:37:07 | <SrPx> | that makes parallelism extremely simpler, because communication and synchronization is minimized |
| 01:37:32 | <SrPx> | Axman6: let me know what code was hard to understand and why, I'll work on improving it |
| 01:37:37 | <dolio> | I've read that before, and it doesn't address my question at all, from what I recall, especially since the section on parallelism is "[TODO]". |
| 01:38:02 | <SrPx> | dolio: there is a TODO there? I should probably redirect it to https://github.com/Kindelia/HVM/blob/master/guide/PARALLELISM.md which I'm currently writing |
| 01:38:40 | <SrPx> | this is more a guide on how to develop parallel algorithms than an explanation on why it is supposed to work, though. yes I definitely should add that kind of info on HOW.md |
| 01:39:11 | <Axman6> | "as been widely regarded as the hardest problem of the 21st century" seems a bit hyperbolic - or possibly the most hyperbolic thing ever said! :P |
| 01:39:19 | → | Natch joins (~natch@c-9e07225c.038-60-73746f7.bbcust.telenor.se) |
| 01:39:54 | <SrPx> | Axman6: ah that was meant to be a joke, but I don't like the tone of this doc either. I plan to completely tone it down when I have the time, make it more serious |
| 01:40:06 | <SrPx> | there is just so much to do and I'm so little |
| 01:40:12 | <Axman6> | :thumbsup: |
| 01:40:51 | <SrPx> | btw is the functional bitonic sort algorithm on the PARALLELISM.md link above known? |
| 01:41:22 | <SrPx> | I couldn't find anything on google, and then realized it can be implemented in such a simple elegant way |
| 01:41:40 | <Axman6> | not sure I agree with the example that talks about laziness, since is basically all implementations of laziness, when something is given a name, it will usually only be evaluated once, and the expression 2*2 has the name x inside foo |
| 01:41:54 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 01:42:08 | <Axman6> | SrPx: I struggled to understand how it worked, so I couldn't tell you |
| 01:42:10 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 240 seconds) |
| 01:42:11 | × | califax quits (~califax@user/califx) (Ping timeout: 255 seconds) |
| 01:42:23 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 01:42:48 | × | Guest75 quits (~Guest75@178.141.177.81) (Ping timeout: 260 seconds) |
| 01:43:00 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 01:43:16 | <dolio> | And benchmarks of a few algorithms aren't the same as citing previous work, why it didn't work out in practice, and proving that those problems have been solved. Like, I have no reason to believe that quicksort wouldn't have also been really good with whatever people tried 20 years ago. |
| 01:43:17 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 01:43:19 | <SrPx> | Axman6: the point is that if you do not optimize it that way, you'll have wasted work, so that you then realize that the optimization doesn't cover all cases (i.e., it fails to share work under lambdas). thus, we need other way to avoid that, which is what lazy dups do, and it covers all cases |
| 01:43:46 | <SrPx> | dolio: I see what you mean. |
| 01:43:50 | → | califax joins (~califax@user/califx) |
| 01:43:59 | × | ec_ quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds) |
| 01:45:28 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 01:51:10 | × | bobbingbob quits (~bobbingbo@2604:3d09:207f:f650::b469) (Ping timeout: 240 seconds) |
| 01:52:17 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) |
| 01:52:47 | → | xff0x joins (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) |
| 01:53:59 | × | beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 260 seconds) |
| 01:55:14 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 01:55:37 | <sm> | SrPx: as always it sounds super exciting, thanks for your work. Most of us have learned to be cautious of (in your words) "hype", and to wait for some kind of concrete practical-in-the-real-world result |
| 01:56:10 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 01:56:14 | <sm> | I mean in general, not your work specifically |
| 01:56:36 | <sm> | sounds like it's getting closer.. ? 🚀 |
| 01:58:00 | <maerwald[m]> | sm: Haskellers are not hype driven? 😂 |
| 01:58:08 | <maerwald[m]> | Come on |
| 01:58:21 | <sm> | heck no, we know how long good things take by now |
| 01:59:50 | <maerwald[m]> | I think Haskellers are just used to awful performance, that's why |
| 02:00:26 | → | number11 joins (~number11@cpe-75-80-181-36.san.res.rr.com) |
| 02:01:25 | × | Tuplanolla quits (~Tuplanoll@91-159-68-194.elisa-laajakaista.fi) (Quit: Leaving.) |
| 02:02:03 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 268 seconds) |
| 02:06:19 | <SrPx> | sm: but the hype is needed to fund the idea :p if I fail to raise any dime I'll have to stop, which will be a little sad, since I truly believe this has a huge potential to make many things better, specially for the FP community |
| 02:07:51 | <SrPx> | I'll be talking with some VCs next week. I hope someone shares my vision |
| 02:16:16 | <Axman6> | I'nm reading through the explanation of constructor duplication - why is the end result a pair? There were no pairs in the original expression |
| 02:17:33 | <Axman6> | I also can't see how something that copies the irst element of an n element list n times could be optimal - is there heaps of memory being used here? |
| 02:19:01 | <Axman6> | "That was a lot of info. Hopefully, by now, you have an intuition about how the lazy duplication primitive works." Sadly no, I'm actually more confused now I've read it, maybe I just don't understand the syntax that's being used to explain evaluation? |
| 02:19:13 | <maerwald[m]> | SrPx: did you talk to HF? |
| 02:19:20 | <SrPx> | HF? |
| 02:19:39 | <maerwald[m]> | Haskell Foundation |
| 02:20:01 | <SrPx> | Axman6: ah, I'm sorry, I guess then I didn't do a great job at explaining it :( I did my best but being pedagogical is hard |
| 02:20:22 | <SrPx> | maerwald[m]: ah, no. should I? |
| 02:20:33 | <SrPx> | I didn't talk to anyone yet really, I'll be starting this week |
| 02:20:39 | <maerwald[m]> | SrPx: if you think this is relevant to Haskell, then yes |
| 02:20:54 | <maerwald[m]> | Contact David the CEO directly |
| 02:21:35 | <SrPx> | I think it is the most important thing that could ever happen to Haskell :p |
| 02:21:41 | <SrPx> | maerwald[m]: I'll give it a shot |
| 02:23:21 | <Axman6> | one problem I'm having understanding all this is I have absolutely no idea what's happening on either the CPU nor in memory, let alone how it solves the problems the others have run into over the years |
| 02:23:40 | <Axman6> | if you're tlaking to VCs who have any CS background, you'll need to have answers to those questions |
| 02:23:40 | <maerwald[m]> | SrPx: the CEO is technical enough that he might have an opinion about it even |
| 02:24:18 | → | youziqi joins (~youziqi@103.37.140.19) |
| 02:24:47 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 260 seconds) |
| 02:24:56 | → | [_] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 02:25:33 | <SrPx> | Axman6: I have all the answers to all these questions, I'm absolutely confident that the HVM has the potential to completely disrupt the entire tech industry. convincing people of that is the hardest part. understanding people is even harder. some people want in deep tech explanations. other want simpler ELI5s. other just want to know how I'm supposed to turn a compiler-ish thing into a business. other don't care and just want a crypto to pump |
| 02:25:38 | <SrPx> | in depth* |
| 02:26:07 | <SrPx> | maerwald[m]: I assume that if they liked the idea they'd have approached me though, but I'll try. costs nothing |
| 02:27:42 | <davean> | bitonic sort is a sorting network and hence inherently functional. It is well know but generally performs horribly. |
| 02:28:10 | <davean> | SrPx: Its real purpose is usually really wide systems, like GPUs where communication is expensive |
| 02:29:08 | <SrPx> | davean: is the functional algorithm that I wrote known though? i.e., this one: https://github.com/Kindelia/HVM/blob/master/examples/sort/bitonic/main.hs |
| 02:29:29 | <SrPx> | I wasn't aware since it doesn't use any kind of immutable map or indexing, just a tree that it swaps over and over |
| 02:29:39 | <SrPx> | it parallelizes really well on HVM, near linear speedup |
| 02:30:13 | <SrPx> | but yes, it is a little bit on the heavy side compared to radix sort |
| 02:33:43 | <davean> | SrPx: well, it would take me a bit to be sure it maps exactly 1-to-1 to a standard one |
| 02:34:06 | <davean> | It sure looks like it though? This sort of thing is usually only used on GPUs though (or massive distributed systems - see penny sort) |
| 02:34:30 | ← | number11 parts (~number11@cpe-75-80-181-36.san.res.rr.com) () |
| 02:34:34 | <SrPx> | yep I know, it is really good on the GPU since it is just distant swaps that can be performed in parallel |
| 02:34:40 | <davean> | Sorting is REALLY well studied, so i'm not sure "uknown" is a very interesting question though |
| 02:35:33 | <SrPx> | davean: yes I know, just wondering if someone ever had the motivation to write a pure functional version of it like that |
| 02:35:49 | <SrPx> | since other than HVM it would be kinda pointless |
| 02:36:12 | → | TonyStone joins (~TonyStone@cpe-74-76-57-186.nycap.res.rr.com) |
| 02:38:00 | <davean> | well like http://svenssonjoel.github.io/writing/lic.pdf has bitonic and Odd-Even merge. Is that close enough for you? Thats a personal decision |
| 02:38:30 | <Axman6> | SrPx: there are several links to runtime.c, that all 404, btw |
| 02:38:34 | <SrPx> | davean: no, because it uses array and array indexing |
| 02:38:46 | <SrPx> | Axman6: oh thank you. well runtime.c doesn't exist anymore |
| 02:38:52 | <SrPx> | I'll fix these |
| 02:39:14 | <davean> | SrPx: Ok, why does that matter for you? |
| 02:39:21 | <davean> | This is what makes it hard to answer |
| 02:42:18 | <SrPx> | davean: that matters a lot because arrays and mutability don't mix very well with pure functional languages. For example, there are no arrays on the λ-calculus, and if you're trying to minimize the number of beta-reductions, emulating arrays will give you a 100x-200x penalty upfront, and adding arrays natively will make parallelism impossible (HVM doesn't have mutable arrays) |
| 02:42:24 | <SrPx> | not impossible, harder* |
| 02:42:41 | <davean> | SrPx: Arrays mix great. Did you see mutation in there? |
| 02:43:02 | <davean> | The naive λ-calculus is not the core of what is |
| 02:43:51 | <sm> | SrPx: I hear you. But oh boy VCs.. well that's another approach |
| 02:43:53 | <davean> | A lot of functional things build new arrays to do sorts |
| 02:44:36 | <SrPx> | okay the point I'm making is, suppose you implement array in a pure functional style (i.e., no mutability) |
| 02:44:51 | <davean> | Ok, completely normal |
| 02:44:56 | <davean> | Normal haskell there |
| 02:45:08 | <davean> | We're in the absolute normal case now |
| 02:45:11 | <SrPx> | every time you index it, you'll need to make a bunch of pattern-matches, right? for example, if it is a populated binary tree with depth 32, you'll need at least 32 pattern-matches to access a number |
| 02:45:26 | <davean> | No, you don't |
| 02:45:34 | <davean> | You can still have an actual array |
| 02:45:49 | <davean> | https://www.haskell.org/onlinereport/haskell2010/haskellch14.html#x22-20100014 |
| 02:46:15 | <davean> | Its part of the Haskell Report |
| 02:46:31 | <davean> | You can still have contiguous memory of thunks |
| 02:46:59 | <davean> | and if you look at the "c" generated by the paper I linked you you'll see it has input* and output* |
| 02:47:04 | <davean> | it reads from input and writes to output |
| 02:47:17 | <davean> | It feels like your base assumptions are off here |
| 02:47:39 | <SrPx> | yes I know, the point is that Array can't be expressed with algebraic datatypes alone, it must be a primitive that does memory indexing. Haskell provides such primitive, but not everything does. raw type theory doesn't have such a thing, the lambda calculus neither, etc. etc. -- I'm not saying arrays are bad (they're great!), just that there are some environments where you don't have them |
| 02:49:05 | <davean> | Ok, sure, I suppose. You have to be in a pretty esoteric enviroment to not have them though. |
| 02:50:00 | <SrPx> | I mean, you can call it that, but disabling array enables other things, for similar reasons people promote immutability in Haskell :) |
| 02:50:21 | <davean> | What do you think it enables specificly? |
| 02:50:40 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 02:51:25 | <SrPx> | beta-optimality, parallelism! someone asked how HVM is able to parallelize automatically when other attempts failed, and that's the answer: it sacrifices things. mutable arrays are one of these things. not having mutable arrays mean two threads can't communicate directly, which lets you make strong assumptions on the compiler/runtime side, which is ultimately what makes automatic parallelism possible |
| 02:52:13 | <SrPx> | (it was dan I believe) |
| 02:52:22 | <davean> | Ok, but we never talked about *mutable* arrays here |
| 02:52:30 | <davean> | we only talked about *pure* arrays |
| 02:53:03 | <davean> | and arrays are the classic basis of automatic parallelization |
| 02:53:27 | <davean> | Even C can do automated parallelism on array |
| 02:53:40 | <davean> | even *with* mutation |
| 02:54:46 | <SrPx> | hm I'm afraid you can't automatically parallelize a thread that is mutating a shared array in parallel |
| 02:55:29 | <davean> | The standard C compilers take a single thread that is mutating an array and parallelize it usually |
| 02:55:32 | <SrPx> | without introducing unnecessary sequentialism, I mean |
| 02:55:44 | <davean> | but, again, nothing above talked about a mutable array other than you |
| 02:55:55 | <SrPx> | yep I guess I misunderstood your point |
| 02:55:57 | <davean> | The paper was about non-mutable arrays |
| 02:56:09 | <davean> | and the Haskell Report Data.Array is non-mutable |
| 02:56:36 | <davean> | So, what do you get from giving up non-mutable arrays and paying an extra log? |
| 02:57:11 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 256 seconds) |
| 02:58:41 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
| 02:59:23 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 02:59:54 | <davean> | seperate in and out arrays are completely standard in GPU programming. |
| 03:00:14 | <davean> | and in GPU like haskell |
| 03:00:17 | <davean> | more stuff at http://www.cse.chalmers.se/edu/year/2017/course/DAT280_Parallel_Functional_Programming/Material/GPUProgramming/slides.pdf |
| 03:02:06 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 03:02:33 | <SrPx> | davean: yep but the point I was making is, for the Bitonic Sort in particular, you do *not* need to pay an extra log. that's what the algorithm I sent is doing :) it does all the correct swaps without indexing (i.e., get/set). it just coordinates swaps in such a manner that the end result is equivalent to the swaps you'd to in a mutable array |
| 03:02:44 | <SrPx> | i just found that kinda cool |
| 03:04:08 | <davean> | Sure you could say the same about merge sort too I think |
| 03:04:51 | <davean> | Thats a property of many fast sorts. |
| 03:05:39 | <davean> | Some you need to step up to finger trees for |
| 03:05:57 | <SrPx> | exactly, merge sort, quick sort, all the common sorts don't need array indexing, they have clean/direct functional algorithms that do the thing |
| 03:06:07 | <SrPx> | I just wasn't aware the bitonic sort was there too |
| 03:06:25 | <SrPx> | specially because it involves swaps in distant parts of the array in manners that looked like it couldn't be done without array indexing |
| 03:06:31 | <SrPx> | but it can! fairly cool |
| 03:06:41 | <davean> | well, any sort maps to a sorting network that is inherently static |
| 03:06:57 | <davean> | thats one of the fundimental properties of sorting |
| 03:07:00 | <SrPx> | but that's not the point |
| 03:07:01 | <davean> | sorry any COMPARISON sort |
| 03:07:20 | <davean> | But isn't that litterly a restatement of your observation? |
| 03:07:23 | <SrPx> | noo! |
| 03:07:25 | <SrPx> | for example |
| 03:07:32 | <SrPx> | suppose your ultra clever sorting algorithm does this: |
| 03:07:45 | <SrPx> | swap(array[7], array[91]) |
| 03:07:51 | <SrPx> | swap(array[5], array[65]) |
| 03:07:57 | <davean> | except it gets those from somewhere. |
| 03:08:02 | <davean> | Thats the sorting network |
| 03:08:06 | <davean> | those can be setup fixed. |
| 03:08:21 | <davean> | https://en.wikipedia.org/wiki/Sorting_network |
| 03:08:21 | <SrPx> | the indices that you swap must follow a specific rule, right? and after all the swaps you'll get a sorted array |
| 03:08:53 | <SrPx> | the thing is, there is no guarantee that the indices you swap will be in such a way that you can do the same swaps without indexing, by just rotating trees efficiently |
| 03:09:08 | <SrPx> | I know what a sorting network is aaa |
| 03:09:25 | <davean> | A sorting network is your guarrentee |
| 03:09:32 | <SrPx> | no it isn't!!! |
| 03:09:41 | <SrPx> | you don't get what I'm trying to say and I guess I can't explain |
| 03:09:46 | <SrPx> | this is fine, never mind all that |
| 03:09:53 | × | caryhartline quits (~caryhartl@2600:1700:2d0:8d30:3d51:c8c8:3b5:2cac) (Quit: caryhartline) |
| 03:10:09 | <SrPx> | I'm just bad at explaining, sorry |
| 03:10:15 | <SrPx> | need to go now |
| 03:10:24 | <davean> | A sorting network is a statement that it is knowable what has to feed into what. Since that exists, you can do each stage in constant time without an array. |
| 03:10:51 | <davean> | Ok |
| 03:10:54 | <davean> | well its been interesting |
| 03:12:23 | × | td_ quits (~td@83.135.9.56) (Ping timeout: 260 seconds) |
| 03:14:06 | → | td_ joins (~td@83.135.9.3) |
| 03:17:34 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 03:18:58 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 03:20:07 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 03:21:28 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 03:22:03 | <SrPx> | davean: oh - I was just thinking about a counter-example and I believe you're right. no matter what the initial arrangement is, as long as you know the starting and ending indices statically, you can always rotate sub trees to perform the desired permutation. sorry, I get it now and stand corrected |
| 03:22:18 | <SrPx> | really need to go run though |
| 03:25:27 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds) |
| 03:28:05 | → | abrantesasf joins (~abrantesa@187.64.158.2) |
| 03:34:03 | × | [_] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer) |
| 03:35:43 | × | mikoto-chan quits (~mikoto-ch@85-76-104-247-nat.elisa-mobile.fi) (Ping timeout: 256 seconds) |
| 03:56:02 | × | abrantesasf quits (~abrantesa@187.64.158.2) (Remote host closed the connection) |
| 04:00:00 | × | Taneb0 quits (~Taneb@2001:41c8:51:10d:aaaa:0:aaaa:0) (Quit: I seem to have stopped.) |
| 04:01:09 | → | Taneb joins (~Taneb@runciman.hacksoc.org) |
| 04:08:00 | × | manwithluck quits (~manwithlu@194.177.28.176) (Read error: Connection reset by peer) |
| 04:08:51 | × | ddellacosta quits (~ddellacos@89.45.224.59) (Ping timeout: 260 seconds) |
| 04:10:37 | <davean> | SrPx: To some degree thats the why and how of sorting being recursive! |
| 04:12:45 | × | srk quits (~sorki@user/srk) (Quit: ZNC 1.8.1 - https://znc.in) |
| 04:13:04 | → | manwithluck joins (~manwithlu@194.177.28.176) |
| 04:14:02 | <SrPx> | davean: yep sorry for not getting it earlier |
| 04:17:05 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 256 seconds) |
| 04:18:20 | × | shriekingnoise quits (~shrieking@186.137.167.202) (Ping timeout: 268 seconds) |
| 04:18:26 | × | jargon quits (~jargon@184.101.188.35) (Remote host closed the connection) |
| 04:18:53 | → | jargon joins (~jargon@184.101.188.35) |
| 04:19:06 | × | jargon quits (~jargon@184.101.188.35) (Remote host closed the connection) |
| 04:31:52 | → | srk joins (~sorki@user/srk) |
| 04:33:35 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds) |
| 04:33:45 | × | Techcable quits (~Techcable@user/Techcable) (Ping timeout: 268 seconds) |
| 04:35:04 | → | srk| joins (~sorki@user/srk) |
| 04:35:54 | → | mbuf joins (~Shakthi@49.204.121.98) |
| 04:38:41 | × | srk quits (~sorki@user/srk) (Ping timeout: 268 seconds) |
| 04:38:42 | srk| | is now known as srk |
| 04:40:39 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 04:45:17 | × | jlgw quits (~jw@83-233-104-81.cust.bredband2.com) (Remote host closed the connection) |
| 04:46:43 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Read error: Connection reset by peer) |
| 04:51:19 | × | bilegeek quits (~bilegeek@2600:1008:b064:c747:f92e:461d:82e7:f3a1) (Quit: Leaving) |
| 04:51:38 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds) |
| 04:53:29 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
| 04:54:12 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 05:05:08 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 05:07:23 | → | shriekingnoise joins (~shrieking@186.137.167.202) |
| 05:08:17 | × | troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 268 seconds) |
| 05:12:16 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 05:12:16 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 05:12:16 | → | wroathe joins (~wroathe@user/wroathe) |
| 05:16:18 | <davean> | No problem, its sorta a deep implication of sorting networks |
| 05:16:29 | <davean> | most CS people never get it :-p |
| 05:16:40 | → | polo joins (~polo@pool-100-11-18-203.phlapa.fios.verizon.net) |
| 05:18:04 | → | nate4 joins (~nate@98.45.169.16) |
| 05:20:33 | × | mvk quits (~mvk@2607:fea8:5ce3:8500::4b68) (Ping timeout: 256 seconds) |
| 05:21:12 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 05:24:12 | <SrPx> | I love how that's both mind-blowing and absolutely reasonable |
| 05:25:39 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 256 seconds) |
| 05:25:39 | × | polo quits (~polo@pool-100-11-18-203.phlapa.fios.verizon.net) (Ping timeout: 256 seconds) |
| 05:29:15 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 268 seconds) |
| 05:29:53 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 05:34:42 | → | razetime joins (~quassel@117.254.35.246) |
| 05:34:58 | × | j4cc3b quits (~j4cc3b@pool-74-105-2-138.nwrknj.fios.verizon.net) (Ping timeout: 260 seconds) |
| 05:43:47 | → | bgs joins (~bgs@212-85-160-171.dynamic.telemach.net) |
| 05:45:34 | → | Techcable joins (~Techcable@user/Techcable) |
| 05:54:47 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds) |
| 05:55:37 | → | freeside_ joins (~mengwong@103.252.202.193) |
| 05:57:37 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 268 seconds) |
| 06:01:56 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
| 06:07:08 | × | bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection) |
| 06:15:47 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 06:16:59 | → | Batzy_ joins (~quassel@user/batzy) |
| 06:17:27 | × | Batzy quits (~quassel@user/batzy) (Read error: Connection reset by peer) |
| 06:17:47 | × | DDR quits (~DDR@2604:3d08:4c7f:8250:ab47:a2f3:7012:8f4a) (Ping timeout: 256 seconds) |
| 06:19:43 | → | chomwitt joins (~chomwitt@2a02:587:7a0a:c00:1ac0:4dff:fedb:a3f1) |
| 06:20:37 | × | manwithluck quits (~manwithlu@194.177.28.176) (Read error: Connection reset by peer) |
| 06:21:03 | × | shriekingnoise quits (~shrieking@186.137.167.202) (Ping timeout: 268 seconds) |
| 06:21:21 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 06:22:55 | → | aliosablack joins (~chomwitt@2a02:587:7a0a:c00:1ac0:4dff:fedb:a3f1) |
| 06:23:27 | × | chomwitt quits (~chomwitt@2a02:587:7a0a:c00:1ac0:4dff:fedb:a3f1) (Read error: Connection reset by peer) |
| 06:23:33 | → | manwithluck joins (~manwithlu@194.177.28.176) |
| 06:32:02 | × | Batzy_ quits (~quassel@user/batzy) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 06:33:21 | → | Batzy joins (~quassel@user/batzy) |
| 06:35:33 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 06:39:46 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 06:42:10 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 06:44:36 | → | mikoto-chan joins (~mikoto-ch@85-76-104-247-nat.elisa-mobile.fi) |
| 06:45:21 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 06:47:24 | → | dfee joins (~dfee@162-227-164-101.lightspeed.sntcca.sbcglobal.net) |
| 06:48:38 | × | Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection) |
| 06:50:04 | → | clu joins (~clu@user/varjax) |
| 06:57:15 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 06:58:57 | → | Kaipei joins (~Kaiepi@108.175.84.104) |
| 07:06:17 | → | iqubic joins (~iqubic@2601:602:9502:c70:76bd:8eff:1f39:3cbe) |
| 07:06:55 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Read error: Connection reset by peer) |
| 07:08:02 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 07:08:07 | × | causal quits (~user@50.35.83.177) (Quit: WeeChat 3.7.1) |
| 07:11:05 | → | troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua) |
| 07:12:55 | → | random-jellyfish joins (~random-je@user/random-jellyfish) |
| 07:15:59 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 260 seconds) |
| 07:20:42 | → | kenran joins (~user@user/kenran) |
| 07:20:47 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 07:23:55 | × | youziqi quits (~youziqi@103.37.140.19) (Ping timeout: 260 seconds) |
| 07:24:01 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 07:25:11 | → | hsw_ joins (~hsw@112-104-87-192.adsl.dynamic.seed.net.tw) |
| 07:26:35 | × | hsw quits (~hsw@2001-b030-2303-0104-0172-0025-0012-0132.hinet-ip6.hinet.net) (Ping timeout: 248 seconds) |
| 07:30:25 | → | youziqi joins (~youziqi@103.37.140.121) |
| 07:32:14 | → | michalz joins (~michalz@185.246.207.203) |
| 07:35:03 | × | razetime quits (~quassel@117.254.35.246) (Ping timeout: 268 seconds) |
| 07:35:23 | → | razetime joins (~quassel@117.254.35.246) |
| 07:37:13 | × | random-jellyfish quits (~random-je@user/random-jellyfish) (Quit: Client closed) |
| 07:37:34 | <Unhammer> | https://hackage.haskell.org/package/base-4.17.0.0/docs/Foreign-C-String.html is there one of these for bytestrings? uses "current locale" ew |
| 07:42:07 | <[exa]> | Unhammer: ByteString has useAsCString, and you can manage the coding issues yourself using the standard bytestring utils |
| 07:42:31 | <[exa]> | see around here https://hackage.haskell.org/package/bytestring-0.11.3.1/docs/Data-ByteString.html#g:25 |
| 07:44:27 | <Unhammer> | ooh thanks [exa] |
| 07:44:50 | <Unhammer> | hoogle for once was not elpful https://hoogle.haskell.org/?hoogle=ByteString%20-%3E%20CString |
| 07:45:21 | <Unhammer> | oogle was not elpful, as they said in 'allo 'allo |
| 07:46:55 | [exa] | hesitantly looks out of the window at the French borders |
| 07:48:06 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) (Remote host closed the connection) |
| 07:49:20 | <Unhammer> | =D |
| 07:49:24 | × | wrengr quits (~wrengr@201.59.83.34.bc.googleusercontent.com) (Remote host closed the connection) |
| 07:49:29 | × | freeside_ quits (~mengwong@103.252.202.193) (Ping timeout: 260 seconds) |
| 07:49:35 | <[exa]> | anyway yeah the surprise IO there doesn't elp it much |
| 07:51:25 | → | merijn joins (~merijn@86.86.29.250) |
| 08:00:19 | × | mikoto-chan quits (~mikoto-ch@85-76-104-247-nat.elisa-mobile.fi) (Ping timeout: 260 seconds) |
| 08:01:54 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:9b29:5558:d4cc:17cc) |
| 08:03:09 | <tomsmeding> | Is it compatible with the semantics of Haskell to have an interpreter that takes a haskell-src-exts AST, say, and single-steps the program, each time producing an AST again, slightly modified |
| 08:03:32 | <tomsmeding> | or are there instances of laziness where you can't express the intermediate form at some point of execution as a Haskell AST |
| 08:04:02 | × | razetime quits (~quassel@117.254.35.246) (Ping timeout: 268 seconds) |
| 08:04:08 | <tomsmeding> | (This in response to a suggestion in -offtopic but also something I've wondered myself, and it was not -offtopic hence here) |
| 08:06:06 | → | kuribas joins (~user@ptr-17d51emijpptyt1h7er.18120a2.ip6.access.telenet.be) |
| 08:07:26 | → | odnes joins (~odnes@5-203-237-249.pat.nym.cosmote.net) |
| 08:07:29 | × | odnes quits (~odnes@5-203-237-249.pat.nym.cosmote.net) (Remote host closed the connection) |
| 08:08:19 | <opqdonut> | interesting question |
| 08:09:37 | <opqdonut> | and a tool like that would be nice for teaching. I've written out step-by-step evaluations like that for things like `first . filter f . map g` |
| 08:09:51 | <tomsmeding> | yeah the intended application would be teaching and debugging :p |
| 08:10:41 | × | clu quits (~clu@user/varjax) (Quit: WeeChat 3.7.1) |
| 08:11:11 | → | freeside joins (~mengwong@103.252.202.193) |
| 08:12:11 | <tomsmeding> | I feel that one should be able to do this, if you put all thunks you're currently evaluating in a 'let' |
| 08:12:43 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 08:14:02 | <opqdonut> | yeah |
| 08:14:10 | <opqdonut> | definitely for a suitably limited subset of haskell |
| 08:14:20 | <tomsmeding> | right |
| 08:14:21 | → | mmhat joins (~mmh@p50857d40.dip0.t-ipconnect.de) |
| 08:14:50 | <tomsmeding> | yeah not sure if this will play well with some of the type system extensions, for GADTs and TypeFamilies you're going to need lots of annoying type annotations |
| 08:15:08 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 08:15:14 | <tomsmeding> | but for the teaching purpose we can safely skip those since if the students are there already, they're supposed to already understand the basic evaluation model :D |
| 08:15:21 | → | kenran` joins (~user@user/kenran) |
| 08:15:42 | <opqdonut> | I think for even Haskell98 type classes, you're going to need stuff like `f (1::Int) (show :: Int -> String)` |
| 08:15:57 | <tomsmeding> | hm that's right |
| 08:15:59 | <opqdonut> | yeah but this can be glossed over |
| 08:16:37 | <tomsmeding> | bonus points for writing functionality to detect when the type annotations are necessary for correct semantics, and only displaying them then |
| 08:16:50 | × | kenran quits (~user@user/kenran) (Ping timeout: 240 seconds) |
| 08:17:59 | × | ropwareJB quits (~ropwareJB@180-150-36-243.b49624.bne.nbn.aussiebb.net) (Quit: Client closed) |
| 08:20:24 | <dminuoso> | That moment when concatenating with newlines suddenly is not associative... |
| 08:20:38 | dminuoso | stares at his screen in disbelief |
| 08:20:41 | <tomsmeding> | O.o |
| 08:20:45 | → | evanvarvell joins (~evanvarve@097-088-181-216.res.spectrum.com) |
| 08:21:28 | → | razetime joins (~quassel@117.254.35.246) |
| 08:22:55 | <dminuoso> | Yeah, so on one hand I use `vsep` from pretty printer to the effect of `pprMod = vsep ["A", "B"]`, and then traverse over a thing using `traverse_ (yieldDoc . pprMod) mods` with `yieldDoc = yield . render . (<> hardline)` |
| 08:23:16 | <dminuoso> | And the conduit produces lines in the shape of ["A", "A", "A", "B", "B", "B"] |
| 08:23:24 | <dminuoso> | This is stunning |
| 08:23:36 | <InstX1> | is it heresy to say that Haskell is terrible for learning software engineering, but good for learning computer science? |
| 08:23:47 | <InstX1> | as a rank beginner |
| 08:23:50 | → | cafkafk joins (~cafkafk@fsf/member/cafkafk) |
| 08:23:51 | <dminuoso> | I would say its nonsense *shrugs* |
| 08:24:06 | <InstX1> | i can't get into the projects stage with Haskell |
| 08:24:22 | → | fserucas joins (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) |
| 08:25:04 | <InstX1> | also, what happened to Until? |
| 08:25:06 | <InstX1> | until? |
| 08:25:21 | <InstX1> | I did some benchmarking, accumulating parameter version of sum seems to outperform the foldl' based implementation |
| 08:25:30 | × | merijn quits (~merijn@86.86.29.250) (Ping timeout: 240 seconds) |
| 08:25:32 | <InstX1> | until, however, is a disaster |
| 08:26:00 | <tomsmeding> | InstX1: what's that oine |
| 08:26:02 | <tomsmeding> | *one |
| 08:26:12 | <InstX1> | until is a built in reverse while loop in base |
| 08:26:14 | <iqubic> | @hoogle until |
| 08:26:15 | <lambdabot> | Prelude until :: (a -> Bool) -> (a -> a) -> a -> a |
| 08:26:15 | <lambdabot> | GHC.Base until :: (a -> Bool) -> (a -> a) -> a -> a |
| 08:26:15 | <lambdabot> | Test.Hspec.Discover until :: () => (a -> Bool) -> (a -> a) -> a -> a |
| 08:26:34 | <iqubic> | @src until |
| 08:26:34 | <lambdabot> | until p f x | p x = x |
| 08:26:34 | <lambdabot> | | otherwise = until p f (f x) |
| 08:26:49 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 08:27:43 | <InstX1> | oh, looks like something was probably wrong with my benchmarks |
| 08:28:24 | <InstX1> | still until is a disaster |
| 08:29:02 | <iqubic> | It doesn't seem to bad to me |
| 08:31:42 | <InstX1> | could have been an implementation thing |
| 08:31:43 | × | Batzy quits (~quassel@user/batzy) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 08:31:47 | <InstX1> | as in, i ended up doing it as a tuple |
| 08:32:06 | → | Batzy joins (~quassel@user/batzy) |
| 08:32:12 | <tomsmeding> | InstX1: what's your implementation |
| 08:32:30 | <InstX1> | i deleted it, it's just something i remember from benchmarks |
| 08:32:36 | <InstX1> | but it involved creating a tuple for a control variable |
| 08:33:16 | <tomsmeding> | there is the possibility that you "should" have seq'd the tuple elements, because tuples are lazy |
| 08:33:20 | <tomsmeding> | but we can't know now :) |
| 08:34:45 | <InstX1> | yeah, too tired to benchmark it again |
| 08:35:51 | → | chele joins (~chele@user/chele) |
| 08:37:18 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 08:42:33 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 08:47:32 | → | acidjnk joins (~acidjnk@p200300d6e7137a015d19df638f338baf.dip0.t-ipconnect.de) |
| 08:48:36 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) |
| 08:49:36 | → | machinedgod joins (~machinedg@clnet-p10-126.ikbnet.co.at) |
| 08:52:50 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) (Ping timeout: 240 seconds) |
| 08:52:51 | → | nschoe joins (~q@141.101.51.197) |
| 08:56:05 | × | Batzy quits (~quassel@user/batzy) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 08:56:55 | → | zeenk joins (~zeenk@2a02:2f04:a208:3600::7fe) |
| 08:57:19 | → | Batzy joins (~quassel@user/batzy) |
| 08:59:49 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 09:02:56 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 09:10:03 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
| 09:22:01 | → | ub joins (~Thunderbi@77.119.171.26.wireless.dyn.drei.com) |
| 09:22:03 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 09:23:03 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 09:23:46 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 09:24:37 | → | Guest7325 joins (~coco@85.195.206.136) |
| 09:25:28 | → | ubert1 joins (~Thunderbi@77.119.222.7.wireless.dyn.drei.com) |
| 09:25:38 | → | ub1 joins (~Thunderbi@77.119.222.7.wireless.dyn.drei.com) |
| 09:26:01 | Guest7325 | is now known as hahahhuhuu |
| 09:26:09 | hahahhuhuu | is now known as c0c0 |
| 09:26:21 | × | finsternis quits (~X@23.226.237.192) (Read error: Connection reset by peer) |
| 09:26:37 | × | ensyde quits (~psy@104-62-224-96.lightspeed.chrlnc.sbcglobal.net) (Quit: WeeChat 2.8) |
| 09:26:40 | × | freeside quits (~mengwong@103.252.202.193) (Ping timeout: 268 seconds) |
| 09:26:40 | × | ubert quits (~Thunderbi@77.119.171.26.wireless.dyn.drei.com) (Ping timeout: 268 seconds) |
| 09:26:41 | ub1 | is now known as ubert |
| 09:26:54 | × | ub quits (~Thunderbi@77.119.171.26.wireless.dyn.drei.com) (Ping timeout: 260 seconds) |
| 09:31:01 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
| 09:44:10 | → | chromoblob joins (~user@37.113.164.122) |
| 09:51:08 | × | use-value quits (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) (Remote host closed the connection) |
| 09:54:48 | → | Heyting joins (~Heyting@193.198.16.217) |
| 09:54:49 | × | Heyting quits (~Heyting@193.198.16.217) (Remote host closed the connection) |
| 09:55:39 | → | CiaoSen joins (~Jura@p200300c9571247002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 10:06:49 | <kuribas> | InstX1: I'd say haskell is great for learning software engineering, but only decent for learning computer science. |
| 10:07:02 | <kuribas> | InstX1: besides, computer science is mostly math. |
| 10:07:22 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds) |
| 10:07:27 | <InstX1> | i'm stalled because I can't get from the "I can do hundreds of exercises in a few months on Codewars" phase to the productive programming phase |
| 10:07:42 | <InstX1> | hurts that I'm working on Windows, meaning it's hard to get GUI |
| 10:08:11 | <kuribas> | yeah, nobody bothered to make good UI libraries for haskell |
| 10:08:41 | <InstX1> | actual projects are probably more about Servant than any GUI apps |
| 10:09:05 | <kuribas> | ooh, SICP comes with javascript now :-O https://www.bol.com/nl/nl/p/structure-and-interpretation-of-computer-programs/9300000039441478/?s2a=#productTitle |
| 10:09:27 | <kuribas> | InstX1: I think most haskell in industry is backend programs. |
| 10:09:56 | <kuribas> | IMO these days idris is a better language for teaching than haskell. |
| 10:10:03 | <InstX1> | i'm wondering, what's the better Javascript book, Eloquent Javascript or SICP? |
| 10:11:50 | <kuribas> | SICP isn't a javascript book |
| 10:11:51 | <InstX1> | well, MIT already switched off to Python, so SICP is probably obsolete in that context |
| 10:11:59 | <kuribas> | it's not a scheme book either |
| 10:12:00 | <InstX1> | SICP is a principles book, no? |
| 10:12:03 | <kuribas> | yes |
| 10:13:14 | → | kenaryn joins (~aurele@cre71-h03-89-88-44-27.dsl.sta.abo.bbox.fr) |
| 10:13:37 | <kuribas> | true, it's probably better to have SICP in JS than no SICP at all. |
| 10:16:05 | → | mastarija joins (~mastarija@2a05:4f46:e03:6000:9658:d7fb:b925:5ab5) |
| 10:17:56 | <JensPetersen[m]> | Is there a good reason why <$!> is only defined for Monad (eg not Functor)? |
| 10:17:59 | × | xff0x quits (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 260 seconds) |
| 10:18:05 | <mastarija> | when using lenses, is there a combinator to modify only a value with a specific index? |
| 10:19:34 | × | zer0bitz_ quits (~zer0bitz@196.244.192.54) () |
| 10:20:43 | <InstX1> | I have the old Second Edition / lisp version |
| 10:20:44 | <InstX1> | scheme |
| 10:21:26 | <c0c0> | I'm on NixOS and don't manage to get vscode working with the HLS (haskell.haskell extension). Can someone point me to up-to-date instructions for how to set it up? |
| 10:21:33 | <kuribas> | :t at |
| 10:21:34 | <lambdabot> | (At m, Functor f) => Index m -> (Maybe (IxValue m) -> f (Maybe (IxValue m))) -> m -> f m |
| 10:21:55 | <kuribas> | -- mastarija |
| 10:22:12 | <mastarija> | Hm.. |
| 10:23:12 | <mastarija> | So I need to provide a function that takes "maybe" value and gives back "maybe" wrapped in f? |
| 10:23:43 | → | ephemient joins (uid407513@id-407513.lymington.irccloud.com) |
| 10:23:59 | <mastarija> | Isn't there something like a simple setter that justs sets the value if old one exist, and returns unmodified container otherwise? |
| 10:24:05 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 10:24:44 | <mastarija> | Like `myRecord & seti myIndex myVal` |
| 10:25:19 | → | zer0bitz joins (~zer0bitz@196.244.192.54) |
| 10:27:42 | <dminuoso> | mastarija: fmap or <$> |
| 10:28:06 | <dminuoso> | Or do you mean using lenses? |
| 10:28:10 | <mastarija> | Lenses |
| 10:28:16 | <dminuoso> | You just use `over` |
| 10:28:37 | <dminuoso> | Or `set`, or any of their operator variants |
| 10:28:48 | <mastarija> | Like, I want to modify a value of a particular key in a map, in a record |
| 10:29:03 | <dminuoso> | like (.~) or (%~) |
| 10:29:17 | <mastarija> | myRecord .~ _myMap key newValue |
| 10:29:21 | <mastarija> | SOmething like this |
| 10:29:33 | <dminuoso> | myRecord & at "key" .~ newValue |
| 10:29:43 | <mastarija> | Aha |
| 10:29:45 | <mastarija> | Cool |
| 10:29:58 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 10:30:00 | <mastarija> | Does it work for arrays as well? |
| 10:30:06 | <dminuoso> | What do you mean? |
| 10:30:21 | <mastarija> | Wait... |
| 10:30:26 | × | szkl quits (uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity) |
| 10:30:26 | <mastarija> | That example is wrong |
| 10:30:33 | <dminuoso> | Do note however, that to satisfy your request you must compose it with _Just probably |
| 10:30:33 | <mastarija> | I have a record that has a Map within it |
| 10:30:55 | <dminuoso> | To do that, and include your record, you would have to do: |
| 10:30:55 | <mastarija> | MyRecord { myMap :: Map Key Val } |
| 10:31:23 | <dminuoso> | myRecord & field.at "key"._Just .~ 10 |
| 10:31:55 | <dminuoso> | (Since you only want to to update an existing entry in the map, but not set one if none previous exists, if I understood that right) |
| 10:32:10 | <mastarija> | so myRecord & myMap . at someKey . _Just .~ 10 |
| 10:32:12 | <mastarija> | yes |
| 10:32:16 | <mastarija> | That's correct |
| 10:32:24 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 10:32:29 | <mastarija> | Is there any lens tutorial that deals with such topics? |
| 10:33:02 | <mastarija> | I've only found ones that explain what lenses are, but not what usefull combinators there are, and some interesting usecases. |
| 10:34:10 | × | chromoblob quits (~user@37.113.164.122) (Ping timeout: 240 seconds) |
| 10:34:53 | <dminuoso> | Well, it is sort of expected you explore the library yourself. |
| 10:35:22 | → | use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) |
| 10:35:42 | <dminuoso> | I personally prefer `optics`, but even if you want to use `lens`, what you could do is use the `optics` documentation as its much better organized and documented, and then just find the corresponding combinators in `lens` |
| 10:36:09 | <mastarija> | Didn't know about that. I'll check it out. |
| 10:37:05 | <dminuoso> | One of the benefits of `optics` is that they are much better typed, which makes the types easier to read. But anyway, dont misunderstand this as an attempt to sway you to `optics`. |
| 10:37:37 | <dminuoso> | While we mostly use `optics`, when I do use `lens` I still use the `optics` documentation because for the most part the combinators are named the same wayu |
| 10:38:00 | <mastarija> | So, if I have IndexedTraversal' then I can't use the at, right? |
| 10:38:12 | <dminuoso> | What do you mean `I can't use the at`? |
| 10:38:32 | <[Leary]> | JensPetersen[m]: Functor can't do it---at least, not in a way that means the same thing. `(<$!>) f = fmap \x -> let z = f x in z `seq` z` is pointless because `z `seq` z` is the same as `z`. If what you want is `(<$!>) f = fmap \x -> x `seq` f x`, then that does something, but you can already do that with: `(f $!) <$> ...`. |
| 10:38:40 | <mastarija> | myRecord & _myMapIndexedTraversal . at "key" ... |
| 10:38:46 | <mastarija> | dminuoso: |
| 10:38:55 | <dminuoso> | What is the type of `_myMapIndexedTraversal`? |
| 10:39:11 | <dminuoso> | mastarija: at any rate, yes you can do that. |
| 10:39:21 | <dminuoso> | being able to do just that, is what makes lens so crazy. :) |
| 10:39:28 | <JensPetersen[m]> | [Leary]: aha, thanks |
| 10:39:42 | <mastarija> | dminuoso: IndexedTraversal' MyKey MyRecord MyValue |
| 10:39:52 | <dminuoso> | mastarija: No this will work just fine, then. |
| 10:39:58 | <mastarija> | Cool |
| 10:40:07 | <dminuoso> | You might have to do some bit of shifting if you want to preserve the original index |
| 10:40:15 | <dminuoso> | Or you can just degrade to non-indexed |
| 10:40:45 | <dminuoso> | See (<.), (<.>) and (.>) |
| 10:41:05 | <dminuoso> | In principle (.) acts the same as (.>) which means "preserve the index to the right" |
| 10:41:10 | × | kuribas quits (~user@ptr-17d51emijpptyt1h7er.18120a2.ip6.access.telenet.be) (Ping timeout: 240 seconds) |
| 10:41:24 | <dminuoso> | So you might have to do something like |
| 10:41:47 | <dminuoso> | `_myMapIndexedTraversal <. at "key" <. _Just` if you intend to use say `iover` or `iset` |
| 10:42:20 | <dminuoso> | Uh, actually the second (<.) is probably erreneous and redundant |
| 10:42:43 | <mastarija> | Wait, what? I thought we were just replacing the value at the specified index, no? |
| 10:42:59 | <mastarija> | Index being a key in Map, or position in array? |
| 10:43:02 | <dminuoso> | mastarija: There's two uses of the word `index` here |
| 10:43:24 | <dminuoso> | And maybe there's additional confusion |
| 10:43:28 | <dminuoso> | Can you share the code and relevant type signatures? |
| 10:43:45 | <dminuoso> | Is `MyValue ~ Map K V`? If yes, what is `K`? |
| 10:44:14 | → | random-jellyfish joins (~random-je@user/random-jellyfish) |
| 10:49:50 | × | cafkafk quits (~cafkafk@fsf/member/cafkafk) (Ping timeout: 255 seconds) |
| 10:52:16 | → | chromoblob joins (~user@37.113.164.122) |
| 10:55:47 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 11:01:32 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
| 11:11:16 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 11:12:02 | → | xff0x joins (~xff0x@2405:6580:b080:900:fc69:8fe6:1c5d:8fdb) |
| 11:12:34 | → | luseerr joins (~luseerr@145.224.100.107) |
| 11:14:32 | <luseerr> | Hi! Is there any go-to library in haskell for parsing phone numbers? I found this lib https://hackage.haskell.org/package/phone-numbers which does exactly what I need but for some reason when trying to install it through stack I get an error "Missing (or bad) C libraries: phonenumber, protobuf" which as a newb I don't really follow. I could install |
| 11:14:32 | <luseerr> | them locally somehow outside of stack I suppose, but then what happens in the build/release process? Any pointers appreciated! |
| 11:20:27 | → | __monty__ joins (~toonn@user/toonn) |
| 11:21:35 | → | beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
| 11:24:35 | <[exa]> | I'm slightly surprised by the fact that even phone numbers have to be parsed nowadays |
| 11:25:21 | → | Guest96 joins (~Guest96@2401:4900:1cb9:ca12:255d:d66f:31b:83bb) |
| 11:26:05 | <[exa]> | anyway there's apparently `libphonenumber`, you might have luck simply calling it using FFI |
| 11:27:05 | <[exa]> | regarding the error, you might need to install the system library dependencies -- I'd expect something like libphonenumber-dev and libprotobuf-dev packages (assuming you're on unix) |
| 11:27:08 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 11:31:00 | × | kenaryn quits (~aurele@cre71-h03-89-88-44-27.dsl.sta.abo.bbox.fr) (Quit: leaving) |
| 11:31:59 | × | Guest96 quits (~Guest96@2401:4900:1cb9:ca12:255d:d66f:31b:83bb) (Quit: Client closed) |
| 11:32:17 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
| 11:32:26 | <dminuoso> | [exa]: phone-numbers is an ffi binding for libphonenumber |
| 11:33:15 | <dminuoso> | [exa]: And of coure they have to be parsed. There's so many different phone number formats.. |
| 11:35:34 | <fendor[m]> | since some recent ghc versions, the order of implicit forall's type variables has changed, what is the order now? Something deterministic? |
| 11:35:36 | <dminuoso> | So sometimes a phone number might have non-digits in them, e.g. `0800 mycompany`, conflicts with country codes and area codes (Germany is a snowflake here, as 049* is a valid area code prefix, unlike virtually all other countries, which leads to ambiguity in some shorter conventions) |
| 11:35:56 | <dminuoso> | fendor[m]: in order of appearance in the type signature as far as I remember |
| 11:36:18 | <dminuoso> | but its not defined api either |
| 11:36:42 | <dminuoso> | Which is part of why TypeApplications is such a poor utility, there is no guarantee the order wont change again |
| 11:36:49 | <fendor[m]> | ah, that makes sense, thanks! |
| 11:37:25 | <dminuoso> | fendor[m]: Note that there is some subtle annoying implications, as the constraint is considered to. |
| 11:37:47 | <dminuoso> | Which means something turning `a -> b -> c` into `C b => a -> b -> c` will suddenly alter the type variable order |
| 11:37:56 | <fendor[m]> | of course, using explicit forall's the solution |
| 11:38:03 | <fendor[m]> | *is the solution |
| 11:38:10 | <dminuoso> | I rather consider explicit Proxy a better solution |
| 11:38:42 | <dminuoso> | There's a bunch of subtle problems otherwise, because once the type is back inferred, you cannot apply type variables anymore |
| 11:38:59 | <fendor[m]> | I was just wondering, since I change my type signatures quite considerably, delete the previous sig, then let HLS infer the type, but since that includes implicit kind variables as well, I delete foralls, since otherwise the type sig is like 5 lines long |
| 11:39:14 | <dminuoso> | so if you do something like |
| 11:39:17 | <dminuoso> | % :set -XTypeApplication |
| 11:39:17 | <yahb2> | Some flags have not been recognized: -XTypeApplication |
| 11:39:20 | <dminuoso> | % :set -XTypeApplications |
| 11:39:20 | <yahb2> | <no output> |
| 11:39:24 | <dminuoso> | % f a = a |
| 11:39:24 | <yahb2> | <no output> |
| 11:39:30 | <dminuoso> | % f @Int 1 |
| 11:39:30 | <yahb2> | <interactive>:16:1: error: ; • Cannot apply expression of type ‘p0 -> p0’ ; to a visible type argument ‘Int’ ; • In the expression: f @Int 1 ; In an equation for ‘it’: it = f @I... |
| 11:39:49 | <dminuoso> | TypeApplications is not very polished. Proxy is *much* better |
| 11:40:37 | <dminuoso> | fendor[m]: https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/type_applications.html#ordering-of-specified-variables |
| 11:40:49 | <dminuoso> | By the way, so the rules are actually way more complicated than "order of appearance" |
| 11:40:53 | <fendor[m]> | huh, why does that fail? I preferred TypeApplications so far, since it feels quicker to specify what you need |
| 11:41:30 | <dminuoso> | Because the type is inferred. |
| 11:41:40 | <dminuoso> | Now you might say "just add a type signature", consider the following example: |
| 11:41:46 | <dminuoso> | % f x a = a |
| 11:41:46 | <yahb2> | <no output> |
| 11:41:57 | <dminuoso> | % f :: a -> b -> b; f x a = a |
| 11:41:57 | <yahb2> | <no output> |
| 11:42:07 | <dminuoso> | % let g = f 'c' in g @Int 1 |
| 11:42:08 | <yahb2> | <interactive>:22:18: error: ; • Cannot apply expression of type ‘b0 -> b0’ ; to a visible type argument ‘Int’ ; • In the expression: g @Int 1 ; In the expression: let g = f 'c' ... |
| 11:42:12 | → | enoq joins (~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7) |
| 11:42:13 | <dminuoso> | It strikes again. |
| 11:42:26 | <dminuoso> | fendor[m]: Proxy is really better. :) |
| 11:42:35 | <dminuoso> | Oder better yet `proxy` |
| 11:43:00 | <dminuoso> | Add the fact that the ordering of specified variables is really utterly complex, and not guaranteed to be stable either... |
| 11:43:21 | → | mikoto-chan joins (~mikoto-ch@85-76-104-247-nat.elisa-mobile.fi) |
| 11:43:26 | → | kuribas joins (~user@188.188.8.143) |
| 11:44:03 | <fendor[m]> | proxy the library? |
| 11:44:22 | <dminuoso> | No, as in `proxy p` rather than `Proxy p` |
| 11:44:42 | <dminuoso> | It even allows for cute shenanigans like passying a `Maybe Int` if so desired |
| 11:46:43 | × | vglfr quits (~vglfr@145.224.100.100) (Remote host closed the connection) |
| 11:46:50 | <fendor[m]> | ah, ok so instead of `send @Int 5`, you recommend a signature `send :: proxy p -> p -> m ()`, and then invoking it via `send (Just (5 :: Int))`? I am using Just 5 now only to check that I have understood correctly |
| 11:47:09 | <dminuoso> | Well you would usually still invoke it with `Proxy :: Proxy Int` |
| 11:47:10 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 240 seconds) |
| 11:47:31 | <dminuoso> | But you're not constraining the caller to `Proxy`, they could also pass some argument they have lying around |
| 11:47:48 | <dminuoso> | i.e.: `send f ...` where `f` already is in scope. |
| 11:47:54 | → | vglfr joins (~vglfr@145.224.100.100) |
| 11:47:59 | <dminuoso> | It can be more convenient than somehow matching the type out of `f` |
| 11:48:18 | <fendor[m]> | yeah makes sense |
| 11:48:19 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 11:48:24 | → | santiagopim joins (~user@90.167.66.131) |
| 11:48:41 | <dminuoso> | Note, actually Proxy is where TypeApplications is fine! |
| 11:48:55 | <dminuoso> | `send (Proxy @Int)` tends to be a bit more terse |
| 11:49:10 | <dminuoso> | And we have the sort of guarantee that Proxy will never add more type variables anyway, so its relatively reliable |
| 11:50:54 | <dminuoso> | fendor[m]: that being said, your example of `send :: proxy p -> p -> m ()` is obviously contrived, since there's really no need to pass a `proxy p` when you already have a `p` argument |
| 11:51:07 | <dminuoso> | Just making that note in case this type signature is what you're actually having in mind |
| 11:52:51 | <fendor[m]> | while I am not entirely sure I really need TypeApplications in my example, I think it is still helpful to disambiguate literals, that's why I have it. |
| 11:53:29 | <dminuoso> | You mean string (in the presence of OverloadedStrings) or numeric literals? |
| 11:53:38 | <dminuoso> | For them, yeah TypeApplications is perfectly fine. |
| 11:53:59 | <dminuoso> | Though `::` is just one character more |
| 11:54:17 | <fendor[m]> | both, but also just to help the type inference out in this complex situation |
| 11:54:33 | <dminuoso> | Not sure what @ helps you that (::) would not |
| 11:54:57 | × | kuribas quits (~user@188.188.8.143) (Ping timeout: 256 seconds) |
| 11:54:58 | <fendor[m]> | true, but `send @Int 5` fells much cleaner to me than `send (5 :: Int)`. Also easier to type, but maybe I just need to change my typing habits |
| 11:55:19 | <fendor[m]> | nothing, so far I felt like it is nicer to use |
| 11:55:30 | × | emmanuelux quits (~emmanuelu@user/emmanuelux) (Quit: au revoir) |
| 11:55:37 | <dminuoso> | You can also create surrogate bindings `sendInt = ...` |
| 11:55:56 | <dminuoso> | Which is what I tend to favour |
| 11:56:03 | <fendor[m]> | and since we have features that I think are aesthetically slightly nicer, I was going to use them, but you made me reconsider to switch to a more reliable way |
| 11:56:51 | <dminuoso> | I think there's a case to be made for monomorphic bindings, actually. It becomes searchable for refactoring, and potentially lets you document behavioral differences |
| 11:56:59 | <fendor[m]> | yeah I can but `send @Int` *feels* more general and doesnt require you to type a surrogate binding and a type signature |
| 11:57:32 | <dminuoso> | Is it? As a reader, I might stop and think `what does @Int` even mean here? |
| 11:57:38 | <dminuoso> | Something gets set to `Int`, but what? |
| 11:57:47 | <dminuoso> | is it the input? output? something in logging? |
| 11:58:15 | <dminuoso> | ANd worse, they have to potentially consult the GHC manual to figure out what the first type variable even is |
| 11:58:27 | <c_wraith> | I think the real problem is ad-hoc polymorphism on type variables that appear only in a negative position |
| 11:58:58 | <fendor[m]> | I can see that this makes sense, but at the same time, having 20 monomorphic send functions doesn't sound like that much better |
| 11:59:18 | <dminuoso> | `send (5 :: Int)` makes it clear what is happening |
| 11:59:23 | <dminuoso> | `send @Int 5` does not |
| 11:59:47 | <dminuoso> | Because you really have to consult both the GHC manual and the definition site of `send` to understand what your invocation means |
| 12:00:48 | <dminuoso> | Perhaps the biggest annoyance is that Haskell chose a double colon for type signatures and not a single colon like the rest of ML :( |
| 12:00:57 | <dminuoso> | `send (5 : Int)` reads much less noisy |
| 12:01:01 | <fendor[m]> | well, IF I have an explicit type signature for send, I only need to consult the documentation |
| 12:01:18 | <dminuoso> | fendor[m]: If you do not have an explicit type signature for send, you cannot use TypeApplications anyway |
| 12:02:02 | <[exa]> | dminuoso: syntactically I'd welcome something that allows you to also omit the parentheses there |
| 12:02:26 | <fendor[m]> | well, yes you can, right? It might just not be what you intended 😛 |
| 12:02:35 | <[exa]> | dminuoso: like, `send 5::Int` would be okay but that currently means something different |
| 12:02:53 | <dminuoso> | Maybe I should conjure up a SingleColons extension. |
| 12:03:00 | <dminuoso> | Surely cant be much work to do |
| 12:04:27 | <fendor[m]> | +1 to Singlecolons extensions |
| 12:04:31 | <fendor[m]> | that'd be great |
| 12:05:16 | <dminuoso> | I can already see the controvery in the discussions on the PR. |
| 12:07:50 | money | is now known as polo |
| 12:08:50 | <yushyin> | https://github.com/ghc-proposals/ghc-proposals/pull/118 |
| 12:08:57 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 12:10:59 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 12:16:32 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 12:16:52 | × | TonyStone quits (~TonyStone@cpe-74-76-57-186.nycap.res.rr.com) (Ping timeout: 268 seconds) |
| 12:17:01 | <fendor[m]> | I remember ndmitchell proposed that language extension in one of their blogposts |
| 12:18:30 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 12:19:19 | × | xff0x quits (~xff0x@2405:6580:b080:900:fc69:8fe6:1c5d:8fdb) (Ping timeout: 260 seconds) |
| 12:19:35 | → | `2jt joins (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) |
| 12:21:15 | → | xff0x joins (~xff0x@2405:6580:b080:900:fc69:8fe6:1c5d:8fdb) |
| 12:23:39 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds) |
| 12:28:34 | × | evanvarvell quits (~evanvarve@097-088-181-216.res.spectrum.com) (Quit: Leaving) |
| 12:29:49 | → | TonyStone joins (~TonyStone@cpe-74-76-57-186.nycap.res.rr.com) |
| 12:30:59 | × | CiaoSen quits (~Jura@p200300c9571247002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 12:33:55 | → | coot joins (~coot@213.134.171.3) |
| 12:45:05 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 12:46:12 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 12:46:31 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 12:48:03 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 12:49:15 | → | kuribas joins (~user@ip-188-118-57-242.reverse.destiny.be) |
| 12:52:14 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) |
| 12:52:41 | → | MajorBiscuit joins (~MajorBisc@145.94.173.65) |
| 12:56:30 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) (Ping timeout: 240 seconds) |
| 13:07:01 | <luseerr> | dminuoso thanks a lot, appreciate! |
| 13:07:03 | → | CiaoSen joins (~Jura@p200300c9571247002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 13:11:59 | → | jco joins (~jco@90-228-194-139-no542.tbcn.telia.com) |
| 13:14:20 | → | lyle joins (~lyle@104.246.145.85) |
| 13:16:13 | × | ft quits (~ft@p508dbd59.dip0.t-ipconnect.de) (Quit: leaving) |
| 13:16:50 | → | hsw joins (~hsw@2001-b030-2303-0104-0172-0025-0012-0132.hinet-ip6.hinet.net) |
| 13:18:35 | × | hsw_ quits (~hsw@112-104-87-192.adsl.dynamic.seed.net.tw) (Ping timeout: 260 seconds) |
| 13:21:10 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 240 seconds) |
| 13:27:51 | <dminuoso> | Why does Data.ByteString use a ForeignPtr over just say a Ptr? |
| 13:28:30 | → | stackdroid18 joins (14094@user/stackdroid) |
| 13:31:00 | <dminuoso> | Is it presumably just to be able to have a ByteString with finalizers attached? Because as far as I can tell, `bytestring` itself does not rely on it |
| 13:33:43 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
| 13:41:42 | <merijn> | dminuoso: So you can easily create bytestrings out of external objects |
| 13:41:54 | <merijn> | dminuoso: Some examples that come to mind: C malloced strings, SQLite results, etc. |
| 13:42:11 | <merijn> | dminuoso: And also, it kinda does |
| 13:42:48 | <merijn> | dminuoso: Because you can create substrings that use the same backing ForeignPtr, so it uses the ForeignPtr machinery to detect when all references are dead and things can get dealloced |
| 13:43:18 | <dminuoso> | Okay, but conversely it is not assumed one can actually attach finalizers to an arbitrary ByteString right? |
| 13:43:33 | <merijn> | I mean, why not? |
| 13:43:45 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 13:43:48 | <dminuoso> | Well, for one bytestring internally has a bunch of `mallocPlainForeignPtrBytes` uses |
| 13:44:33 | <merijn> | dminuoso: It's not part of the public API |
| 13:44:33 | <dminuoso> | Which creates a ForeignPtr that you cannot attach finalizers to (it's a little beyond me why that is useful at all) |
| 13:44:46 | <merijn> | So the only way you can get a ForeignPtr is if you do dirty stuff |
| 13:44:56 | <merijn> | So "You're On Your Own (TM)" |
| 13:45:03 | <dminuoso> | :) |
| 13:45:11 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 13:45:12 | <dminuoso> | Related question: |
| 13:45:22 | <merijn> | I don't think the API intends for you to attach finalizer to random bytestrings, no |
| 13:45:38 | <merijn> | But the ability to (sensibly) create bytestrings out of pointers with finalizers is useful for obvious reasons |
| 13:46:17 | <dminuoso> | If I `mallocForeignPtrBytes`, under the hood this will use newPinnedByteArray I |
| 13:46:40 | <dminuoso> | However, what happens if I `plusForeignPtr` and lose the original foreign ptr |
| 13:47:18 | <merijn> | plusForeignPtr creates a foreign ptr with a finalizer that remembers the original alloc, that's the point of it existing :p |
| 13:47:19 | <dminuoso> | How does the GC keep the pinned bytearray alive? Does it consider whether a pointer exists that points anywhere in the bytearray? |
| 13:47:35 | <dminuoso> | merijn: no, it does not! |
| 13:47:39 | <dminuoso> | plusForeignPtr (ForeignPtr addr c) (I# d) = ForeignPtr (plusAddr# addr d) c |
| 13:47:44 | <dminuoso> | No finalizer is being attached |
| 13:47:49 | <dminuoso> | THat's why Im a bit surprised. |
| 13:47:54 | <merijn> | dminuoso: Did you, perchance, consider reading the docs of plusForeignPtr |
| 13:47:57 | → | bontaq joins (~user@ool-45779fe5.dyn.optonline.net) |
| 13:48:10 | <dminuoso> | Err yes? |
| 13:48:19 | <merijn> | dminuoso: I think the original address is already stored in the finalizer |
| 13:48:29 | <merijn> | dminuoso: "the finalizer will be called with the same address that it would have had this call not happened, *not* the new address." |
| 13:48:42 | <merijn> | That's pretty explicitly clarified in the plusForeignPtr docs |
| 13:48:50 | <dminuoso> | That's not really what I asked about though |
| 13:49:10 | <dminuoso> | That doesnt state whether the newly created foreign ptr will keep the old one alive |
| 13:49:22 | <dminuoso> | Merely that finalizers are invoked with the original address, nothing further |
| 13:49:25 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 256 seconds) |
| 13:49:40 | → | Guest30 joins (~Guest30@ext-1-087.eduroam.chalmers.se) |
| 13:49:50 | <Guest30> | Does anyone have recent experience of using Hugs? |
| 13:49:59 | <merijn> | I mean, the answer seems to be an obvious yes, putting things together |
| 13:50:05 | <merijn> | Guest30: No |
| 13:50:09 | <Guest30> | RIP |
| 13:50:18 | <merijn> | Guest30: I mean, I think someone got it running recently on some machine for shits and giggles |
| 13:50:18 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 13:50:29 | <merijn> | Guest30: But it has not been seriously used by anyone in over 15 years |
| 13:50:35 | <Guest30> | I got it running alright, took some work but no more than an hour or two |
| 13:50:45 | <merijn> | So I would not recommend trying to use it, except for software archeaology reasons |
| 13:51:15 | <Guest30> | I want to use a more modern package with it, but I am not sure how this is done with Hugs. I saw that Cabal doesn't support Hugs anymore |
| 13:51:21 | <Guest30> | E.g I want to use bytestring |
| 13:51:32 | <Guest30> | This seems to depend on GHC.Prim though, so maybe this is completely fruitless? |
| 13:51:33 | <merijn> | dminuoso: ForeignPtrs are pinned and not moved. Now you could hypothesise the runtime *might* free up the few prefix bytes after plusForeignPtr |
| 13:51:44 | <merijn> | dminuoso: But that seems *really* hard for absolutely *tiny* gains |
| 13:52:06 | <dminuoso> | merijn: Who knows! Im making a fixed bytestring builder that works from the end, so I will always have left-overs at the beginning! :P |
| 13:52:07 | <merijn> | So the most logical conclusions is that "no, nothing happens it's an opaque pinned foreign blob and nothing happens until the finalizer frees it" |
| 13:52:21 | <dminuoso> | well, its not the finalizer that freers |
| 13:52:23 | <dminuoso> | thats the point |
| 13:52:25 | <merijn> | dminuoso: That is my understanding of things and nothing has contradicted it so far |
| 13:52:44 | <merijn> | dminuoso: ask in #ghc? |
| 13:52:46 | <dminuoso> | Mmm, fair |
| 13:52:54 | <dminuoso> | thanks for your input |
| 13:52:56 | <merijn> | Guest30: Why are you truing to use Hugs in the first place, tbh? |
| 13:53:04 | × | jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 268 seconds) |
| 13:53:07 | <Guest30> | Smaller codebase |
| 13:53:17 | <Guest30> | GHC has a lot of stuff I don't need |
| 13:53:36 | <merijn> | Guest30: Well, as I said, no one has used it for anything remotely serious in well over 15 years (and even then almost no one used it), so no one who writes code cares about Hugs |
| 13:53:41 | <Guest30> | I am doing research, so this is just a means to an end. I don't care that much about performance etc |
| 13:53:41 | <kuribas> | Guest30: then don't use it? |
| 13:53:43 | × | random-jellyfish quits (~random-je@user/random-jellyfish) (Ping timeout: 260 seconds) |
| 13:53:56 | <kuribas> | Guest30: the stuff that you don't need I mean. |
| 13:54:11 | <merijn> | Guest30: Presumably you do care about "not wasting weeks/months of your research time" on trying to use Hugs? :p |
| 13:54:17 | <dminuoso> | Guest30: That being said, you're probably better off asking on the haskell mailing lists about Hugs. The number of hugs users is really small, and its only there that I ever hear about Hugs. |
| 13:54:23 | <Guest30> | It's is not a matter of just not using it, I wouldn't want it to _be_ in the codebase |
| 13:54:28 | × | jco quits (~jco@90-228-194-139-no542.tbcn.telia.com) (Quit: leaving) |
| 13:54:34 | <merijn> | dminuoso: Well, he seems to want use modern libaries, so Hugs is just right out |
| 13:54:35 | <dminuoso> | Hugs is only ever mentioned in this channel as part of archaic jokes and references. |
| 13:54:42 | <Guest30> | So far I only sunk one morning into this, so I won't give up yet ;) |
| 13:54:59 | <merijn> | Guest30: Please do come back in a month so I can say "I told you so" ;) |
| 13:55:30 | <Guest30> | My supervisor is a huge hugs fan, he will be sad by this sentiment of hugs being a joke :( |
| 13:55:32 | <merijn> | Guest30: Doing research on GHC has the added benefit of having a non-zero chance of it maybe being used :p |
| 13:55:49 | <merijn> | Guest30: I don't think Hugs is a joke. I do think using Hugs in 2022 is a joke :p |
| 13:56:01 | <merijn> | Hugs was amazing...2-2.5 decades ago :) |
| 13:56:08 | <merijn> | Time marches on |
| 13:56:23 | × | mastarija quits (~mastarija@2a05:4f46:e03:6000:9658:d7fb:b925:5ab5) (Ping timeout: 260 seconds) |
| 13:56:28 | <Guest30> | Heh, I guess |
| 13:56:39 | <Guest30> | Doing what I want to do with GHC might take longer though |
| 13:56:58 | <merijn> | Guest30: What kinda research you trying to do? Honestly, the intersection of "I need bytestring" and "I need to play with an implementation" seems...small |
| 13:57:21 | <merijn> | Guest30: Could consider UHC? That's smaller than GHC (afaik) and at least that was (until fairly recently) still actively worked on |
| 13:57:29 | <merijn> | But doesn't have all the extension baggage GHC does |
| 13:57:52 | <Guest30> | Bytestring was just an example |
| 13:58:04 | <Guest30> | I am looking at running haskell in SGX |
| 13:58:19 | <merijn> | hmm, looks like UHC kinda died about 5 years ago |
| 13:58:26 | <merijn> | but that's still more recent than Hugs :p |
| 13:58:53 | <dminuoso> | Guest30: I think GHC will be faster still, due to the fact of being well documented and having loads of people to potentially assist. |
| 13:59:10 | <Guest30> | We already sunk two weeks into that, and sortoff hit a dead end |
| 13:59:37 | → | marinelli joins (~marinelli@gateway/tor-sasl/marinelli) |
| 14:00:40 | → | moonsheep joins (~user@user/moonsheep) |
| 14:07:13 | × | Guest30 quits (~Guest30@ext-1-087.eduroam.chalmers.se) (Quit: Connection closed) |
| 14:12:39 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 256 seconds) |
| 14:16:00 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 14:18:19 | × | eddiejessup_ quits (uid575763@id-575763.tinside.irccloud.com) (Quit: Connection closed for inactivity) |
| 14:18:19 | × | eddiejessup quits (uid575763@id-575763.tinside.irccloud.com) (Quit: Connection closed for inactivity) |
| 14:18:26 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 14:21:45 | → | Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542) |
| 14:23:13 | → | slack1256 joins (~slack1256@191.125.99.74) |
| 14:23:17 | × | Kaipei quits (~Kaiepi@108.175.84.104) (Ping timeout: 268 seconds) |
| 14:25:36 | → | shriekingnoise joins (~shrieking@186.137.167.202) |
| 14:30:45 | → | ft joins (~ft@p508dbd59.dip0.t-ipconnect.de) |
| 14:31:11 | × | mikoto-chan quits (~mikoto-ch@85-76-104-247-nat.elisa-mobile.fi) (Quit: WeeChat 3.6) |
| 14:32:10 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 252 seconds) |
| 14:32:18 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 14:35:50 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Client Quit) |
| 14:36:57 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 14:42:19 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 14:43:17 | → | Kaipei joins (~Kaiepi@108.175.84.104) |
| 14:47:09 | × | vglfr quits (~vglfr@145.224.100.100) (Ping timeout: 260 seconds) |
| 14:48:28 | → | vglfr joins (~vglfr@145.224.100.100) |
| 14:52:01 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 14:52:01 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 14:52:01 | → | wroathe joins (~wroathe@user/wroathe) |
| 14:54:56 | → | irrgit_ joins (~irrgit@89.47.234.26) |
| 14:55:56 | × | xacktm quits (~xacktm@user/xacktm) (Ping timeout: 246 seconds) |
| 14:57:12 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
| 15:07:28 | aliosablack | is now known as reclaim |
| 15:07:39 | reclaim | is now known as chomwitt |
| 15:08:26 | → | bgs joins (~bgs@212-85-160-171.dynamic.telemach.net) |
| 15:09:08 | → | ccapndave joins (~ccapndave@xcpe-62-167-164-99.cgn.res.adslplus.ch) |
| 15:10:15 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 15:14:04 | × | ccapndave quits (~ccapndave@xcpe-62-167-164-99.cgn.res.adslplus.ch) (Read error: Connection reset by peer) |
| 15:14:17 | × | dolio quits (~dolio@130.44.134.54) (Quit: ZNC 1.8.2 - https://znc.in) |
| 15:15:00 | × | Inoperable quits (~PLAYER_1@fancydata.science) (Ping timeout: 248 seconds) |
| 15:17:47 | → | dolio joins (~dolio@130.44.134.54) |
| 15:18:03 | × | dolio quits (~dolio@130.44.134.54) (Client Quit) |
| 15:21:33 | → | Inoperable joins (~PLAYER_1@fancydata.science) |
| 15:21:50 | → | dolio joins (~dolio@130.44.134.54) |
| 15:21:55 | → | thyriaen joins (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) |
| 15:23:15 | × | coot quits (~coot@213.134.171.3) (Quit: coot) |
| 15:23:59 | × | moonsheep quits (~user@user/moonsheep) (Remote host closed the connection) |
| 15:25:07 | × | stackdroid18 quits (14094@user/stackdroid) (Quit: hasta la vista... tchau!) |
| 15:26:49 | × | luseerr quits (~luseerr@145.224.100.107) (Quit: Client closed) |
| 15:31:25 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 256 seconds) |
| 15:33:05 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 15:39:46 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 15:40:05 | → | xacktm joins (~xacktm@user/xacktm) |
| 15:43:10 | → | azimut_ joins (~azimut@gateway/tor-sasl/azimut) |
| 15:43:47 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Quit: WeeChat 3.7.1) |
| 15:44:45 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 15:45:29 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 15:49:38 | → | freeside joins (~mengwong@122.11.214.147) |
| 15:50:22 | → | coot joins (~coot@213.134.171.3) |
| 15:50:49 | → | Tuplanolla joins (~Tuplanoll@91-159-68-194.elisa-laajakaista.fi) |
| 15:52:21 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
| 15:53:59 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 260 seconds) |
| 15:54:23 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) |
| 15:55:27 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 15:58:30 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) (Ping timeout: 240 seconds) |
| 16:00:12 | × | july541[m] quits (~july541ma@2001:470:69fc:105::1:e416) (Quit: You have been kicked for being idle) |
| 16:01:47 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 16:02:10 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 240 seconds) |
| 16:02:52 | → | cafkafk joins (~cafkafk@fsf/member/cafkafk) |
| 16:03:05 | × | ubert quits (~Thunderbi@77.119.222.7.wireless.dyn.drei.com) (Quit: ubert) |
| 16:03:05 | ubert1 | is now known as ubert |
| 16:04:37 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 16:10:11 | <xilo> | hi, could someone take a look at this trivial error massage? I guess a simple import should solve it https://paste.tomsmeding.com/MSOSJmEI |
| 16:11:05 | <geekosaur> | an import won't help here |
| 16:11:18 | <Rembane> | xilo: You have redefined `Nothing` in your module `Tree.hs` at line 3. If you don't want to use Maybe you can go `import Prelude hiding (Nothing)` |
| 16:11:26 | × | ystael quits (~ystael@user/ystael) (Quit: Lost terminal) |
| 16:11:47 | <geekosaur> | but better would be to use some other name |
| 16:12:32 | → | eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) |
| 16:12:37 | <xilo> | ok cool, ty geekosaur |
| 16:13:42 | × | kenran` quits (~user@user/kenran) (Remote host closed the connection) |
| 16:21:04 | × | machinedgod quits (~machinedg@clnet-p10-126.ikbnet.co.at) (Ping timeout: 268 seconds) |
| 16:23:32 | → | sh1n joins (~sh1n@186.152.126.112) |
| 16:23:59 | × | freeside quits (~mengwong@122.11.214.147) (Ping timeout: 260 seconds) |
| 16:27:08 | × | InstX1 quits (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 260 seconds) |
| 16:28:41 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:9b29:5558:d4cc:17cc) (Quit: WeeChat 2.8) |
| 16:32:47 | × | chromoblob quits (~user@37.113.164.122) (Ping timeout: 268 seconds) |
| 16:36:24 | → | chromoblob joins (~user@37.113.164.122) |
| 16:36:27 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 260 seconds) |
| 16:37:21 | → | janus joins (janus@anubis.0x90.dk) |
| 16:37:24 | × | bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection) |
| 16:38:44 | × | euandreh quits (~Thunderbi@179.214.113.107) (Remote host closed the connection) |
| 16:39:25 | × | coot quits (~coot@213.134.171.3) (Quit: coot) |
| 16:39:46 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 16:39:57 | × | califax quits (~califax@user/califx) (Quit: ZNC 1.8.2 - https://znc.in) |
| 16:39:59 | → | ystael joins (~ystael@user/ystael) |
| 16:41:15 | → | califax joins (~califax@user/califx) |
| 16:45:42 | × | chele quits (~chele@user/chele) (Remote host closed the connection) |
| 16:55:41 | × | califax quits (~califax@user/califx) (Ping timeout: 255 seconds) |
| 16:55:52 | → | califax_ joins (~califax@user/califx) |
| 16:57:05 | califax_ | is now known as califax |
| 16:58:11 | × | razetime quits (~quassel@117.254.35.246) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 17:09:50 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 240 seconds) |
| 17:10:17 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 17:10:45 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 17:14:43 | × | chromoblob quits (~user@37.113.164.122) (Ping timeout: 268 seconds) |
| 17:15:21 | × | MajorBiscuit quits (~MajorBisc@145.94.173.65) (Ping timeout: 268 seconds) |
| 17:15:56 | × | cafkafk quits (~cafkafk@fsf/member/cafkafk) (Ping timeout: 255 seconds) |
| 17:17:45 | × | kuribas quits (~user@ip-188-118-57-242.reverse.destiny.be) (Quit: ERC (IRC client for Emacs 27.1)) |
| 17:18:25 | → | cafkafk joins (~cafkafk@fsf/member/cafkafk) |
| 17:20:41 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 17:21:47 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 17:21:49 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 17:21:56 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 17:23:19 | × | zeenk quits (~zeenk@2a02:2f04:a208:3600::7fe) (Quit: Konversation terminated!) |
| 17:27:19 | × | CiaoSen quits (~Jura@p200300c9571247002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 17:30:51 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 17:35:09 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 17:36:36 | × | iqubic quits (~iqubic@2601:602:9502:c70:76bd:8eff:1f39:3cbe) (Quit: Client closed) |
| 17:36:51 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 17:38:11 | × | mbuf quits (~Shakthi@49.204.121.98) (Quit: Leaving) |
| 17:40:42 | → | euandreh joins (~Thunderbi@179.214.113.107) |
| 17:40:58 | × | zmt01 quits (~zmt00@user/zmt00) (Quit: Leaving) |
| 17:42:44 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds) |
| 17:43:10 | × | euandreh quits (~Thunderbi@179.214.113.107) (Remote host closed the connection) |
| 17:43:57 | → | euandreh joins (~Thunderbi@179.214.113.107) |
| 17:46:23 | × | jinsun quits (~jinsun@user/jinsun) (Quit: No Ping reply in 180 seconds.) |
| 17:46:25 | → | zmt00 joins (~zmt00@user/zmt00) |
| 17:48:49 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 17:54:12 | → | econo joins (uid147250@user/econo) |
| 17:57:03 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds) |
| 18:00:40 | <EvanR> | well if I thought I knew vaguely what a random variable is supposed to be, now there's this analogy |
| 18:00:44 | <EvanR> | https://i.imgur.com/OKc9PHq.png |
| 18:01:16 | × | enoq quits (~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7) (Quit: enoq) |
| 18:01:23 | <EvanR> | and to explain what Reader is to a mathematician apparently you tell them it's basically a random variable |
| 18:01:35 | × | nschoe quits (~q@141.101.51.197) (Ping timeout: 268 seconds) |
| 18:02:16 | <geekosaur> | mathematician, or statistician? |
| 18:03:06 | → | jmdaemon joins (~jmdaemon@user/jmdaemon) |
| 18:03:52 | <dolio> | What article is that from? |
| 18:05:01 | <EvanR> | https://ncatlab.org/nlab/show/random+variable |
| 18:05:32 | <dolio> | Well, then, it hardly seems fair to say that you need to explain reader as random variables because the article specifically on random variables only mentions that connection. |
| 18:06:29 | <EvanR> | well, you don't need to |
| 18:07:06 | <EvanR> | unrelated, how the hell is a random variable a reader monad |
| 18:08:19 | <sclv> | yeah that's unfortunate. there's a much better mathematical way to explain the reader monad |
| 18:08:36 | <sclv> | first we assume familiarity with fibered topoi |
| 18:08:54 | <EvanR> | lol |
| 18:09:23 | <dolio> | The obvious category thing to talk about is 'generalized elements', which you might talk of in all kinds of contexts. |
| 18:10:01 | <dolio> | It's slightly different, I suppose, because it's an internal hom, but otherwise very similar. |
| 18:10:01 | <EvanR> | a random variable is a generalized element? or |
| 18:11:02 | <ozkutuk[m]> | Is there a way to express that two benchmarks are alternative implementations of the concept in Criterion? I am looking to compare the two approaches |
| 18:11:06 | <davean> | EvanR: Its a random variable, because the users of your library are the average programmer, and the average programmer is a monkey at a type writer, so random typing on a keyboard sets the reader's content - there is your random variable! |
| 18:11:49 | <dolio> | A generalized element of `B` is a map `A -> B`. The reader monad is like a monad for generalized elements with a specific domain. |
| 18:12:08 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 18:13:14 | <dolio> | Turning a global element into a generalized element is the unit, and turning a generalized element of generalized elements into a generalized element is the multiplication. |
| 18:15:27 | <EvanR> | does that multiplication have anything to do with randomness |
| 18:17:07 | <dolio> | If you have a random variable of random variables, you can get a random variable from it. |
| 18:17:46 | <ozkutuk[m]> | Okay I have found this issue, so apparently not https://github.com/haskell/criterion/issues/151 |
| 18:19:28 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 18:19:39 | <EvanR> | composition of random variables, makes sense. Maybe this is really talking about a generalization of reader |
| 18:19:55 | <dolio> | It's not super clear that reader is the right thing. |
| 18:20:13 | <dolio> | But I don't know random variables that well. |
| 18:22:29 | <dolio> | Like, if you're using `2 ->`, and you have one random variable that picks between red and green, and another that picks from blue and orange, then using reader to join the variable that randomly picks one of those variables is going to lack some colors. |
| 18:22:41 | <dolio> | I guess it's still a random variable, though. Just maybe not the one you want. |
| 18:22:42 | <sclv> | i mean there's a good probability monad with a sound basis but its... just not the reader monad |
| 18:22:51 | × | Cale quits (~cale@cpef48e38ee8583-cm30b7d4b3fc20.cpe.net.cable.rogers.com) (Remote host closed the connection) |
| 18:24:30 | <dolio> | There's another, related monad, which is `Σ[ A ∈ Type ] (A -> B)`. The unit uses A = (), and the join takes the product of the domains. That might be more along the lines of what you want. |
| 18:27:18 | <EvanR> | rather than red green, blue orange, if you had X1 and X2 on the same domain, then Y = 50% X1, 50% X2... you could smush Y to get Z without wondering where any colors went |
| 18:27:57 | <EvanR> | but yeah that's not what I though Reader was about |
| 18:28:43 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 268 seconds) |
| 18:31:06 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 18:31:48 | × | beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 268 seconds) |
| 18:35:55 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds) |
| 18:39:12 | → | beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
| 18:41:56 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 18:42:34 | <dminuoso> | Is there a memcpy variant that does not use FFI in base? |
| 18:43:25 | <davean> | In *base*? That seems a very strict requirement |
| 18:43:31 | × | beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 256 seconds) |
| 18:43:43 | <dminuoso> | Well, or anything that GHC comes with is fine too |
| 18:44:14 | <davean> | There are things like copyArray# which aren't QUITE what you want probably. |
| 18:44:26 | <dminuoso> | Yeah Ive seen that too |
| 18:44:36 | <davean> | I prefer to use packages |
| 18:44:54 | <davean> | it wouldn't be appropriate for base to have memcpy really. |
| 18:44:54 | <dminuoso> | Well, Im not going to depend on a package for the sole purpose of copying a small byte buffer. That's a bit extreme |
| 18:45:01 | <dminuoso> | It does |
| 18:45:09 | <dminuoso> | https://hackage.haskell.org/package/base-4.17.0.0/docs/Foreign-Marshal-Utils.html#v:copyBytes |
| 18:45:18 | <dminuoso> | Which is just a memcpy binding |
| 18:45:19 | <davean> | yes, for that purpose |
| 18:45:33 | <davean> | I meant a more generalized haskell-ish oen |
| 18:46:16 | <dminuoso> | I mean I can just cook up my own small writeWord64OffAddr# + writeWord8OffAddr# look |
| 18:46:22 | <dminuoso> | s/look/loop\ |
| 18:46:54 | <dminuoso> | In my use case, it will never exceed 255 bytes, and in most cases will likely be around 10-20 bytes |
| 18:47:03 | <dminuoso> | memcpy is a bit over the top for that |
| 18:47:03 | <EvanR> | copyArray in Foreign.Marshall.Array doesn't seen to use FFI directly, but primitives |
| 18:47:15 | <dminuoso> | EvanR: Of course it does. |
| 18:47:21 | <dminuoso> | copyBytes dest src size = do _ <- memcpy dest src (fromIntegral size) return () |
| 18:47:25 | <dminuoso> | foreign import ccall unsafe "string.h" memcpy :: Ptr a -> Ptr a -> CSize -> IO (Ptr a) |
| 18:47:42 | <dminuoso> | Oh wait, there'sd another copyArray? |
| 18:47:45 | <EvanR> | copy... Array in Foreign.Marshall.Array? |
| 18:47:59 | <dminuoso> | copyArray dest src size = copyBytes dest src (size * sizeOf (undefined :: a)) |
| 18:48:06 | <dminuoso> | So that's just a copyBytes wrapper |
| 18:48:12 | <dminuoso> | Which in turn uses memcpy |
| 18:48:33 | <EvanR> | so what was I just looking at, ffs |
| 18:48:33 | <davean> | primitive's copyPtr also binds copyBytes |
| 18:48:36 | <dminuoso> | It's somewhat annoying that ghc-prim doesnt provide IO primop wrappers. :( |
| 18:48:38 | <EvanR> | nevermind me |
| 18:48:59 | <dminuoso> | I guess Ill just cook up the loop by hand then |
| 18:49:11 | → | srz joins (~srz@devil.dm.uba.ar) |
| 18:49:13 | <davean> | dminuoso: why do you not mish to use copyBytes? |
| 18:49:20 | <davean> | Your requirements seem very unclear |
| 18:49:28 | <davean> | well, the reasons for them |
| 18:49:42 | <dminuoso> | davean: because for 10-20 bytes on average the ffi overhead is going to be more costly |
| 18:49:51 | <EvanR> | when the memory is not foreign it's seems a bit annoying to have to use ffi |
| 18:49:53 | <dminuoso> | even if its unsafe, there's still a priceq to pay |
| 18:50:16 | <geekosaur> | ffi overhead should be ~0 for unsafe |
| 18:50:25 | × | nek0 quits (~nek0@2a01:4f8:222:2b41::12) (Quit: The Lounge - https://thelounge.chat) |
| 18:50:32 | × | eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 18:50:51 | <dminuoso> | Mmm, I was sure I was told otherwise |
| 18:50:52 | <davean> | Interestingly FFI can sometimes be faster than primops |
| 18:51:39 | <geekosaur> | last I checked an unsafe ffi just compiled as a direct call from the code, with the only overhead being the call itself |
| 18:51:55 | <geekosaur> | primops still make calls since they call into cmm |
| 18:52:24 | <geekosaur> | so you'd only win if it were a compiler primitive that generated the copy code in place |
| 18:52:44 | <davean> | dminuoso: Honestly, most Haskellers don't understand GHC performance |
| 18:52:54 | <davean> | test what you read. |
| 18:52:57 | <EvanR> | that's actually a pretty helpful explanation of unsafe, if that's what it does |
| 18:54:17 | × | fserucas quits (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Ping timeout: 256 seconds) |
| 18:55:02 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 18:55:13 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 18:55:47 | → | LemanR joins (~LemanR@pool-74-109-28-147.phlapa.fios.verizon.net) |
| 18:57:03 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 18:58:19 | × | youziqi quits (~youziqi@103.37.140.121) (Ping timeout: 268 seconds) |
| 18:58:20 | → | califax joins (~califax@user/califx) |
| 18:59:21 | × | lyle quits (~lyle@104.246.145.85) (Quit: WeeChat 3.7.1) |
| 18:59:52 | → | youziqi joins (~youziqi@103.37.140.125) |
| 19:01:05 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 256 seconds) |
| 19:02:09 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) |
| 19:03:47 | → | nek0 joins (~nek0@2a01:4f8:222:2b41::12) |
| 19:04:53 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 19:06:30 | × | lechner quits (~lechner@debian/lechner) (Remote host closed the connection) |
| 19:06:30 | × | Vajb quits (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d) (Read error: Connection reset by peer) |
| 19:07:02 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) |
| 19:07:54 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds) |
| 19:10:32 | <EvanR> | T minus half 15 days ish until advent of code |
| 19:10:41 | <EvanR> | half a month |
| 19:11:07 | <EvanR> | get your editor macros and DSLs ready |
| 19:11:11 | → | Cale joins (~cale@cpef48e38ee8583-cm30b7d4b3fc20.cpe.net.cable.rogers.com) |
| 19:12:35 | → | lechner joins (~lechner@debian/lechner) |
| 19:13:43 | → | emmanuelux joins (~emmanuelu@user/emmanuelux) |
| 19:14:41 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 19:19:34 | <LemanR> | (I asked on xmonad but figured this fits haskell question as well) can someone suggest o resource about reading haskell documentation? atm trying to read https://hackage.haskell.org/package/xmonad-contrib-0.17.1/docs/XMonad-Actions-TagWindows.html but am new to haskell. |
| 19:20:50 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 19:28:32 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 268 seconds) |
| 19:28:36 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 19:29:31 | → | motherfsck joins (~motherfsc@user/motherfsck) |
| 19:34:29 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 19:36:20 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) (Remote host closed the connection) |
| 19:37:45 | × | LemanR quits (~LemanR@pool-74-109-28-147.phlapa.fios.verizon.net) (Quit: Client closed) |
| 19:37:59 | → | caryhartline joins (~caryhartl@2600:1700:2d0:8d30:1d0b:eb23:aba0:7ca3) |
| 19:39:01 | <sm> | oh god AoC already |
| 19:40:32 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 19:41:03 | <sm> | LemanR: a doc for reading haskell docs ? That kind of doc you're reading is generated by haddock - which has its own in depth user guide - but what's giving trouble ? |
| 19:41:33 | → | Vajb joins (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d) |
| 19:43:58 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) |
| 19:44:38 | → | LemanR joins (~LemanR@pool-74-109-28-147.phlapa.fios.verizon.net) |
| 19:45:56 | → | wrengr joins (~wrengr@201.59.83.34.bc.googleusercontent.com) |
| 19:47:50 | × | mcglk quits (~mcglk@131.191.49.120) (Read error: Connection reset by peer) |
| 19:48:02 | × | cafkafk quits (~cafkafk@fsf/member/cafkafk) (Ping timeout: 255 seconds) |
| 19:49:37 | → | coot joins (~coot@213.134.171.3) |
| 19:50:07 | × | mmhat quits (~mmh@p50857d40.dip0.t-ipconnect.de) (Ping timeout: 268 seconds) |
| 19:53:13 | × | marinelli quits (~marinelli@gateway/tor-sasl/marinelli) (Quit: marinelli) |
| 19:59:16 | <LemanR> | I found https://hackage.haskell.org/package/xmonad-contrib-0.17.1/docs/XMonad-Doc-Developing.html so I should be in good hands |
| 19:59:54 | <LemanR> | will need time to do a long format video on haskell. |
| 20:00:27 | <geekosaur> | if you run across things you think should be mentioned in there, feel free to file an issue; we're currently reworking the docs, some of which haven't been touched in 15 years |
| 20:01:17 | → | DDR joins (~DDR@2604:3d08:4c7f:8250:7335:db3e:c155:4272) |
| 20:01:45 | <geekosaur> | I have sensory processing issues that keep me from doing much with videos in particular, so I can't help much there |
| 20:03:19 | → | mmhat joins (~mmh@p200300f1c71c15a1ee086bfffe095315.dip0.t-ipconnect.de) |
| 20:05:03 | <EvanR> | haddocks contain too much information, we need videos to dilute the information in space and time |
| 20:07:34 | → | gmg joins (~user@user/gehmehgeh) |
| 20:09:14 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 268 seconds) |
| 20:10:22 | × | LemanR quits (~LemanR@pool-74-109-28-147.phlapa.fios.verizon.net) (Quit: Client closed) |
| 20:18:40 | → | InstX1 joins (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) |
| 20:20:47 | → | zeenk joins (~zeenk@2a02:2f04:a208:3600::7fe) |
| 20:20:48 | <sm> | tooling that helps produce more complete docs could help a lot. Assistance/guidance/best practices for api docs, readme, cabal synopses, changelogs & release notes, hackage presentation, hoogle, errors database, announcements.. all simplified and under one roof |
| 20:21:28 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 20:21:59 | → | merijn joins (~merijn@86.86.29.250) |
| 20:22:47 | × | mmhat quits (~mmh@p200300f1c71c15a1ee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 20:25:29 | → | CiaoSen joins (~Jura@p200300c9571247002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 20:26:30 | × | merijn quits (~merijn@86.86.29.250) (Ping timeout: 240 seconds) |
| 20:29:45 | → | nschoe joins (~q@2a01:e0a:8e:a190:ed71:b953:4bd7:bd1) |
| 20:32:30 | × | InstX1 quits (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 240 seconds) |
| 20:36:05 | → | mmhat joins (~mmh@p200300f1c71c150dee086bfffe095315.dip0.t-ipconnect.de) |
| 20:38:24 | → | pavonia joins (~user@user/siracusa) |
| 20:44:45 | → | Guest75 joins (~Guest75@178.141.177.81) |
| 20:46:43 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection) |
| 20:47:56 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 20:49:24 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 20:49:31 | → | kenaryn joins (~aurele@cre71-h03-89-88-44-27.dsl.sta.abo.bbox.fr) |
| 20:52:43 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
| 20:55:25 | × | c0c0 quits (~coco@85.195.206.136) (Quit: WeeChat 3.5) |
| 20:58:25 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) (Remote host closed the connection) |
| 21:00:36 | × | coot quits (~coot@213.134.171.3) (Quit: coot) |
| 21:03:14 | → | James24 joins (~James27@pop.92-184-124-93.mobile.abo.orange.fr) |
| 21:03:43 | → | aliosablack joins (~chomwitt@2a02:587:7a0a:c00:1ac0:4dff:fedb:a3f1) |
| 21:03:50 | × | chomwitt quits (~chomwitt@2a02:587:7a0a:c00:1ac0:4dff:fedb:a3f1) (Read error: Connection reset by peer) |
| 21:04:47 | × | nschoe quits (~q@2a01:e0a:8e:a190:ed71:b953:4bd7:bd1) (Ping timeout: 260 seconds) |
| 21:05:26 | × | azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 21:05:54 | → | fserucas joins (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) |
| 21:16:27 | → | gqplox joins (~textual@97e5fa6a.skybroadband.com) |
| 21:22:41 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 21:31:06 | × | euandreh quits (~Thunderbi@179.214.113.107) (Read error: Connection reset by peer) |
| 21:31:18 | → | euandreh2 joins (~Thunderbi@179.214.113.107) |
| 21:31:45 | × | James24 quits (~James27@pop.92-184-124-93.mobile.abo.orange.fr) (Quit: Leaving) |
| 21:33:39 | euandreh2 | is now known as euandreh |
| 21:35:23 | × | gqplox quits (~textual@97e5fa6a.skybroadband.com) (Quit: Textual IRC Client: www.textualapp.com) |
| 21:47:07 | × | srz quits (~srz@devil.dm.uba.ar) (Ping timeout: 256 seconds) |
| 21:49:45 | → | beteigeuze joins (~Thunderbi@a79-169-109-107.cpe.netcabo.pt) |
| 21:55:18 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 268 seconds) |
| 21:55:30 | × | nibelungen quits (~asturias@2001:19f0:7001:638:5400:3ff:fef3:8725) (Ping timeout: 240 seconds) |
| 21:56:34 | → | nibelungen joins (~asturias@2001:19f0:7001:638:5400:3ff:fef3:8725) |
| 21:57:02 | → | machinedgod joins (~machinedg@clnet-b05-118.ikbnet.co.at) |
| 21:57:07 | → | slac13810 joins (~slack1256@191.125.227.75) |
| 21:58:54 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) |
| 21:59:35 | × | slack1256 quits (~slack1256@191.125.99.74) (Ping timeout: 256 seconds) |
| 22:03:10 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:ac76:5dba:fbad:434b) (Ping timeout: 240 seconds) |
| 22:04:43 | → | TonyStone31 joins (~TonyStone@cpe-74-76-57-186.nycap.res.rr.com) |
| 22:05:37 | → | jero98772 joins (~jero98772@2800:484:1d80:d8ce:efcc:cbb3:7f2a:6dff) |
| 22:05:49 | × | bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 260 seconds) |
| 22:07:47 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 22:11:46 | → | slack1256 joins (~slack1256@191.126.227.73) |
| 22:13:59 | × | slac13810 quits (~slack1256@191.125.227.75) (Ping timeout: 260 seconds) |
| 22:14:47 | <johnw> | if there are aeson experts here, I have strinfied json within json objects. Reading it out is causing `jstring` from aeson to blow out my profiles. Are there any known ways to improve this situation? |
| 22:17:50 | <dminuoso> | What does "blow out" mean? |
| 22:18:03 | <dminuoso> | And what is a 'jstring'? |
| 22:18:21 | <dminuoso> | Oh, `jstring :: Parser Text` I see. |
| 22:22:40 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 22:22:44 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 22:23:31 | <dminuoso> | johnw: Curious though, what do you mean by blowing out profiles? |
| 22:24:54 | <johnw> | like, very simple examples moving >1 GB through the allocator (not heap, though), where jstring is at the top of my profile results |
| 22:25:14 | <johnw> | I'm expecting memory use to be ~19 MB tops |
| 22:25:27 | → | slac26443 joins (~slack1256@191.126.99.192) |
| 22:25:33 | × | machinedgod quits (~machinedg@clnet-b05-118.ikbnet.co.at) (Read error: Connection reset by peer) |
| 22:25:40 | → | machined1od joins (~machinedg@clnet-b05-118.ikbnet.co.at) |
| 22:26:32 | <geekosaur> | there's a big difference between allocator and actual heap usage |
| 22:26:46 | → | chromoblob joins (~user@37.113.164.122) |
| 22:26:46 | <johnw> | oh I know |
| 22:26:58 | <johnw> | but in general, high allocator activity usually means lots of wasted CPU time |
| 22:26:59 | <geekosaur> | if it's not actually using that much heap then I wouldn't worry: the nursery is very fast at both allocation and GC |
| 22:27:19 | <Guest75> | Having a type: data T1 = V1 | V2 Integer | V3 String | V4 String T1 can one easily get sth equivalent to {"T1": [{"constructor": "V1"}, {"constructor": "V2", "params": ["Integer"]}, {"constructor": "V3", "params": ["String"]}, {"constructor": "V4", "params": ["T1", "String"]}}? Will DeriveGeneric solve the trick? |
| 22:27:19 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Read error: Connection reset by peer) |
| 22:27:21 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 256 seconds) |
| 22:27:28 | <geekosaur> | well, it means for example there's no streaming optimization |
| 22:27:37 | <geekosaur> | sometimes you just can't get that |
| 22:27:42 | <dminuoso> | Guest75: Just write out the instance by hand. |
| 22:27:59 | × | slack1256 quits (~slack1256@191.126.227.73) (Ping timeout: 268 seconds) |
| 22:28:09 | <johnw> | well, it's not just high in the profile by allocation, but also by CPU |
| 22:28:22 | <dminuoso> | johnw: Mmm, can you share the simplified core output? |
| 22:28:33 | <geekosaur> | aeson is not known to be the most optimal JSON parser |
| 22:28:41 | <johnw> | for which part? this is happening under several layers of aeson |
| 22:28:42 | <Guest75> | dminuoso: well, my actual "desired" type is bigger:-) https://github.com/andrewboltachev/pyparts/blob/master/src/Lib.hs#L68 |
| 22:28:43 | <geekosaur> | in fact iirc it's pretty slow and wasteful |
| 22:28:53 | <geekosaur> | you might also play with e.g. waargonaut |
| 22:29:10 | dminuoso | would rather just handroll a flatparse-based JSON parser |
| 22:29:16 | <Guest75> | geekosaur: is Aeson the most fancy one? |
| 22:29:24 | <dminuoso> | aeson has the fanciest dependency tree. |
| 22:29:38 | <dminuoso> | once you have aeson, every second package on hackage is a transitive dependency. |
| 22:29:49 | × | michalz quits (~michalz@185.246.207.203) (Remote host closed the connection) |
| 22:30:04 | <johnw> | do I need the +cffi flag for aeson in my library cabal files, as well as my application cabal file? |
| 22:30:14 | <geekosaur> | speaking of, Guest75, since that looked like JSON to me it's possible that aeson-schema has something for you? |
| 22:30:54 | <Guest75> | geekosaur: yeah. as I beginner I missed a lot of existing stuff |
| 22:31:36 | <Guest75> | most desired feature for me, 'cause of what I've built this is https://github.com/andrewboltachev/pyparts/blob/master/src/Lib.hs#L77 "funnel" feature |
| 22:31:37 | <dminuoso> | johnw: You need it in your cabal.project only. |
| 22:32:00 | <dminuoso> | johnw: cabal flags are not communicatable via dependencies, they are project-levels configurations |
| 22:32:14 | <Guest75> | which allows to build schema: https://github.com/andrewboltachev/pyparts/blob/master/src/Lib.hs#L317 in short increments |
| 22:32:18 | → | michalz joins (~michalz@185.246.207.203) |
| 22:32:56 | <dminuoso> | https://hackage.haskell.org/package/aeson-2.1.1.0/docs/src/Data.Aeson.Parser.UnescapePure.html#unescapeTextIO |
| 22:32:59 | <dminuoso> | Wow that looks disgusting. :( |
| 22:33:13 | × | michalz quits (~michalz@185.246.207.203) (Remote host closed the connection) |
| 22:33:25 | × | use-value quits (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) (Remote host closed the connection) |
| 22:33:25 | <johnw> | thanks |
| 22:33:27 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 22:33:30 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 22:33:40 | <Guest75> | is that code so complex because it's optimized somehow? |
| 22:33:44 | → | use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) |
| 22:34:16 | <dminuoso> | Nah, that's mostly just the price for UTF8 encoding. |
| 22:34:41 | <Guest75> | ah yes... OverloadedStrings, T.pack, TL.unpack, BLU.fromString etc |
| 22:36:21 | <Guest75> | that's like a state machine there... |
| 22:36:58 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 22:36:59 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 22:37:51 | × | chromoblob quits (~user@37.113.164.122) (Ping timeout: 268 seconds) |
| 22:38:07 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 256 seconds) |
| 22:53:53 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds) |
| 22:55:51 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 22:59:08 | × | `2jt quits (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) (Ping timeout: 260 seconds) |
| 23:00:11 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds) |
| 23:02:33 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 23:02:39 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 23:06:30 | × | TonyStone31 quits (~TonyStone@cpe-74-76-57-186.nycap.res.rr.com) (Quit: Leaving) |
| 23:15:22 | <Axman6> | Guest75: that particular JSON encoding isn't something I've seen elsewhere, if you look at the SumEncoding for aeson you'll see how things are usually done (https://hackage.haskell.org/package/aeson-2.1.1.0/docs/Data-Aeson.html#t:SumEncoding) the closest you'd get is TaggedObject { tagFieldName = "constructor", contentsFieldName = "params" }, but that won't store the fields in an array (... but worth testing, it's not clear to me what happens when you don't ha |
| 23:15:22 | <Axman6> | ve record fields names) |
| 23:16:01 | <Axman6> | dminuoso: is there a flatparse json decoder yet? I started writing one and then remembered how tedious it would be :P |
| 23:17:29 | <Guest75> | Axman6: great, thanks! That should be much better, 'cause parsing ADT definition manually is a hard way |
| 23:18:15 | <Axman6> | _if_ you can use one of the formats Aeson supports, then generics are usually a good option, but sometimes people insist on weird encodings which aren't well supported |
| 23:19:01 | <Axman6> | Also look at the `Options` type to see what modifiers you can apply https://hackage.haskell.org/package/aeson-2.1.1.0/docs/Data-Aeson.html#t:Options |
| 23:20:03 | <monochrom> | Woah, undocumented GHC option -dno-suppress-stg-free-vars which is deprecated and replaced by undocumented option -dno-suppress-stg-exts |
| 23:20:49 | <Guest75> | Aeson should probably be sufficient ('cause I'm based on it's types and stanard ones like String/Integer etc) |
| 23:22:53 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 23:23:45 | <EvanR> | String... |
| 23:26:00 | <Axman6> | Don't use String for data - for errors it's ok, but generally you want to use Text (and it will play even better with Aeson) |
| 23:27:05 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 23:31:54 | → | twb joins (~twb@159-196-230-25.9fc4e6.mel.nbn.aussiebb.net) |
| 23:32:30 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 23:32:33 | <monochrom> | I propose to KISS by re-interpreting "equivalent to" very liberally and relaxedly. Use DeriveGeneric and derive Generic, yes. Then aeson will auto-generate a format. This format is different from the one asked for, sure, but it is "equivalent". |
| 23:33:04 | <twb> | So I use gitit and it works Just Fine. My only beef is when nobody is using it, it's still constantly using a bit of CPU (1% to 3% of a core), and always in kernel "R" state, not "S" state. |
| 23:33:27 | <twb> | Is this a well-known thing, like "oh just add +RTS -idle-harder -RTS to the command line" ? |
| 23:33:28 | <geekosaur> | +RTS -V0? |
| 23:34:01 | <geekosaur> | the RTS wakes up every couple hundredths of a second to do profiling if enabled, check if a GC is needed, etc. |
| 23:34:59 | <twb> | Is there any downside to that? |
| 23:35:32 | <twb> | The docs say "don't use -V, use -C or -i" |
| 23:35:36 | <geekosaur> | it ends up checking that at entry to every function |
| 23:36:06 | <geekosaur> | but if you really want to knock down idle runtime at the expense of general runtime it'll work |
| 23:36:52 | <geekosaur> | also if you're doing lots of FFI to functions that don't like to be interrupted by SIGALRM every couple hundredths of a second |
| 23:37:25 | <twb> | AFAIK gitit doesn't do much FFI; it's pretty much just pandoc + fork+exec git + barebones HTTP |
| 23:38:16 | <geekosaur> | yes, if you had thta particular problem you would know about it, trust me 🙂 |
| 23:38:17 | <Axman6> | might be worth compiling it with profiling (if needed?) and getting it to dump an event log to see what it's actually doing |
| 23:38:38 | <twb> | I don't care *that* much |
| 23:39:00 | <geekosaur> | because FFI would be failing in very odd ways |
| 23:39:04 | <twb> | Really my goal is "make gitit not show at the top of top(1) all the time" and maybe "reduce electricity bill slightly |
| 23:39:19 | × | fserucas quits (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Ping timeout: 256 seconds) |
| 23:40:26 | <twb> | OK this whole discussion is moot: Nov 15 10:40:12 heavy gitit[4157461]: gitit: Most RTS options are disabled. Link with -rtsopts to enable them. |
| 23:40:49 | <twb> | I'll just put up with it :P |
| 23:41:34 | <geekosaur> | I would also second profiling, though, as xmonad doesn't show in the top of top |
| 23:42:00 | <Axman6> | +RTS --help would tell you what is enabled I think, and there might be some useful things you can do without recompiling |
| 23:42:09 | × | machined1od quits (~machinedg@clnet-b05-118.ikbnet.co.at) (Ping timeout: 256 seconds) |
| 23:42:12 | <twb> | Maybe something I did in the systemd-level hardening pissed off the runtime |
| 23:43:20 | <twb> | https://paste.debian.net/1260728/ |
| 23:43:48 | <twb> | MemoryDenyWriteExecute=yes maybe if ghc gets pissy about "NX bit" |
| 23:44:23 | <Axman6> | I'd be surprised, GHC doesn't do any runtime code generation, which is what usually gets tripped up by that, afaiui |
| 23:44:27 | <monochrom> | Oddly, that hypothesis can be easily tested by lauching gitit from a normal shell prompt. |
| 23:45:41 | × | Maeda quits (~Maeda@91-161-10-149.subs.proxad.net) (Ping timeout: 268 seconds) |
| 23:46:57 | <twb> | Yeah I did just test with all those commented out. gitit uses no CPU until the first HTTP request, thereafter it stays in R state. |
| 23:47:24 | <geekosaur> | that rules out -V |
| 23:47:30 | × | aliosablack quits (~chomwitt@2a02:587:7a0a:c00:1ac0:4dff:fedb:a3f1) (Ping timeout: 240 seconds) |
| 23:47:52 | <geekosaur> | profiling is warranted |
| 23:48:09 | <monochrom> | Does gitit use threads? Is -threaded worth it? |
| 23:48:41 | <twb> | I have no idea if it uses threads. https://github.com/jgm/gitit is the codebase. |
| 23:49:11 | <monochrom> | No worries, I was just hoping that someone else already knows. |
| 23:49:43 | <twb> | And the only interesting thing Debian seems to do is remove plugins at configure time: https://sources.debian.org/src/gitit/0.13.0.0%2Bdfsg-2/debian/rules/#L13 |
| 23:50:13 | <twb> | I sort of assume happstack http stuff uses green threads because how could an httpd *not* be threaded |
| 23:50:36 | <twb> | I can at least see there is 1 process and 6 threads inside it, looking at it from the linux side |
| 23:54:09 | → | slack1256 joins (~slack1256@186.11.56.146) |
| 23:54:20 | <Guest75> | Axman6: thanks for advice on Strings vs. Text. Btw I again realized I need JSON for the schema of the ADT, not for the data (and for the data too in fact). Having schema for ADT want to generate/construct a piece of JavaScript (ReactJS) UI, where e.g. one might make up valid tree structure of that type. I'm thinking I might put the whole thing the |
| 23:54:21 | <Guest75> | other way: have "thing X" with all the metadata, incl. UI (e.g. icons) and then from it generate the ADT def |
| 23:55:10 | <geekosaur> | twb, so it's already using the threaded runtime. (Haskell still has threads without it but they'd be green threads that wouldn't show up that way) |
| 23:55:33 | <twb> | ah right |
| 23:55:48 | <twb> | I was stupid and didn't realize green threads are (obviously!) invisible to linux |
| 23:55:49 | <geekosaur> | also it's possible to use processes instead of threads for an http server, and apache at least can be so configured |
| 23:56:15 | <twb> | yeah or just have crap experience, like busybox httpd :-) |
| 23:56:36 | <geekosaur> | but in haskell there are lots of advantages to using real threads, and things like STM make it easy and safe |
| 23:56:47 | × | slac26443 quits (~slack1256@191.126.99.192) (Ping timeout: 268 seconds) |
| 23:57:17 | → | Maeda joins (~Maeda@91-161-10-149.subs.proxad.net) |
| 23:57:24 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 268 seconds) |
All times are in UTC on 2022-11-14.