Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.1.1 released: https://ocaml.org/releases/5.1.1 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
szkl has quit [Quit: Connection closed for inactivity]
gzar has quit [Quit: WeeChat 4.2.2]
hsw has joined #ocaml
jabuxas has quit [Ping timeout: 255 seconds]
<discocaml> <darrenldl> mccd: saw your posts about stitch, i gave it a try and it's pretty neat i have to say
jabuxas has joined #ocaml
jabuxas has quit [Ping timeout: 240 seconds]
<dh`> er, immutable, yes
<dh`> obviously, except apparently to my fingers
jabuxas has joined #ocaml
mbuf has joined #ocaml
dh` has quit [Ping timeout: 255 seconds]
cr1901_ has joined #ocaml
cr1901 has quit [Ping timeout: 268 seconds]
Serpent7776 has joined #ocaml
dh` has joined #ocaml
dh` has quit [Changing host]
dh` has joined #ocaml
wingsorc has quit [Ping timeout: 268 seconds]
jabuxas has quit [Ping timeout: 240 seconds]
YuGiOhJCJ has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 240 seconds]
neiluj has joined #ocaml
olle has joined #ocaml
neiluj has quit [Ping timeout: 255 seconds]
neiluj has joined #ocaml
<discocaml> <dinosaure> miou has green thread but I prefer the `fiber` term which is, IMHO, is better defined. But miou, and this is where it differs from eio, automatically has a pool of domains & is able to launch a parallel task which is represented also as a promise. This is the diff between `Miou.call_cc` which launches a fiber and `Miou.call` which asks a domain to run the given task. Both return a `'a Miou.t` which the promise of the task. In other words, it
<discocaml> <dinosaure> It is described here: https://robur-coop.github.io/miou/#when-not-to-use-miou and if you want to understand how to implement a basic scheduler with effects, this book is perfect 🙂
bartholin has joined #ocaml
kurfen has quit [Quit: ZNC - https://znc.in]
kurfen has joined #ocaml
neiluj has quit [Ping timeout: 260 seconds]
<discocaml> <kayceesrk> Hey @dinosaure
<discocaml> <kayceesrk> > Computations are periodically interrupted
<discocaml> <kayceesrk> Does that mean there is preemptive multi-threading in miou? i.e, timer interrupts forcing a context switch? How does this work?
<discocaml> <dinosaure> I should probably ask what you mean by context-switch but to clarify according to your example, a `Miou_unix.sleep` will invoke `select(2)` and leave the opportunity for another pending task to run (according to the round-robin policy).
<discocaml> <dinosaure> basically, any effects do a suspension, put the suspended task in the end of the todo list, then miou lookup for system events and run the next pending task
<discocaml> <dinosaure> a special case exists for the cancellation but we are deeper in details 🙂
<discocaml> <dinosaure> ah and about domains, actually, I/O are local to domains - we don't share events across domains (it's too complicated and probably not really interesting)
<discocaml> <dinosaure> so a domain can sleep and, at the same time, another domain can run few tasks (and handle its events)
waleee has joined #ocaml
neiluj has joined #ocaml
<anadon> Is there a good way to split strings taking into account escaped characters?
waleee has quit [Quit: WeeChat 4.1.2]
<octachron> It depends what you mean by "good way" and "escaped characters" (and on the nature of "strings"). If you have small delimiters, comparing normalized character subsequences with the delimiter is probably good enough.
neiluj has quit [Ping timeout: 255 seconds]
neiluj has joined #ocaml
<anadon> I'm trying to split $PATH correctly, and handling "\:" correctly, because _somebody_ is going to include a colon in their actual filepath eventually.
neiluj has quit [Ping timeout: 268 seconds]
<discocaml> <limp.biskit> anadon: i would just write a regex will
<discocaml> <limp.biskit> something like [^\]:
<discocaml> <limp.biskit> something like [^\\]:
<anadon> I'm looking at that, and checking if I can have the assumption that results maintain ordering.
<anadon> Also, if I do that, I'd have to correctly infer when to re-merge on splits which would be a pain.
<anadon> It really looks like it'll just be easier to implement my own from scratch. I don't think it's worth the fuss of using the stdlib.
neiluj has joined #ocaml
jabuxas has joined #ocaml
jabuxas has quit [Ping timeout: 260 seconds]
gzar has joined #ocaml
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
neiluj has quit [Ping timeout: 240 seconds]
waleee has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 240 seconds]
<discocaml> <kayceesrk> > context switch
<discocaml> <kayceesrk>
<discocaml> <kayceesrk> If a fiber is purely CPU bound (spins in an infinite loop), does it allow other fibers to run? From your answer, probably not. (Neither does Eio).
neiluj has joined #ocaml
<discocaml> <dinosaure> ah yes, in this case, we the fiber keeps the exclusivity of the cpu but I'm not certain that it's possible to avoid this case in pure OCaml
<discocaml> <dinosaure> ah yes, in this case, yes the fiber keeps the exclusivity of the cpu but I'm not certain that it's possible to avoid this case in pure OCaml
neiluj has quit [Ping timeout: 256 seconds]
neiluj has joined #ocaml
<companion_cube> With threads you might still make progress
<companion_cube> Unless you have n fibers locked in a loop at the same time of course
neiluj has quit [Ping timeout: 240 seconds]
neiluj has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
jabuxas has joined #ocaml
neiluj has quit [Ping timeout: 260 seconds]
neiluj has joined #ocaml
<discocaml> <limp.biskit> sounds like you want something with preemptive multitasking
<Leonidas> anadon: also, what about "C:\path\with\colon":more:paths
olle has quit [Ping timeout: 252 seconds]
<neiluj> hi! can this pattern be simplified? https://bpa.st/JJQA
ocra8 has joined #ocaml
<discocaml> <hockletock> `Ok y` can just be `Ok _`
<neiluj> yep! thx
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
quernd80 has quit [Read error: Connection reset by peer]
quernd804 has joined #ocaml
<anadon> Leonidas: They need to be escaped, unless there is some other canonical way to split `Sys.getenv "PATH"` correctly.
<anadon> But seeing as this is for bash shell checking, I doubt Windows will ever have to be taken into account.
ocra8 has quit [Quit: WeeChat 4.2.2]
neiluj has quit [Ping timeout: 268 seconds]
mbuf has quit [Quit: Leaving]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 268 seconds]
wingsorc has joined #ocaml
neiluj has joined #ocaml
wingsorc has quit [Ping timeout: 260 seconds]
gentauro has quit [Read error: Connection reset by peer]
gentauro has joined #ocaml
neiluj has quit [Ping timeout: 260 seconds]
neiluj has joined #ocaml
waleee has joined #ocaml
neiluj has quit [Ping timeout: 260 seconds]
neiluj has joined #ocaml
waleee has quit [Ping timeout: 264 seconds]
jabuxas_ has joined #ocaml
neiluj has quit [Ping timeout: 240 seconds]
jabuxas has quit [Ping timeout: 256 seconds]
waleee has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 260 seconds]
torretto has quit [Ping timeout: 260 seconds]
Serpent7776 has quit [Quit: leaving]
neiluj has joined #ocaml
torretto has joined #ocaml
nore has quit [Ping timeout: 268 seconds]
nore has joined #ocaml
waleee has quit [Ping timeout: 264 seconds]
waleee has joined #ocaml
motherfsck has quit [Quit: quit]
waleee has quit [Ping timeout: 264 seconds]
waleee has joined #ocaml
neiluj has quit [Quit: WeeChat 4.2.1]
jabuxas_ has quit [Ping timeout: 256 seconds]
bartholin has quit [Quit: Leaving]
troydm has quit [Ping timeout: 240 seconds]
jabuxas has joined #ocaml
Tuplanolla has joined #ocaml