Logs: freenode/#haskell
| 2020-09-21 14:33:56 | <merijn> | tomsmeding: STM version of MVar |
| 2020-09-21 14:34:10 | <tomsmeding> | isn't that TVar? |
| 2020-09-21 14:34:12 | <merijn> | mastarija: What's the actual problem, though? |
| 2020-09-21 14:34:13 | <merijn> | tomsmeding: No |
| 2020-09-21 14:34:18 | <merijn> | tomsmeding: TVar can't be empty |
| 2020-09-21 14:34:21 | <tomsmeding> | ah |
| 2020-09-21 14:34:24 | <mastarija> | merijn, game loop for multiplayer game |
| 2020-09-21 14:34:34 | <mastarija> | and I need to receive data form the server |
| 2020-09-21 14:34:42 | <merijn> | mastarija: Eh, more detailed then that :p Why do you need to poll for data? |
| 2020-09-21 14:34:43 | <mastarija> | so I can't have my loop block |
| 2020-09-21 14:35:08 | <merijn> | You can do something super dumb |
| 2020-09-21 14:35:22 | <merijn> | Like, use and MVar and have one thread "read from Chan, write to MVar" |
| 2020-09-21 14:35:33 | <merijn> | and then your main loop can do "tryTakeMVar" |
| 2020-09-21 14:35:38 | <mastarija> | merijn, that's what I suggested earlier |
| 2020-09-21 14:35:43 | <mastarija> | I think I'll go with that :D |
| 2020-09-21 14:35:44 | <tomsmeding> | that could work :p |
| 2020-09-21 14:35:53 | → | John20 joins (~John@82.46.59.122) |
| 2020-09-21 14:35:55 | <tomsmeding> | it won't even be that slow perhaps |
| 2020-09-21 14:35:56 | <merijn> | It probably wouldn't even be that inefficient, tbh |
| 2020-09-21 14:36:01 | <tomsmeding> | lol |
| 2020-09-21 14:36:18 | <merijn> | sleeping on Chan/MVar is pretty cheap |
| 2020-09-21 14:36:24 | <mastarija> | Ok, thanks for the brainstorm peeps! |
| 2020-09-21 14:36:29 | <Eduard_Munteanu> | One other reason to refactor is to use a bounded channel instead of Chan to avoid leaks. |
| 2020-09-21 14:36:50 | <mastarija> | Meh, I'll accept spaceleaks for now XD |
| 2020-09-21 14:36:51 | <John20> | Hi all, Does anyone have any examples of LanguageExtensions that have made it into the haskell language 'proper'? |
| 2020-09-21 14:37:16 | <mastarija> | Eduard_Munteanu, But yes, I will have to fix that eventually |
| 2020-09-21 14:37:31 | <merijn> | John20: PatternGuards extension was added to the report in Haskell2010 |
| 2020-09-21 14:37:43 | <merijn> | as was EmptyDataDecls? |
| 2020-09-21 14:38:11 | <Eduard_Munteanu> | John20, https://www.haskell.org/onlinereport/haskell2010/haskellli2.html#x3-5000 |
| 2020-09-21 14:38:24 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-157-9.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 2020-09-21 14:39:02 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-21 14:39:14 | <Eduard_Munteanu> | I'd count a few more as de facto into the language, such as FlexibleInstances, MPTCs... |
| 2020-09-21 14:40:00 | → | ph88^ joins (~ph88@2a02:8109:9e40:2704:3dae:c0b9:eddf:4cf0) |
| 2020-09-21 14:40:59 | <Eduard_Munteanu> | It's hard to imagine Haskell without some of those even if not in the report. |
| 2020-09-21 14:42:05 | → | gmt joins (~gmt@pool-71-105-108-44.nycmny.fios.verizon.net) |
| 2020-09-21 14:42:25 | <John20> | Thanks, that's really useful. I'm writing a blog post about some of the things that are surprising about Haskell for someone coming from a more mainstream language (Java in my case). |
| 2020-09-21 14:43:28 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds) |
| 2020-09-21 14:44:06 | <merijn> | John20: The main problem is that "properly specifying" these extensions is tricky and that's what any new Haskell Report would have to do to include them. Which is why the past 2 (3?) attempts to produce a new report have stranded |
| 2020-09-21 14:44:17 | × | ph88 quits (~ph88@2a02:8109:9e40:2704:b503:e755:2c19:955c) (Ping timeout: 272 seconds) |
| 2020-09-21 14:44:27 | hackage | flink-statefulfun 0.1.0.0 - Flink stateful functions SDK https://hackage.haskell.org/package/flink-statefulfun-0.1.0.0 (tdbgamer) |
| 2020-09-21 14:44:32 | <cpressey> | Hi. I have a list of Word8 and I'd like to render it as hexdigit pairs (e.g. "03 a9 1e" etc). I have written a function to do this, but it uses Text.Printf, which produces a String, but the consumer of my function now expects a Data.Text.Text. I could just DT.pack the string, but... any suggestions for something more elegant? |
| 2020-09-21 14:44:38 | <merijn> | Everyone wants to include "the most common/important stuff into the report", but actually specifying them is hard and people give up |
| 2020-09-21 14:45:06 | <merijn> | cpressey: fyi, the Numeric module has functions for doing that too |
| 2020-09-21 14:45:15 | <John20> | Language Extensions certainly fit that bill. to my mind, they feel like an incubator for new language features however, they rarely seem to actually make it into the core language. Does anyone know why that is? Is my understanding roughly correct? |
| 2020-09-21 14:45:19 | <merijn> | And those are less...questionable then printf :p |
| 2020-09-21 14:45:31 | <merijn> | John20: See my above 2 comments ;) |
| 2020-09-21 14:45:48 | <merijn> | > showHex 152 "" |
| 2020-09-21 14:45:51 | <lambdabot> | "98" |
| 2020-09-21 14:46:00 | <merijn> | > showHex 252 "" |
| 2020-09-21 14:46:04 | <lambdabot> | "fc" |
| 2020-09-21 14:46:07 | <John20> | thanks merijn. Missed them while typing out my response! |
| 2020-09-21 14:46:45 | <merijn> | cpressey: So I'd probably go with '\n -> DT.pack . showHex n ""' or something |
| 2020-09-21 14:46:52 | × | gmt quits (~gmt@pool-71-105-108-44.nycmny.fios.verizon.net) (Ping timeout: 256 seconds) |
| 2020-09-21 14:47:01 | × | sleblanc quits (~sleblanc@unaffiliated/sebleblanc) (Ping timeout: 264 seconds) |
| 2020-09-21 14:47:16 | <merijn> | cpressey: Alternatively, you can go via text's Builder: https://hackage.haskell.org/package/text-1.2.4.0/docs/Data-Text-Lazy-Builder-Int.html#v:hexadecimal |
| 2020-09-21 14:47:49 | <merijn> | John20: The other factor is that, since GHC is really the only widely used compiler, there's less incentive to go through the hardwork to produce a new report |
| 2020-09-21 14:48:06 | <merijn> | John20: There's like 2.5 actively maintained Haskell2010 compilers |
| 2020-09-21 14:48:15 | <merijn> | And GHC has 99% market share |
| 2020-09-21 14:48:37 | <merijn> | If there was a competitor to GHC there'd be more motivation to produce a new report to standardise the various compilers |
| 2020-09-21 14:48:43 | → | Sanchayan joins (~Sanchayan@106.201.114.230) |
| 2020-09-21 14:49:12 | <glguy> | cheater: what changed on windows recently that makes you ask? I haven't heard any vty/Windows news myself. |
| 2020-09-21 14:49:16 | <mmaruseacph2> | what's the timeframe? |
| 2020-09-21 14:49:22 | <mmaruseacph2> | bad window, sorry |
| 2020-09-21 14:49:30 | → | pingiun joins (~pingiun@ip-213-124-184-182.ip.prioritytelecom.net) |
| 2020-09-21 14:49:33 | <tdammers> | problem with coming up with a competitor is the economics of it |
| 2020-09-21 14:49:55 | <tdammers> | in order to compete, the other compiler would have to be able to do most of what GHC can do, and keep up with GHC, and then deliver some additional benefits |
| 2020-09-21 14:50:13 | <tdammers> | but at this point, with GHC being a thing and open-source, it is cheaper and more efficient for most people to just contribute to GHC instead |
| 2020-09-21 14:50:19 | <merijn> | tomsmeding: I hope csaba's work and massively overambitious plan to separate out the Core backend would allow alternate Haskell implementation that compile to Core and share code gen with GHC |
| 2020-09-21 14:50:26 | <merijn> | eh |
| 2020-09-21 14:50:33 | <merijn> | s/tomsmeding/tdammers |
| 2020-09-21 14:50:33 | <tdammers> | maybe what we need to do is make the GHC proposals procedure more difficult and cumbersome |
| 2020-09-21 14:50:54 | <tdammers> | hmm, that does sound like a good plan |
| 2020-09-21 14:51:18 | <tdammers> | massively ambitious indeed, and also subject to problems with Core itself not being properly version-managed |
| 2020-09-21 14:51:21 | <dolio> | There were multiple compilers for many years without new reports, though. |
| 2020-09-21 14:51:24 | <cpressey> | merijn: Thanks. I think I picked printf over showHex originally to get leading 0's. I guess my deeper question is, is there actually much gain performance-wise in switching from Strings to DT.Texts, if I need to call DT.pack in lots of places? Is it still justifiable to use DT.Text over String in the name of simply "being modern"? |
| 2020-09-21 14:51:26 | <merijn> | tdammers: https://www.patreon.com/posts/introducing-ghc-38173710 |
| 2020-09-21 14:51:45 | <merijn> | cpressey: "it depends" |
| 2020-09-21 14:51:57 | <merijn> | cpressey: Like, what are you outputting and when and how much |
| 2020-09-21 14:52:09 | <cpressey> | I guess another way to say it is, do people laugh derisively when they see String in your code these day? :) |
| 2020-09-21 14:52:16 | <merijn> | cpressey: If you're just visualising a few 100 Word8 for users it probably doesn't matter much |
| 2020-09-21 14:52:17 | <dolio> | And the one new report didn't really incorporate much. |
| 2020-09-21 14:52:48 | <merijn> | cpressey: plenty of stuff is still String based, depends what you use it for |
| 2020-09-21 14:52:59 | × | nbloomf quits (~nbloomf@2600:1700:83e0:1f40:dceb:16d3:9c64:27d9) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-09-21 14:54:46 | <oats> | for anyone who knows java/oopystuffs, is an AbstractVisitor just a shittier Traverse? |
| 2020-09-21 14:54:52 | <cpressey> | merijn: Makes sense, thanks. This is definitely not very performance-sensitive, I'm more wondering about norms and "nice" ways to write it. I'll probably just leave it as is. |
| 2020-09-21 14:55:42 | <merijn> | cpressey: You could write a small wrapper that goes straight to Text which can be convenient when you need to combine with lots of other Text |
| 2020-09-21 14:56:46 | → | stef204 joins (~stef204@unaffiliated/stef-204/x-384198) |
| 2020-09-21 14:57:14 | → | nbloomf joins (~nbloomf@2600:1700:83e0:1f40:c87d:6f52:4c16:4130) |
| 2020-09-21 14:58:02 | <dolio> | oats: I think a visitor is the function you pass to e.g. traverse. |
| 2020-09-21 14:59:08 | <dolio> | `T -> ()` basically. |
| 2020-09-21 14:59:22 | <oats> | right, thanks |
| 2020-09-21 14:59:26 | <dolio> | Or `T -> M ()`, since the former is useless. |
| 2020-09-21 14:59:47 | <oats> | trying to read some java that's making me want to never venture near java ever again |
| 2020-09-21 14:59:53 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-21 15:00:01 | × | tronical quits (~tronical@185.244.214.216) () |
| 2020-09-21 15:00:07 | <dolio> | There are multiple patterns that could just be functions, I think. |
| 2020-09-21 15:01:24 | → | bahamas joins (~lucian@unaffiliated/bahamas) |
| 2020-09-21 15:02:29 | × | dale quits (dale@unaffiliated/dale) (Remote host closed the connection) |
| 2020-09-21 15:03:17 | → | dale joins (dale@unaffiliated/dale) |
| 2020-09-21 15:04:12 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
All times are in UTC.