<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).
<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, 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
<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.]