Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-03 21:33:57 <bqv> hmm
2020-11-03 21:34:00 × jneira quits (501e64fa@gateway/web/cgi-irc/kiwiirc.com/ip.80.30.100.250) (Quit: Connection closed)
2020-11-03 21:34:11 <dminuoso> bqv: From experience, ByteString is usually used correctly. So if a library exposes ByteString to you, it means decoding is *your* problem
2020-11-03 21:34:22 × motherfsck quits (~motherfsc@unaffiliated/motherfsck) (Quit: quit)
2020-11-03 21:34:48 <bqv> so basically the current state of affairs is optimal?
2020-11-03 21:34:59 <dminuoso> Well String/Text is not optimal
2020-11-03 21:35:05 <dminuoso> But ByteString is frequently misunderstood.
2020-11-03 21:35:08 <merijn> No, but the optimal state doesn't involve "less string types" :)
2020-11-03 21:35:12 <merijn> If anything we need more :p
2020-11-03 21:35:27 jneira joins (501e64fa@gateway/web/cgi-irc/kiwiirc.com/ip.80.30.100.250)
2020-11-03 21:35:44 <dminuoso> Text8, Text16..
2020-11-03 21:35:51 <davean> bqv: no, we should get a lot of String out of the ecosystem
2020-11-03 21:36:05 <davean> bqv: the previlence of String is definately a lasting problem we have
2020-11-03 21:36:22 <davean> But there are some tools to use them better and be more polymorphic over them also
2020-11-03 21:36:34 <davean> We have a lot of tools for that in type class heirarchies
2020-11-03 21:36:54 <davean> f you think in properties types move to the edge more.
2020-11-03 21:37:07 <dminuoso> bqv: Im in fact quite glad people expose ByteString often, forcing you to deal with de/encoding.
2020-11-03 21:37:26 <bqv> hmm
2020-11-03 21:37:30 × geekosaur quits (82659a09@host154-009.vpn.uakron.edu) (Remote host closed the connection)
2020-11-03 21:37:43 <bqv> so now the impression i'm getting is that avoiding String as much as possible is best?
2020-11-03 21:37:46 MisterG joins (~MisterG@bri77-3-78-239-227-185.fbx.proxad.net)
2020-11-03 21:37:53 <dminuoso> It depends on what you do, really.
2020-11-03 21:38:15 <dminuoso> String is not nearly as bad as some people make it out to be, GHC has some good optimizations for it
2020-11-03 21:38:26 <dolio> Part of the reason String is so persistent is that it isn't really that bad for a lot of stuff.
2020-11-03 21:38:29 <sm[m]> +1
2020-11-03 21:38:47 <MisterG> well ... https://www.youtube.com/watch?v=6a6xfFmwFwM
2020-11-03 21:38:58 <dolio> Because not every use of strings is some super performance critical thing.
2020-11-03 21:39:10 <sm[m]> String is simple, conserving developer brain cycles, which is often the priority
2020-11-03 21:39:31 <bqv> but I see the idea. If bytestring has the purpose outlined by dminuoso, and text is the de-facto textual data type, taking string out of the picture makes the whole thing ideal
2020-11-03 21:39:55 <sm[m]> if text were as easy to use as String, then maybe
2020-11-03 21:40:07 <dminuoso> I'd move to rename ByteString to ByteBuffer though, so we dont get as many confused beginners.
2020-11-03 21:40:08 <davean> I find them easier personally, they have better characturistics
2020-11-03 21:40:16 <davean> dminuoso: thats ... sensible
2020-11-03 21:40:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
2020-11-03 21:40:33 <davean> dminuoso: That might actually fix a lot of the screwups I see
2020-11-03 21:40:33 <bqv> ^
2020-11-03 21:40:35 <sm[m]> dminuoso: or Bytes
2020-11-03 21:40:44 MisterG parts (~MisterG@bri77-3-78-239-227-185.fbx.proxad.net) ()
2020-11-03 21:40:54 <davean> I never realized they'd think of the "String" in "ByteString" as textual.
2020-11-03 21:41:01 <davean> That ... thats shocking to me
2020-11-03 21:41:19 <bqv> davean: well consider other languages, there isn't always the distinction
2020-11-03 21:41:24 <bqv> in fact the rarely is
2020-11-03 21:41:38 <bqv> and in particular for FFI stuff, you would generally end up using bytestring for text
2020-11-03 21:42:00 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-11-03 21:42:24 <davean> bqv: because with FFI you *specificly* have to talk about encoding always
2020-11-03 21:42:30 <davean> its inherent to being FFI
2020-11-03 21:42:43 <bqv> exactly, but that doesn't make it any less textual data
2020-11-03 21:43:04 <dminuoso> davean: Anyway, the term "string" is really fuzzy and hard to define correctly.
2020-11-03 21:43:04 <bqv> coming from a closer to baremetal language, you'll be thinking of that
2020-11-03 21:43:18 <davean> dminuoso: its a Rope, only worse.
2020-11-03 21:43:23 <bqv> lmao
2020-11-03 21:43:23 <davean> (No it isn't)
2020-11-03 21:43:43 <dminuoso> Well, a rope is made of strings..
2020-11-03 21:43:46 <davean> Haskell really could use a better Rope package
2020-11-03 21:43:51 <dminuoso> In both senses of both words!
2020-11-03 21:44:15 × mbomba quits (~mbomba@bras-base-toroon2719w-grc-49-142-114-9-241.dsl.bell.ca) (Quit: WeeChat 2.9)
2020-11-03 21:44:29 <dminuoso> I mean if a "string" is understood as a sequence of characters, that begs the question of "what a character" even is.
2020-11-03 21:44:36 <dolio> Hasn't Ed made one?
2020-11-03 21:44:40 <bqv> well anyway, sm[m], what are the main inconveniences of Text? (does overloadedstrings allow concatenation with `++`?)
2020-11-03 21:44:51 <dminuoso> bqv: Annoyance with String is all, really.
2020-11-03 21:45:00 <dminuoso> Or if you want to deal with non-unicode textual data
2020-11-03 21:45:07 <bqv> hm
2020-11-03 21:45:11 justanotheruser is now known as mrdulus
2020-11-03 21:45:13 <sm[m]> bqv: the biggest is just the dance required to import it
2020-11-03 21:45:35 <bqv> cool. in that case i'll just build the habit of not using String
2020-11-03 21:45:43 <dminuoso> bqv: Also, its backed by utf16 currently. That might not be ideal for some special uses.
2020-11-03 21:45:59 <davean> dolio: Yah, I'll I'll be the first one to tell harmless his sucks :)
2020-11-03 21:46:07 <dminuoso> (There exist text-short and text-utf8 packages if those are needed)
2020-11-03 21:46:08 <dolio> Hahaha.
2020-11-03 21:46:09 <sm[m]> it can have unpredictable performance (cf recent reddit post)
2020-11-03 21:46:11 <bqv> heh
2020-11-03 21:46:15 <dolio> I guess that's why he wrote another one for coda.
2020-11-03 21:46:23 mrdulus is now known as justan0theruser
2020-11-03 21:46:34 <dminuoso> bqv: At any rate `text` is a very safe default when dealing with non-trivial amounts of textual data.
2020-11-03 21:46:43 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 246 seconds)
2020-11-03 21:46:45 <dminuoso> Without any major deficits
2020-11-03 21:47:18 <sm[m]> and it's harder to do list-like construction/operations with it
2020-11-03 21:48:00 <sm[m]> there's lazy and strict variants to deal with
2020-11-03 21:48:15 × coot quits (~coot@37.30.49.253.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
2020-11-03 21:48:27 <dminuoso> It's similar to how Vector is a good default if you need a memory efficient array with cheap random access
2020-11-03 21:48:32 <sm[m]> literals require OverloadedStrings, which may interfere with other things.. etc.
2020-11-03 21:48:51 <dminuoso> sm[m]: You can just write `T.pack "foo"` in those places though
2020-11-03 21:48:54 <dminuoso> It's not a big issue
2020-11-03 21:49:15 × cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Ping timeout: 256 seconds)
2020-11-03 21:49:19 <sm[m]> sure, but all of these things add up and make it less convenient than String
2020-11-03 21:49:26 <bqv> ack.
2020-11-03 21:49:33 <sm[m]> convenience is a big issue in my book
2020-11-03 21:50:08 <bqv> well, i suppose at any rate, if bytestring is out of the picture in almost every context, it isn't so heinous
2020-11-03 21:50:08 <dminuoso> sm[m]: Heh, Im debating between convenience of Int everywhere, or proper cross-platform support in an upcoming library right now.
2020-11-03 21:50:19 <dminuoso> I really want this to have a guaranteed 32 bits..
2020-11-03 21:50:30 <dminuoso> (And Word32 will cause a lot of fromIntegral friction)
2020-11-03 21:50:32 <bqv> back when i started haskell the string types were my biggest headache i reckon
2020-11-03 21:50:39 <sm[m]> of course, when you need what text provides, String becomes the inconvenient/wrong one
2020-11-03 21:50:58 × argent0 quits (~argent0@168.227.97.4) (Ping timeout: 256 seconds)
2020-11-03 21:51:18 <dminuoso> bqv: The prevalence of String is arguably one of the biggest warts in Haskell. :(
2020-11-03 21:51:37 <sm[m]> myself, I don't seem to have really needed text in my haskell career yet. I guess I'd need to be storing large amounts of it and wanting to save memory
2020-11-03 21:51:39 mdunnio joins (~mdunnio@208.59.170.5)
2020-11-03 21:51:42 <dminuoso> In a perfect world, we could use backpack to switch between String and Text, depending on what we want
2020-11-03 21:51:58 <bqv> backpack?
2020-11-03 21:52:04 <davean> sm[m]: its not about memory, the performance of string is abismal even in small pieces of code

All times are in UTC.