companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.14.0 released: https://ocaml.org/releases/4.14.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
azimut has quit [Ping timeout: 240 seconds]
omegatron has quit [Quit: Power is a curious thing. It can be contained, hidden, locked away,and yet it always breaks free.]
raskol has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
gentauro has quit [Read error: Connection reset by peer]
bobo_ has joined #ocaml
spip has quit [Ping timeout: 255 seconds]
gentauro has joined #ocaml
waleee has quit [Ping timeout: 244 seconds]
herlocksholmes has quit [Ping timeout: 256 seconds]
brettgilio has quit [Ping timeout: 256 seconds]
asnyx has quit [Ping timeout: 256 seconds]
gio123 has joined #ocaml
<gio123> octachron: morgen
vicfred has joined #ocaml
<gio123> darrenldl: hi
gio123 has quit [Quit: Client closed]
vicfred has quit [Quit: Leaving]
gio123 has joined #ocaml
gio123 has quit [Quit: Client closed]
kronicma1 has quit [Quit: WeeChat 3.0.1]
azimut has joined #ocaml
raskol has quit [Ping timeout: 255 seconds]
gravicappa has joined #ocaml
Tuplanolla has joined #ocaml
Haudegen has joined #ocaml
gio123 has joined #ocaml
gio123 has quit [Quit: Client closed]
mro has joined #ocaml
mal`` has quit [Quit: Leaving]
mal`` has joined #ocaml
<d_bot> <ouglop> @everyone https://discord.gg/icecreams join now
<d_bot> <Ulugbek> how would you call a let-binding that's top-level within a module but not file?
gio123 has joined #ocaml
omegatron has joined #ocaml
<gio123> hi all
<omegatron> o/
<gio123> octachron are you here please?
<gio123> omegatron: Yesterday I enjoyed speaking with octachron  who is an expert in concurent prorgamming
hackinghorn has quit [Changing host]
hackinghorn has joined #ocaml
<omegatron> well, I'm not him - this isn't an alternative nick for octachron
<gio123> i know
olle has joined #ocaml
mro has quit [Quit: Leaving...]
<octachron> gio123, if you have a question it is better to ask the whole channel rather than request a specific person (and I am very far from being a concurrency export).
TakinOver has quit [Ping timeout: 255 seconds]
gio123 has quit [Quit: Client closed]
TakinOver has joined #ocaml
gio123 has joined #ocaml
<gio123> octachron : hi
olle has quit [Ping timeout: 244 seconds]
<d_bot> <NULL> module-level?
waleee has joined #ocaml
<d_bot> <leviroth> I don't think this page: https://v2.ocaml.org/manual/coreexamples.html ever explains local let-bindings, which is kinda weird
bartholin has joined #ocaml
fds has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
fds has joined #ocaml
flo1 has joined #ocaml
flo1 has left #ocaml [#ocaml]
waleee has quit [Ping timeout: 258 seconds]
Sankalp- has joined #ocaml
Everything has joined #ocaml
Sankalp has quit [Ping timeout: 248 seconds]
Sankalp- is now known as Sankalp
bobo_ has quit [Ping timeout: 246 seconds]
spip has joined #ocaml
<d_bot> <mseri> You mean these? https://v2.ocaml.org/manual/bindingops.html a number of features is described in the extensions chapter
<d_bot> <mseri> (The complete list is here: https://v2.ocaml.org/manual/extn.html)
<sim642> I think he means that the coreexamples page never introduces let..in
<sim642> It just introduces let..;;
<sim642> And then out of nowhere in 4.1 uses let..in
<sim642> And from thereon continues using let..in
<d_bot> <mseri> I see. Yeah, that is true. It is just used
<d_bot> <mseri> at some point
<d_bot> <mseri> You could suggest a modification in a PR. A sentence mentioning it and an example, right before `let rec` is introduced could be nice and non intrusive
bartholin has quit [Ping timeout: 256 seconds]
zebrag has joined #ocaml
bartholin has joined #ocaml
olle has joined #ocaml
raskol has joined #ocaml
gio123 has quit [Quit: Client closed]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
klu has quit [Quit: .]
klu has joined #ocaml
klu has quit [Changing host]
klu has joined #ocaml
Serpent7776 has joined #ocaml
bartholin has quit [Ping timeout: 246 seconds]
bartholin has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gio123 has joined #ocaml
<gio123> octachron : hi
bartholin has quit [Ping timeout: 244 seconds]
<olle> gio123: Maybe you should join the beginners channel on OCaml's Discord instead?
<olle> Might get better answers there
<gio123> olle? beginners? so, you think threads are for beginners :)?
<gio123> very funny...
bartholin has joined #ocaml
raskol has quit [Ping timeout: 246 seconds]
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
raskol has joined #ocaml
gravicappa has quit [Ping timeout: 248 seconds]
Everything has quit [Quit: leaving]
<d_bot> <toots> Hey there! Sorry if this has been covered before but I'm trying to compile some code using `unix` with ocaml 5 and `dune` and I keep getting this:
<d_bot> <toots> ```
<d_bot> <toots> Error: Library "unix" in /home/ubuntu/.opam/5.0.0+trunk/lib/ocaml is hidden
<d_bot> <toots> (unsatisfied 'exist_if').
<d_bot> <toots> ```
<d_bot> <toots> I haven't been able to find any details about this online.
<d_bot> <octachron> You need to update dune to the version in the alpha repository
<d_bot> <toots> That worked thanks
<gio123> octachron : may I ask one more quuestion?
<octachron> Don't ask to ask, ask.
<gio123> in every event we can push single function or more...
<octachron> You push values to channel. Not events.
<gio123> send c (f b) here f b is computed and sent to c?
<octachron> Yes
<gio123> since we had
<gio123>  create (fun () -> sync (send c (f b))) ()
<gio123> i thought fun ()
<gio123> was making it lazy...
<octachron> Yes, but `Thread.create` evals the function on the created thread.
<gio123> vut, look
<gio123> but, look
<gio123> val send : 'a channel -> 'a -> unit event
<gio123> send returns event
<octachron> What what is the issue with that?
<gio123> u said, send pushs value to the chanell
<gio123> but as you see send returns event
<gio123> so, send is sending event to the chanell. Agree?
<octachron> No.
<gio123> send : 'a channel -> 'a -> unit event
<gio123> return type of it is event
<octachron> The function `send` send values to the channel, but the communication does not succeed immediately
<octachron> The event returned by send is "the value was sent to the channel"
<octachron> Before you synchronize this event, the status of the associated `send` is unknown.
raskol has quit [Ping timeout: 240 seconds]
<gio123> "the value was sent to the channel" this looks to me kind of side effect
<octachron> It is a side effect.
<gio123> sync the event should give me value and send does not return value
<octachron> Send returns a value, the event to sync to ascertain that the value was sent. And syncing the event returns a value, unit, aka "some effect was computed".
<gio123> aha
<gio123> btw what will happen without sync?
<gio123> (f b) will  not be send to chanell?
<octachron> Whatever the scheduler want. For example, the communication might not be sent before the end of the program.
<gio123> create (fun () -> send c (f b)) () in
<gio123>     c
<gio123> here (f b) might not be sent in c
<gio123> no?
<octachron> So the communication will start, but you have no guarantee it will really happen before the end of the thread/program.
<gio123> so, sync forces  send c (f b)) to finish action before other action starts?
<octachron> On the current thread yes (but nothing happen after `sync` in the worker thread in your code example).
<companion_cube> Afaik nobody uses the Event module
<gio123> in my understanding, synchronization is important to avoid useing from several user  same function
<gio123> in my example, since we generate each thread for each function, it is nto clear where synchronization is needed
<octachron> That's not the purpose of synchronisation. Synchronisation is here to synchronize the time of events and programs.
<gio123> aha, in Java synchronization of methods seems is smt else
<octachron> But companion_cube is right, you might be better served by listening to the Domain tutorial for OCaml 5? (https://discuss.ocaml.org/t/a-tutorial-on-parallel-programming-in-ocaml-5/9896)
<gio123> anyway, for the input par_unary (fun x -> x + 1) [8;1;1] it will reduce to the call [worker 8; worker1; worker1]
<gio123> each woork n creats a chanel
<gio123> and then sends  (fun x -> x + 1)  n to chanell
<octachron> synchronisation methods in Java are a mixture of critical sections and some ordering constraints. They are not similar to Event.sync.
<gio123> so, at some point we will have [channel 9; channel 2; channell 2]
<gio123>  List.map (fun d -> sync (receive d))  [channel 9; channel 2; channell 2]
<gio123> retunrs
<gio123>  [sync (receive channel 9)); sync (receive channel 2)); sync (receive channel 2))] which reduces [9;2;2]
<gio123> ok?
<octachron> Yes
<gio123> headache :)
<gio123> very last question. We know that threads are comunicating using chanels
<gio123> I do not see in my example this comunications... does my threeds comunicate at all?
<octachron> Each worker thread communicate with the main thread through the channel created for each elements of the list. There is no communication between worker threads
<gio123> for this concrete input we get three worker thread. Is not?
<octachron> Yes, there is three worker thread in your example
<gio123> and one main thread?
<gio123> which one is main thread for my example? could you write it for me please?
<octachron> The main thread is the one that run your program.
<gio123> ok, clear
<gio123> thx
gio123 has quit [Quit: Client closed]
raskol has joined #ocaml
raskol has quit [Ping timeout: 256 seconds]
brettgilio has joined #ocaml
waleee has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
zebrag has quit [Ping timeout: 240 seconds]
bartholin has quit [Quit: Leaving]
olle has quit [Ping timeout: 246 seconds]
klu_ has joined #ocaml
klu_ has joined #ocaml
emp_ has joined #ocaml
raskol has joined #ocaml
omegatron has quit [Quit: Power is a curious thing. It can be contained, hidden, locked away,and yet it always breaks free.]
klu has quit [*.net *.split]
greenbagels has quit [*.net *.split]
troydm has quit [*.net *.split]
ccx has quit [*.net *.split]
companion_cube has quit [*.net *.split]
emp has quit [*.net *.split]
companion_cube has joined #ocaml
troydm has joined #ocaml
ccx has joined #ocaml
greenbagels has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]
raskol has quit [Ping timeout: 244 seconds]