Logs: freenode/#haskell
| 2020-11-03 21:52:05 | <sm[m]> | though I've been benefitting from it's use in many libs, probably |
| 2020-11-03 21:52:09 | <dminuoso> | bqv: Are you familiar with ML functors? |
| 2020-11-03 21:52:24 | <bqv> | i'm familiar with haskell functors, at least |
| 2020-11-03 21:52:31 | <dminuoso> | Different thing entirely :) |
| 2020-11-03 21:52:34 | <sm[m]> | davean: everyone says this, but I haven't experienced it in my code |
| 2020-11-03 21:52:41 | <bqv> | i have a vague comprehension of category theory |
| 2020-11-03 21:52:49 | <bqv> | i won't pretend to be a master |
| 2020-11-03 21:53:50 | <tomsmeding> | dminuoso: are those parametrised modules? |
| 2020-11-03 21:53:58 | <dminuoso> | tomsmeding: Yeah |
| 2020-11-03 21:54:03 | <tomsmeding> | bqv: Futhark also has those, if you just so happen to know that language :p |
| 2020-11-03 21:54:13 | → | aarvar joins (~foewfoiew@50.35.43.33) |
| 2020-11-03 21:54:35 | <dminuoso> | bqv: Roughly and havingly, backpack lets you parametrize a package by another. |
| 2020-11-03 21:54:38 | × | mananamenos quits (~mananamen@84.122.202.215.dyn.user.ono.com) (Ping timeout: 264 seconds) |
| 2020-11-03 21:54:46 | <dminuoso> | *handwavingly |
| 2020-11-03 21:54:53 | × | fendor_ quits (~fendor@91.141.3.235.wireless.dyn.drei.com) (Read error: Connection reset by peer) |
| 2020-11-03 21:54:57 | <bqv> | interesting |
| 2020-11-03 21:55:24 | <dminuoso> | So rather than depending on some modules, you depend on some signature. And backpack can fill that signature in with some matching stuff. |
| 2020-11-03 21:55:39 | → | fendor joins (~fendor@91.141.3.235.wireless.dyn.drei.com) |
| 2020-11-03 21:55:41 | × | fendor quits (~fendor@91.141.3.235.wireless.dyn.drei.com) (Remote host closed the connection) |
| 2020-11-03 21:55:44 | × | danvet quits (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) (Ping timeout: 240 seconds) |
| 2020-11-03 21:55:45 | → | superfly1 joins (~superfly@84.39.117.57) |
| 2020-11-03 21:56:33 | <justsomeguy> | Roughly speaking, what does a signature consist of? Is it a type signature for functions that are members of the module, or something? |
| 2020-11-03 21:56:42 | <sm[m]> | davean: ..and I've seen a few other folks say the same, so I think it must depend. Perhaps it's more apparent when working with large strings ? I ported hledger from String to text and the difference was not huge. |
| 2020-11-03 21:56:46 | <bqv> | that's actually very cool |
| 2020-11-03 21:57:18 | <davean> | sm[m]: Oh yes, its walking the spine thats so slow - O(n) vs. O(1) |
| 2020-11-03 21:57:21 | <dminuoso> | justsomeguy / bqv: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/separate_compilation.html#module-signatures |
| 2020-11-03 21:57:55 | → | sQVe joins (~sQVe@unaffiliated/sqve) |
| 2020-11-03 21:58:51 | <bqv> | excellent |
| 2020-11-03 21:59:02 | <sm[m]> | so perhaps when working with many small strings, text is not such a win; and I think that's a pretty common case |
| 2020-11-03 21:59:07 | <tomsmeding> | sm[m]: "not huge" -- do you remember roughly how much it did save? |
| 2020-11-03 21:59:28 | <davean> | sm[m]: It adds up on total volume of string, not length of any given |
| 2020-11-03 21:59:46 | <dminuoso> | bqv: In case you ever encounter it in the future, ML functors are roughly the same thing (albeit much more powerful), giving you parametrized modules (that is functions returning *modules*) |
| 2020-11-03 22:00:04 | <dminuoso> | (or, you could think of backpack as a simpler form of ml-functors) |
| 2020-11-03 22:00:19 | <bqv> | i see, fair enough |
| 2020-11-03 22:00:42 | → | thir joins (~thir@p200300f27f0b7e00f4e9381c2bf90854.dip0.t-ipconnect.de) |
| 2020-11-03 22:01:13 | <sm[m]> | tomsmeding: I see "most hledger types have been converted from String to Text, reducing memory usage by 30%+ on large files". I don't remember the time change, perhaps it was similar |
| 2020-11-03 22:01:18 | <dolio> | It is essentially the same thing, but you need to do the management in cabal files and such, not just as constructs in the language. |
| 2020-11-03 22:01:42 | <dminuoso> | dolio: They are limited because it's static in cabal, ml functors you can just apply to different things at the same time. |
| 2020-11-03 22:01:54 | <davean> | sm[m]: remember the GC has to walk strings also |
| 2020-11-03 22:01:57 | <tomsmeding> | sm[m]: neat, thanks! nice factoid |
| 2020-11-03 22:02:00 | <davean> | sm[m]: so just HAVING strings in memory hurts performance |
| 2020-11-03 22:02:23 | <dolio> | You can apply a backpack 'functor' to multiple modules, too. |
| 2020-11-03 22:02:25 | <dminuoso> | Oh? |
| 2020-11-03 22:02:32 | → | ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) |
| 2020-11-03 22:02:55 | <hekkaidekapus> | bqv, justsomeguy: <https://github.com/haskell-backpack/backpack-str/blob/master/str-sig/Str.hsig> |
| 2020-11-03 22:03:04 | <dolio> | Yeah, but it all happens in the cabal file. |
| 2020-11-03 22:03:05 | <davean> | sm[m]: if you just allocate a large string and do something else in your program, your performance suffers a lot |
| 2020-11-03 22:03:06 | <bqv> | i was about to ask a question but i think i just answered it with text-show |
| 2020-11-03 22:03:28 | <dolio> | Or whatever you're using. I guess there's some just-GHC way to use it, but I ignored that mostly. |
| 2020-11-03 22:03:30 | <davean> | sm[m]: its the very *existance* of strings in the program that cause issues |
| 2020-11-03 22:03:52 | <sm[m]> | davean: ok, but I'm reporting my experience so far. Issues have been minimal |
| 2020-11-03 22:04:10 | <sm[m]> | I think people are too quick to condemn String, without measuring or considering context |
| 2020-11-03 22:04:23 | <davean> | I messure religiously |
| 2020-11-03 22:04:48 | <sm[m]> | I mean, People at large, not you of course. Which gives String and haskell an unnecessarily bad rep |
| 2020-11-03 22:05:03 | <davean> | Maybe, most people don't understand Haskell performance it seems. |
| 2020-11-03 22:05:26 | × | thir quits (~thir@p200300f27f0b7e00f4e9381c2bf90854.dip0.t-ipconnect.de) (Ping timeout: 264 seconds) |
| 2020-11-03 22:05:53 | monochrom | disbelieves in simpletonic "rule of thumb", "best practice", "code smell". |
| 2020-11-03 22:06:44 | <dminuoso> | We have a latency critical application. We have String in all kinds of places, except in the code generation where we just use `prettyprinter`. All our performance issues were of algorithmic nature, and the odd lack of sharing. |
| 2020-11-03 22:07:12 | <davean> | dminuoso: oh interesting. I'd LOVE to know about your lack of sharing |
| 2020-11-03 22:07:14 | × | dcoutts_ quits (~duncan@33.14.75.194.dyn.plus.net) (Ping timeout: 256 seconds) |
| 2020-11-03 22:07:19 | <davean> | that sounds very interesting |
| 2020-11-03 22:07:25 | × | hyperisco quits (~hyperisco@d192-186-117-226.static.comm.cgocable.net) (Ping timeout: 240 seconds) |
| 2020-11-03 22:07:29 | × | ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 265 seconds) |
| 2020-11-03 22:07:40 | <dolio> | dminuoso: http://blog.ezyang.com/2016/10/try-backpack-ghc-backpack/ |
| 2020-11-03 22:07:51 | <dolio> | Search for "using both insantiations at once" |
| 2020-11-03 22:08:00 | <bqv> | sm[m]: but surely it's pretty reasonable to want to avoid marshalling between Text and String all the time, which is undeniably less efficient than any alternative. then at that point, your use of which one all but depends on what libraries you use |
| 2020-11-03 22:09:29 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-11-03 22:09:37 | × | sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937) |
| 2020-11-03 22:10:07 | → | roconnor joins (~roconnor@host-192.252-162-14.dyn.295.ca) |
| 2020-11-03 22:10:15 | <sm[m]> | bqv: you're right |
| 2020-11-03 22:11:06 | <dminuoso> | davean: Oh it's really not that interesting. It's just when you defeat MMR by being very explicit with type annotations.. |
| 2020-11-03 22:11:24 | <ski> | bqv : ML functors is something else |
| 2020-11-03 22:11:27 | <ski> | @where on-functors |
| 2020-11-03 22:11:28 | <lambdabot> | "On Functors" (in C++,Standard ML,Haskell,Prolog) by Peteris Krumins in 2010-05-17 at <http://www.catonmat.net/blog/on-functors/> |
| 2020-11-03 22:11:52 | <davean> | dminuoso: Oh! Thats 2 slides of my talk! |
| 2020-11-03 22:12:04 | <davean> | dminuoso: I specificly focus on that and when to be how strict |
| 2020-11-03 22:12:10 | <davean> | and how much to unpack and why |
| 2020-11-03 22:12:19 | <sm[m]> | bqv: that is to say, if your data is not big enough to require text, then easy interop with the libs you're using is probably the best way to choose |
| 2020-11-03 22:12:20 | <dminuoso> | davean: Did you hold that talk already? |
| 2020-11-03 22:12:31 | <davean> | No, thrusday at Haskell Exchange |
| 2020-11-03 22:12:36 | <davean> | I was recently tricked into it |
| 2020-11-03 22:12:45 | <dminuoso> | Ah, are they still selling tickets? |
| 2020-11-03 22:12:49 | <dminuoso> | Seems so, mmm. |
| 2020-11-03 22:12:53 | <davean> | I'm currently desperately getting the talk together if you want to review it |
| 2020-11-03 22:13:18 | <dminuoso> | I could take a peek, sure |
| 2020-11-03 22:13:41 | <dminuoso> | I kind of missed this years Haskell eXchange because it was so rushed.. |
| 2020-11-03 22:13:56 | <dminuoso> | (Guess it's still the aftermath of the bankruptcy) |
| 2020-11-03 22:15:16 | → | ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) |
| 2020-11-03 22:15:33 | <sm[m]> | bqv: if you're interested, http://hackage.haskell.org/package/foundation-0.0.25/docs/Foundation-String.html is a third option, but it doesn't seem to have got much traction |
| 2020-11-03 22:16:09 | → | elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) |
| 2020-11-03 22:16:49 | <bqv> | heh, yeah, if it would require explicit marshalling then i don't see myself using it much either |
| 2020-11-03 22:18:00 | hackage | registry 0.2.0.1 - data structure for assembling components https://hackage.haskell.org/package/registry-0.2.0.1 (etorreborre) |
| 2020-11-03 22:18:28 | <sm[m]> | there'll always be some marshalling/conversion, since different types of text-like data arise in the wild. Ideally we'd minimise it though |
| 2020-11-03 22:19:45 | × | ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 240 seconds) |
| 2020-11-03 22:20:18 | <sm[m]> | maybe the aforementioned http://hackage.haskell.org/package/text-utf8 has superseded that foundation type |
| 2020-11-03 22:24:28 | <bqv> | so this is one where backpack would be nice |
| 2020-11-03 22:24:42 | <bqv> | because you have the same ABI, but different types |
| 2020-11-03 22:24:47 | <bqv> | so mixing and matching won't work |
| 2020-11-03 22:24:57 | <bqv> | *API |
| 2020-11-03 22:27:02 | × | alp quits (~alp@2a01:e0a:58b:4920:280c:9785:c082:40bf) (Read error: Connection reset by peer) |
All times are in UTC.