companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.2.0 released: https://ocaml.org/releases/5.2.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
sadomei has quit [Quit: sadomei]
shrewd has joined #ocaml
remexre has quit [Remote host closed the connection]
shrewd has quit [Changing host]
shrewd has joined #ocaml
remexre has joined #ocaml
alfiee has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
alfiee has quit [Ping timeout: 260 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 268 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
ygrek has quit [Remote host closed the connection]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 260 seconds]
<discocaml> <nimbuu> is there any way to get ocamllsp ans ocmalformat to work on single standalone ml files, it works fine with dune projects but doesn't work on just ml files
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
Haudegen has quit [Quit: Bin weg.]
ridcully has quit [Ping timeout: 276 seconds]
ridcully has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 268 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
<discocaml> <jalsol> I filed the exact same issue through the google forms a few days ago
<discocaml> <jalsol>
<discocaml> <jalsol> I asked ChatGPT and it told me to create a dummy project elsewhere
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 260 seconds]
euphores has quit [Quit: Leaving.]
euphores has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
humasect has joined #ocaml
alfiee has joined #ocaml
casastorta has quit [Quit: ZNC 1.9.1 - https://znc.in]
casastorta has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
humasect has quit [Quit: Leaving...]
humasect has joined #ocaml
myrkraverk has quit [Read error: Connection reset by peer]
humasect has quit [Quit: Leaving...]
bartholin has joined #ocaml
Serpent7776 has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 260 seconds]
Mister_Magister has quit [Ping timeout: 246 seconds]
Serpent7776 has quit [Ping timeout: 248 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 268 seconds]
Mister_Magister has joined #ocaml
Tuplanolla has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
Mister_Magister has quit [Quit: bye]
Mister_Magister has joined #ocaml
alfiee has joined #ocaml
Serpent7776 has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
patrick_ is now known as patrick
patrick has quit [Killed (calcium.libera.chat (Nickname regained by services))]
patrick_ has joined #ocaml
rgrinberg has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 260 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
divya has quit [Remote host closed the connection]
<discocaml> <deepspacejohn> You don't need dune to use ocamlformat, just an `.ocamlformat` file.
divya has joined #ocaml
DerTeufel has quit [Ping timeout: 252 seconds]
DerTeufel has joined #ocaml
Haudegen has joined #ocaml
luc4 has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
gzar has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 272 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 268 seconds]
gentauro has quit [Read error: Connection reset by peer]
<discocaml> <tym972_45887> Hi, how to kill a Thread in OCaml?
gentauro has joined #ocaml
luc4 has quit [Quit: Konversation terminated!]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
ygrek has quit [Remote host closed the connection]
euphores has quit [Ping timeout: 252 seconds]
euphores has joined #ocaml
cross has quit [Ping timeout: 252 seconds]
cross has joined #ocaml
shrewd has quit [Remote host closed the connection]
shrewd has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 260 seconds]
<discocaml> <JM> There is a kill function in the Thread module. (And I don't recommend killing a thread in ocaml or any other languages, you'd better have the threads check on some exit conditions and terminate themselves)
<discocaml> <JM> Ah, actually, I've just read the doc... There's a kill function, but it's not implemented...
ygrek has joined #ocaml
<discocaml> <tym972_45887> I need it for a chess engine, it seems tricky and dangerous to me to put stopping conditions in a negamax
<discocaml> <JM> The problem is killing the thread as a general rule doesn't work. You need to know what the thread is doing. Was a resource allocated and needs freeing? Was a lock obtained and need unlocking? Etc.
<discocaml> <JM> So a language/library that allows a generic thread kill function is just allowing future bugs.
<discocaml> <JM> It's annoying because sometimes the thread is doing a pure computation and killing is fine. But we can't always have nice things 😔
<discocaml> <JM> Are you trying to time bound the search? Can't the search itself check how long it has been running?
<discocaml> <tym972_45887> Yes I try to limit the search time, and implement the "stop" function of the UCI communication protocol
<discocaml> <tym972_45887> The problem is that if I integrate a variable into my negamax, it will distort the entries in the transposition table.
<discocaml> <tym972_45887> I don't understand the difference.
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
ygrek has quit [Remote host closed the connection]
<discocaml> <xavierm02_> @tym972_45887 Why is it dangerous? I'd be tempted to just have a ref incremented at each recursive call, and every time it reaches n, I check if a bool "stop" has been set to true (or if too much time has elapsed). If so I raise an exception, that I catch outside of the negamax and cleanly close the thread
<discocaml> <tym972_45887> It is what I have just done. I was worried about a negative impact on the transposition table but I was wrong. It is perfect
<discocaml> <xavierm02_> And you reset the n of course. It's here so that you dont check the time at every recursive call which would be dlow
<discocaml> <xavierm02_> And you reset the n of course. It's here so that you dont check the time at every recursive call which would be slow
<discocaml> <tym972_45887> I don't have any thread to kill
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 265 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
<discocaml> <JM> In your specific case, thre is probably no difference. In the general case:
<discocaml> <JM> The code running in the thread knows what to clean-up (e.g. release the mutex before your exit)
<discocaml> <JM> The code running the thread has no idea what's going on.
<discocaml> <JM> So one can be written safely, the other can not.
myrkraverk has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
<discocaml> <tym972_45887> Ok, thank you for your time.
<discocaml> <tym972_45887> I simply implemented the search output in the negamax, it's simpler and it works as I want.
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
wbooze has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
<discocaml> <lukstafi> Quick question: is anyone mainly using OCaml version < 5.2?
<discocaml> <lukstafi> Never mind.
Serpent7776 has quit [Ping timeout: 248 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 245 seconds]
ygrek has quit [Remote host closed the connection]
bartholin has quit [Quit: Leaving]
wickedshell has quit [Read error: Connection reset by peer]
wbooze has quit [Ping timeout: 244 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 272 seconds]
shrewd has quit [Quit: shrewd]
shrewd has joined #ocaml
malte has quit [Ping timeout: 276 seconds]
malte has joined #ocaml
wbooze has joined #ocaml
wbooze has quit [Ping timeout: 260 seconds]