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/
mima has quit [Ping timeout: 246 seconds]
<discocaml> <darrenldl>
<discocaml> <darrenldl> "observable" doesnt seem to be a very common word for the idea though?
<discocaml> <darrenldl> also what would be its definition in text anyway? condition variable but better?
John_Ivan has quit [Ping timeout: 240 seconds]
<companion_cube> signal?
<companion_cube> ah might be "observer"
<discocaml> <jumpnbrownweasel> Is a `Promise` what you're looking for?
<discocaml> <darrenldl> promise can't be reused though
<companion_cube> no it's not a promise
<companion_cube> come on, it's a thing with `subscribe: 'a t -> ('a -> unit) -> unit` and `emit : 'a t -> 'a -> unit` to notify all subscribers
<companion_cube> isn't that an observer pattern?
<discocaml> <darrenldl> `subscribe` and `emit` read sensible
theblatte has quit [Server closed connection]
theblatte has joined #ocaml
<companion_cube> I first wrote a concurrent version of this a few months ago, but the regular kind I've used for so long
<companion_cube> is it really not usual?
<discocaml> <darrenldl> i wrote a version of that on top of condition
<discocaml> <darrenldl> which largely prompted my train of thoughts of "why condition variable needs so much ceremony to use by itself"
<companion_cube> oh, by concurrent I mean that `subscribe` and `emit` are thread safe
<companion_cube> but otherwise it's just that `emit` calls all subscribers directly
<companion_cube> otherwise you could probably have something like a queue I guess?
<discocaml> <darrenldl> yeah a rotating wait queue or what have you
<discocaml> <darrenldl> but then you have to direct users to condvar and this, which have very similar api
<companion_cube> condvar would just be hidden implem, no?
<discocaml> <darrenldl> even the C++'s condvar doesn't need you to roll your loop
<discocaml> <darrenldl> sure, if condvar is marked as not super user facing, then i wouldn't have any problems with it
<discocaml> <jumpnbrownweasel> do you mean this C++ API?: <https://en.cppreference.com/w/cpp/thread/condition_variable>
<discocaml> <jumpnbrownweasel> it does have spurious wake-ups, so you need the loop
<discocaml> <darrenldl> right, only the second version does the loop for you, i see
<companion_cube> the predicate version?
<discocaml> <darrenldl> think so, unless i misread again
<discocaml> <darrenldl> i guess condition variable has always been very bare in semantics to begin with, and i'm just yelling at clouds
<discocaml> <jumpnbrownweasel> I know the same thing occurs with Java `Object.wait` also, which is where I learned about it originally. And those spurious wakeups really do happen, they caused problems in production when we neglected to recheck the condition.
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
chrisz has quit [Ping timeout: 245 seconds]
chrisz has joined #ocaml
bartholin has joined #ocaml
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
azimut has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
cedb has quit [Ping timeout: 250 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
mima has joined #ocaml
pippijn has quit [Server closed connection]
pippijn has joined #ocaml
pieguy128 has quit [Ping timeout: 255 seconds]
Serpent7776 has joined #ocaml
mima has quit [Ping timeout: 246 seconds]
mima has joined #ocaml
pieguy128 has joined #ocaml
Anarchos has joined #ocaml
<discocaml> <haesbaert> It's not a lot of work to build the predicate wrapper around a cond though. And if you want really easy sync semantics the way to go is rendezvous (synchronous blocking Sender/Receiver, like go channels).
<discocaml> <haesbaert> (imho)
Geekingfrog_ is now known as Geekingfrog
bartholin has quit [Quit: Leaving]
rgrinberg has joined #ocaml
<discocaml> <dinosaure> actually `miou` has a different way to implement condition (as any scheduler projects...). We use a `pipe()` to do the inter-process communication and be able to apply the cancellation if we want.
<discocaml> <dinosaure> that mostly means that spurious wakeups should not happen when we actually `read` on the `pipe()` (only when `select()` signals to us that the file-descriptor is read)
<discocaml> <dinosaure> (and, to clarify, I made such choice but it's not a part of the core library 🙂 - we definitely can find something better/smarter about the implementation)
hsw has quit [Remote host closed the connection]
hsw has joined #ocaml
Boarders___ has quit [Read error: Connection reset by peer]
JSharp has quit [Read error: Connection reset by peer]
JSharp has joined #ocaml
Boarders___ has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bartholin has joined #ocaml
waleee has joined #ocaml
infinity0 has quit [Remote host closed the connection]
anpad has quit [Quit: ZNC 1.8.2 - https://znc.in]
anpad has joined #ocaml
xd1le has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
spip has quit [Quit: Konversation terminated!]
infinity0 has joined #ocaml
spip has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Ping timeout: 255 seconds]
spip has quit [Quit: Konversation terminated!]
spip has joined #ocaml
dnh has quit [Ping timeout: 255 seconds]
dnh has joined #ocaml
rgrinberg has joined #ocaml
ShalokShalom has joined #ocaml
ShalokShalom has quit [Quit: Client closed]
ShalokShalom has joined #ocaml
waleee has quit [Ping timeout: 255 seconds]
ShalokShalom has quit [Quit: Client closed]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
<discocaml> <gelivable39> What’s the best place to post OCaml specific job posting? I don’t find a job related channel.
<discocaml> <dinosaure> discuss has a tag for that and some people already announced some job on this forum: https://discuss.ocaml.org/
pgiarrusso has quit [Server closed connection]
pgiarrusso has joined #ocaml
spip has quit [Quit: Konversation terminated!]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<discocaml> <hockletock> you can also ask it be posted to ocaml.org/jobs if it qualifies: <https://discuss.ocaml.org/t/list-your-open-ocaml-positions-on-the-ocaml-org-job-board/11377>
John_Ivan has joined #ocaml
mima has quit [Ping timeout: 255 seconds]
mima has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ns12 has quit [Quit: bye]
ns12 has joined #ocaml
Tuplanolla has joined #ocaml
omegatron has joined #ocaml
waleee has joined #ocaml
mima has quit [Ping timeout: 246 seconds]
Anarchos has joined #ocaml
remexre has quit [Ping timeout: 245 seconds]
remexre has joined #ocaml
bartholin has quit [Quit: Leaving]
rgrinberg has joined #ocaml
<Anarchos> rgrinberg i did the change in CHANGES.txt you asked on my pull request in janestreet/spawn
xd1le_ has joined #ocaml
xd1le has quit [Ping timeout: 245 seconds]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rgrinberg> ok, let me take a look
Serpent7776 has quit [Ping timeout: 246 seconds]
<dh`> ooc, why is List.map not tail-recursive? a tail-recursive version isn't any more expensive
<dh`> is it because the tail-recursive version makes loop fusion harder?
<discocaml> <geoff> Its tail recursive now that TMC was added iirc
<discocaml> <Kali> yes, it should be TR
<discocaml> <Kali> wait, no, this is the wrong one...
<discocaml> <Kali> note that the native tail-recursive version is the slowest by far
<discocaml> <Kali> even if it was stack-safe
<discocaml> <Kali> it is now tail-recursive anyway, so this is a moot point
Anarchos has quit [Ping timeout: 255 seconds]
rwmjones has quit [Ping timeout: 248 seconds]
rwmjones_ has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
waleee has quit [Ping timeout: 240 seconds]
<companion_cube> dh`: it's tailrec but it used to be that it would be more expensive to be tailrec
waleee has joined #ocaml
<companion_cube> There are old blog posts about that actually
wagle has quit [Server closed connection]
wagle has joined #ocaml
<dh`> now as in in 5?
<companion_cube> yep
<companion_cube> maybe even 4.14? not sure
<dh`> nope :-)
<dh`> (also, why does discuss.ocaml.org render file but provide no scrollbar in a non-js browser? very strange)
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
azimut has quit [Ping timeout: 246 seconds]
omegatron has quit [Ping timeout: 255 seconds]