Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 117 118 119 120 121 122 123 124 125 126 127 .. 5022
502,152 events total
2020-09-21 15:04:30 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-09-21 15:04:57 × borne quits (~fritjof@200116b864f88900f00953f5fedbeb5e.dip.versatel-1u1.de) (Ping timeout: 260 seconds)
2020-09-21 15:05:31 perrier-jouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca)
2020-09-21 15:05:43 josh joins (~josh@c-67-164-104-206.hsd1.ca.comcast.net)
2020-09-21 15:06:41 × pingiun quits (~pingiun@ip-213-124-184-182.ip.prioritytelecom.net) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-09-21 15:08:46 <siraben> Which version of GHC will have -XLinearTypes ?
2020-09-21 15:09:12 josh_ joins (~josh@c-67-164-104-206.hsd1.ca.comcast.net)
2020-09-21 15:09:48 × zebrag quits (~inkbottle@aaubervilliers-654-1-112-47.w86-198.abo.wanadoo.fr) (Remote host closed the connection)
2020-09-21 15:10:10 zebrag joins (~inkbottle@aaubervilliers-654-1-112-47.w86-198.abo.wanadoo.fr)
2020-09-21 15:10:26 × josh quits (~josh@c-67-164-104-206.hsd1.ca.comcast.net) (Ping timeout: 256 seconds)
2020-09-21 15:11:03 <phadej> 9.0 will have an experimental support
2020-09-21 15:12:14 __Joker_ joins (~Joker@180.151.104.210)
2020-09-21 15:13:39 × josh_ quits (~josh@c-67-164-104-206.hsd1.ca.comcast.net) (Ping timeout: 260 seconds)
2020-09-21 15:13:58 <siraben> When will that be released? This month?
2020-09-21 15:14:23 <phadej> no-one knows
2020-09-21 15:14:37 <dolio> When was the last one?
2020-09-21 15:14:57 <phadej> I mean, there weren't any updates on its release schedule
2020-09-21 15:15:06 <dolio> I guess it's been 6 months.
2020-09-21 15:15:16 <phadej> (it was supposed to be released this month, but it doesn't seem likely)
2020-09-21 15:15:17 emmanuel_erc joins (~user@2604:2000:1382:ce03:71a7:7eea:bdbf:f3a4)
2020-09-21 15:15:43 × __Joker quits (~Joker@180.151.105.65) (Ping timeout: 260 seconds)
2020-09-21 15:16:17 <dolio> I guess with the major stuff, a delay isn't super surprising.
2020-09-21 15:16:22 <phadej> https://gitlab.haskell.org/ghc/ghc/-/wikis/status/ghc-9.0.1
2020-09-21 15:17:35 × jonathanx quits (~jonathan@dyn-8-sc.cdg.chalmers.se) (Remote host closed the connection)
2020-09-21 15:17:45 Seyaryuki joins (~Seyaryuki@185.204.1.185)
2020-09-21 15:18:49 <phadej> looks like we should have beta release in three days!
2020-09-21 15:18:59 <siraben> so linear types will be good for safe mutable in-place updates? and allow us to make safe API abstractions?
2020-09-21 15:19:23 × Saten-san quits (~Saten-san@ip-83-134-202-127.dsl.scarlet.be) (Quit: WeeChat 2.8)
2020-09-21 15:20:18 <siraben> Well, the first part is what Wadler claims in his 1990 paper, Linear Types can Change the World!
2020-09-21 15:20:40 hhefesto joins (~user@2806:103e:27:514e:97f8:577a:384e:d8df)
2020-09-21 15:20:41 <phadej> maybe
2020-09-21 15:21:13 <phadej> ST s allows to do safe mutable in-place updates too
2020-09-21 15:21:23 × Sanchayan quits (~Sanchayan@106.201.114.230) (Quit: leaving)
2020-09-21 15:22:43 <phadej> I suggest to think about LinearHaskell as an academic experiment (of they would fit into Haskell).
2020-09-21 15:22:56 <phadej> at least for a year or two.
2020-09-21 15:23:03 <merijn> Or 5 :p
2020-09-21 15:23:06 <merijn> Or forever :p
2020-09-21 15:23:26 <merijn> siraben: We can already do safe mutable in-place updates with a pure API
2020-09-21 15:23:32 <merijn> siraben: It's called ST :)
2020-09-21 15:23:47 <phadej> phadej ST s allows to do safe mutable in-place updates too -- few lines above.
2020-09-21 15:23:57 <siraben> merijn: yes, but without needing to use a monad
2020-09-21 15:24:18 <merijn> siraben: Using linear functions is going to be *hella* more invasive on your code then ST will
2020-09-21 15:24:37 <merijn> siraben: Like "rewrite/update many dependencies" intensive
2020-09-21 15:24:37 <siraben> merijn: Right, because now everything has to preserve the linearity
2020-09-21 15:24:44 <phadej> time will show.
2020-09-21 15:24:55 <siraben> Perhaps with linear-base it won't be that bad, perhaps?
2020-09-21 15:24:56 <merijn> Whereas you can stick ST pretty much anywhere without much effort
2020-09-21 15:24:57 bloodstalker joins (~bloodstal@46.166.187.154)
2020-09-21 15:25:08 <phadej> linear update "eats" the old value.
2020-09-21 15:25:17 <phadej> so you will end up writing something like ssa
2020-09-21 15:25:39 <siraben> merijn: why doesn't ST act like the state monad? is there a state monad that is efficient?
2020-09-21 15:25:47 <siraben> As in, I want modify, get, put, etc.
2020-09-21 15:25:50 <phadej> (static single assignment form)
2020-09-21 15:25:51 <dolio> I think a lot of languages experimenting with linearity for mutability stuff found that it wasn't very nice to use at the level of individual values.
2020-09-21 15:26:05 teardown joins (~user@unaffiliated/mrush)
2020-09-21 15:26:13 <phadej> at which point one might need some kind of syntactic sugar as well
2020-09-21 15:26:14 <siraben> Rust uses an affine type system to manage memory, to great effect.
2020-09-21 15:26:29 <merijn> siraben: Not sure what you mean?
2020-09-21 15:26:40 <phadej> siraben: GHC is very good at compiling state passing code
2020-09-21 15:26:55 <siraben> merijn: ST is a lot like using IORef, right?
2020-09-21 15:27:09 <int-e> ST is a lot like IO
2020-09-21 15:27:11 <merijn> siraben: Sorta? I guess?
2020-09-21 15:27:35 <siraben> phadej: oh it is?
2020-09-21 15:27:36 <merijn> siraben: I mean, you can easily define a version of State that uses ST for the value and has get/put/modify work on that
2020-09-21 15:27:42 <siraben> mine to learn core I guess, never dove into it
2020-09-21 15:27:44 <merijn> But ST is much more general
2020-09-21 15:27:46 <int-e> IIRC the "ST" is for "state thread"... a thread that can have mutable state.
2020-09-21 15:27:57 <dolio> And then people were looking into 'linear regions' or something instead of individual linear values.
2020-09-21 15:28:35 × mastarija quits (~mastarija@93-142-74-181.adsl.net.t-com.hr) (Ping timeout: 260 seconds)
2020-09-21 15:28:47 <int-e> There's really not much of a connection to the state monad, except as an implementation detail.
2020-09-21 15:28:57 <merijn> siraben: "StateT (STRef s a) (ST s) b" with "modify :: (a -> a) -> StateT (STRef s a) (ST s) ()" is kinda the interface you're refering too
2020-09-21 15:29:03 <phadej> dolio: I understood that Rust does have that. YOu can pass ownership of just a part of array of values (e.g. part to one thread, another part to another thread)
2020-09-21 15:29:05 <siraben> https://old.reddit.com/r/haskell/comments/1rcc8t/performance_of_the_st_monad_over_the_state_monad/ ooh
2020-09-21 15:29:11 <siraben> merijn: I see
2020-09-21 15:29:12 ephemera_ joins (~E@122.34.1.187)
2020-09-21 15:29:40 <phadej> merijn: you'd be fine with just ReaderT, details...
2020-09-21 15:29:46 <merijn> siraben: The basic logic of ST is that "single threaded mutable references" are still perfectly deterministic in a purely function language
2020-09-21 15:29:52 <siraben> Wadler also mentions that there should be a mechanism for getting a read-only reference to a linear value whose deference can be nonlinear
2020-09-21 15:30:06 <merijn> siraben: Because the order of changes and what you change is perfectly deterministic in that setting
2020-09-21 15:30:11 <siraben> Right
2020-09-21 15:30:15 Tuplanolla joins (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi)
2020-09-21 15:30:29 <merijn> siraben: So ST gives you arbitrary many independent mutable variables, whereas State's interface has just one
2020-09-21 15:30:29 <dolio> phadej: Oh, I guess that's one possible meaning of 'region'. It wasn't the one I was thinking of, but maybe it's the right one.
2020-09-21 15:30:47 <merijn> siraben: So the State API is just the trivial case of "I have one STRef" :p
2020-09-21 15:30:52 <siraben> merijn: right
2020-09-21 15:30:57 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2020-09-21 15:30:58 <siraben> Well, I haven't used STRef yet, might come in useful.
2020-09-21 15:31:33 <phadej> yet, Rust is ownership and LinearHaskell are very different things
2020-09-21 15:31:48 <merijn> siraben: I'd say that STRef itself has limited usefulness
2020-09-21 15:31:52 <phadej> it's tricky to represent ownership with linear types
2020-09-21 15:31:55 <siraben> What do people use STRef here for? Translating imperative code?
2020-09-21 15:31:58 <merijn> siraben: The most useful ST application imo is Vector
2020-09-21 15:32:05 <phadej> you can emulate that, but whether it's convenient: again, time will whow.
2020-09-21 15:32:07 <dolio> Yeah, actually, that makes a lot more sense for how it would solve the problem.
2020-09-21 15:32:09 <siraben> phadej: right, the ownership system in its glory is a lot like linear regions
2020-09-21 15:32:31 <merijn> siraben: Vector has ST based mutable vectors, which are very useful for obvious reasons of "mutable arrays are useful" ;)
2020-09-21 15:32:45 <siraben> Memory management aside, what about linearity as an alternative to Haskell's bracket pattern?
2020-09-21 15:32:56 <phadej> siraben: they are complementary
2020-09-21 15:32:58 <siraben> Also, making sure files are closed, sesion types etc
2020-09-21 15:33:04 <phadej> LinearTypes and exceptions is not solved problem

All times are in UTC.