<discocaml>
<darrenldl> @kumar I asked around on my university compsci discord, and got a response:
<discocaml>
<darrenldl> "For OCaml I'd recommend learning how JS's Async library works, which is very similar to async/await in Python and JavaScript. It uses a single thread with a scheduler that (roughly speaking) loops through all the active async/concurrent functions doing a bit of work in each until they're complete. See https://dev.realworldocaml.org/concurrent-programming.html
<discocaml>
<darrenldl>
<discocaml>
<darrenldl> If you want to write concurrent code with multithreading, I'd probably recommend learning Rust using the Rust book (https://doc.rust-lang.org/stable/book/) and finding a good tutorial on using standard library's std::sync::{Mutex, Arc} and maybe std::sync::atomic and std::sync::mpsc. The reason I say Rust is because it gives good compiler errors for many types of memory bugs that are common writing concurrent code, so it teaches you best pra
<discocaml>
<kumar> I am more of a rust person than a js/python person so thanks for the effort and help. I was using tokio, maybe understanding tokio might help. There is also https://lunatic.solutions/ which is an erlang like runtime unlike tokio which has an async-await syntax
<discocaml>
<kumar> I am more of a rust person than a js/python person so thanks for the effort and help. I was using tokio so I'll go forth learning tokio, maybe understanding tokio might help. There is also https://lunatic.solutions/ which is an erlang like runtime unlike tokio which has an async-await syntax
<discocaml>
<kumar> and I maybe after effects ocaml would have a different approach to concurrent programming with effects
<discocaml>
<kumar> specially after eio
<discocaml>
<kumar> But thanks for gathering info and resource! Again really appreciate it
<discocaml>
<darrenldl> yep it'd a more direct style (no more needing to put everything under `Lwt.t` as soon as you want to make use of one), but the general thinking about async would be similar, and you get preemptive scheduling within a domain (i'm pretty sure...)
John_Ivan has quit [Quit: Phantom of the future.]
spip has joined #ocaml
kurfen has quit [Remote host closed the connection]
<discocaml>
<Anurag> These were for educational purposes only, so i'd still look at how Janestreet's async is structured for a more robust production ready async runtime.
azimut has joined #ocaml
bartholin has joined #ocaml
kakadu has quit [Remote host closed the connection]
Exagone313 has joined #ocaml
buoy49_ has joined #ocaml
kurfen_ has joined #ocaml
buoy49 has quit [Ping timeout: 255 seconds]
jsoo has quit [Ping timeout: 255 seconds]
kurfen has quit [Ping timeout: 255 seconds]
Exa has quit [Ping timeout: 255 seconds]
Exagone313 is now known as Exa
jsoo has joined #ocaml
<discocaml>
<kumar> @copy implementation of your own scheduler sounds like a cool thing to do. Thanks for the suggestion I might just do it.
<discocaml>
<kumar>
<discocaml>
<kumar> @BigOof I think lwt_preemptive scheduling is also built on domains.
<discocaml>
<kumar>
<discocaml>
<kumar> @Anurag both samples look interesting I'll have a look thanks! I've never used async by Janestreet but I can try using it. Async is in the real world ocaml book so it's worth trying
<discocaml>
<kumar> Thanks for the suggestions and help 🙏
xd1le has quit [Quit: xd1le]
oriba has joined #ocaml
waleee has joined #ocaml
bartholin has quit [Quit: Leaving]
czy has quit [Remote host closed the connection]
czy has joined #ocaml
czy has quit [Remote host closed the connection]
czy has joined #ocaml
<discocaml>
<masterbuilder> is there any way to get information about local variables when debugging ocaml programs using gdb?
Tuplanolla has quit [Quit: Leaving.]
<companion_cube>
full support for DWARF is still not there, alas
czy has quit [Remote host closed the connection]
szkl has quit [Quit: Connection closed for inactivity]