companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.0 released(!!1!): https://ocaml.org/releases/5.0.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
waleee has quit [Ping timeout: 265 seconds]
rh has left #ocaml [#ocaml]
anpad has quit [Quit: ZNC 1.8.2 - https://znc.in]
anpad has joined #ocaml
trillion1exabyte has quit [Ping timeout: 240 seconds]
trillion_exabyte has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
lobo[m] has joined #ocaml
chrisz has quit [Ping timeout: 246 seconds]
chrisz has joined #ocaml
spip has quit [Quit: Konversation terminated!]
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
troydm has quit [Ping timeout: 240 seconds]
troydm has joined #ocaml
<discocaml> <froyo> why not expose the fact that `'a Atomic.t = 'a ref`?
<discocaml> <froyo> thus allowing people to treat regular refs atomically when needed
<discocaml> <froyo> ig going the other way from atomic to ref would be unsafe
<discocaml> <froyo> ig going in either direction without copying would be unsafe haha
wingsorc__ has joined #ocaml
wingsorc has quit [Read error: Connection reset by peer]
<discocaml> <froyo> a better idea is to just have atomic record fields
<discocaml> <froyo> then `type 'a Atomic.t = { atomic contents : 'a }`
<discocaml> <anmonteiro> probably because it isn't
<discocaml> <anmonteiro> an `Atomic.t` is a mutable block, a `ref` is a record with a mutable field
<discocaml> <anmonteiro> ~probably because it isn't~
bartholin has joined #ocaml
wingsorc__ has quit [Quit: Leaving]
<discocaml> <sim642> It's a ref only on 4.14, where that's the dummy implementation. On 5.0 it's a built-in
<discocaml> <sim642> Atomic fields would probably complicate some semantics when mixed with non-atomic fields
<discocaml> <sim642> Tbh, I'm surprised it's not the other way around for refs to begin with. But that's probably just history
Serpent7776 has joined #ocaml
alexherbo2 has joined #ocaml
spip has joined #ocaml
rh has joined #ocaml
bartholin has quit [Quit: Leaving]
neiluj has joined #ocaml
<neiluj> Hi!
<neiluj> Is it possible to make a function return a module with a predefined type?
<neiluj> e.g.
<neiluj> type proof val to_mod :
<neiluj> 'h Sc_rollup_reveal_hash.supported_hashes ->
<neiluj> (module M with type elt = bytes and type h = 'h and type path = proof)
<neiluj> the problem is that the function to_mod matches on supported_hashes and returns a different module, so the type path is not equal to proof
<neiluj> actually, the problem is that proof has a constructor which holds the type path
Anarchos has joined #ocaml
rh has left #ocaml [#ocaml]
Serpent7776 has quit [Ping timeout: 265 seconds]
Haudegen has joined #ocaml
noonien5 has joined #ocaml
noonien has quit [Ping timeout: 250 seconds]
noonien5 is now known as noonien
Anarchos has quit [Quit: Vision[]: i've been blurred!]
xx_lalo_xx[m] has joined #ocaml
Serpent7776 has joined #ocaml
Serpent7776 has quit [Ping timeout: 250 seconds]
<discocaml> <froyo> sim642: the same builtin that's used for `ref`s.
<discocaml> <froyo>
<discocaml> <froyo> I'm thinking of ways to make the layout / batch operations of atomic values more efficient.
<discocaml> <froyo> e.g. for batch operations: imagine an array of atomics, you could lock around array modification once, then batch-modify inside the array with plain ref operations.
bartholin has joined #ocaml
Serpent7776 has joined #ocaml
bgs has joined #ocaml
<discocaml> <darrenldl> do people use atomics in a batch?
<discocaml> <darrenldl> i thought the point of atomic is to not do that
<companion_cube> I don't see how you do a compare and swap loop with an array
<companion_cube> @froyo sounds like you just want a Mutex
neiluj has quit [Quit: WeeChat 3.7.1]
waleee has joined #ocaml
bgs has quit [Remote host closed the connection]
Serpent7776 has quit [Ping timeout: 268 seconds]
waleee has quit [Ping timeout: 256 seconds]
Tuplanolla has quit [Quit: Leaving.]
bartholin has quit [Quit: Leaving]
waleee has joined #ocaml
waleee has quit [Ping timeout: 265 seconds]
waleee has joined #ocaml
<discocaml> <froyo> fair lol
Haudegen has quit [Ping timeout: 240 seconds]
John_Ivan has quit [Read error: Connection reset by peer]