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/
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
Everything has quit [Quit: Lost terminal]
f[x] has joined #ocaml
f[x] has quit [Remote host closed the connection]
Tuplanolla has quit [Quit: Leaving.]
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #ocaml
_whitelogger has joined #ocaml
troydm has quit [Ping timeout: 248 seconds]
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
pi3ce has quit [Read error: Connection reset by peer]
pi3ce_ has joined #ocaml
bartholin has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
pi3ce_ has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
bartholin has quit [Quit: Leaving]
pi3ce_ has joined #ocaml
pi3ce has quit [Read error: Connection reset by peer]
toastal has quit [Ping timeout: 260 seconds]
toastal has joined #ocaml
chiselfuse has quit [Ping timeout: 260 seconds]
chiselfuse has joined #ocaml
pi3ce_ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
pi3ce has joined #ocaml
olle has joined #ocaml
Haudegen has joined #ocaml
zenmov_ has quit [Ping timeout: 252 seconds]
semarie_ has joined #ocaml
semarie_ is now known as semarie
semarie has quit [Ping timeout: 260 seconds]
semarie has joined #ocaml
szkl has joined #ocaml
mange has quit [Quit: Zzz...]
semarie has quit [Ping timeout: 272 seconds]
semarie has joined #ocaml
semarie has quit [Client Quit]
semarie has joined #ocaml
<sleepydog> anyone got an example of a Cmdliner.Arg.t that accumulates repeated values of the same flag? The vflag_all examples show how to choose between different flags
Haudegen has quit [Quit: Bin weg.]
<sleepydog> I'm trying to have a command line like awk's -v flag, e.g `mycommand -v var1=foo -v var2=bar ...`
<sleepydog> ah, i think i figured it out
szkl has quit [Quit: Connection closed for inactivity]
toastal has quit [Ping timeout: 272 seconds]
toastal has joined #ocaml
Haudegen has joined #ocaml
zenmov has joined #ocaml
zenmov_ has joined #ocaml
zenmov has quit [Ping timeout: 252 seconds]
zenmov_ has quit [Ping timeout: 244 seconds]
gentauro has quit [Read error: Connection reset by peer]
gentauro has joined #ocaml
zenmov has joined #ocaml
zenmov_ has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
zenmov has quit [Changing host]
zenmov has joined #ocaml
zenmov_ has quit [Quit: leaving]
zenmov has quit [Quit: leaving]
zenmov has joined #ocaml
zenmov has quit [Changing host]
zenmov has joined #ocaml
olle has quit [Ping timeout: 244 seconds]
zenmov has quit [Quit: leaving]
zenmov has joined #ocaml
zenmov has quit [Changing host]
zenmov has joined #ocaml
steenuil has quit [Remote host closed the connection]
steenuil has joined #ocaml
steenuil has quit [Remote host closed the connection]
steenuil has joined #ocaml
<discocaml> <lima.leonardo> Hi. I am having some trouble with Eio and could use some help. I am trying to specify three fibers: one that executes an external process; one that writes to the stdin of the external process; and one that reads from the stdout of the external process, as follows:
<discocaml> <lima.leonardo> ```ocaml
<discocaml> <lima.leonardo> let exec (stream: in_channel) =
<discocaml> <lima.leonardo> let ( / ) = Eio.Path.( / ) in
<discocaml> <lima.leonardo> Eio_main.run @@ fun env ->
<discocaml> <lima.leonardo> let proc_mgr = Eio.Stdenv.process_mgr env in
<discocaml> <lima.leonardo> let domain_mgr = Eio.Stdenv.domain_mgr env in
<discocaml> <lima.leonardo> Switch.run (fun sw ->
<discocaml> <lima.leonardo> let w_source, w_sink = Eio.Process.pipe ~sw proc_mgr in
<discocaml> <lima.leonardo> let r_source, r_sink = Eio.Process.pipe ~sw proc_mgr in
<discocaml> <lima.leonardo> let r_buf = Eio.Buf_read.of_flow r_source ~initial_size:100 ~max_size:1_000_000 in
<discocaml> <lima.leonardo> try
<discocaml> <lima.leonardo> Fiber.all
<discocaml> <lima.leonardo> [
<discocaml> <lima.leonardo> (fun () ->
<discocaml> <lima.leonardo> let _ = Eio.Process.spawn ~sw ~stdin:w_source ~stdout:r_sink ~stderr:r_sink
<discocaml> <lima.leonardo> proc_mgr [] |> Eio.Process.await in ());
<discocaml> <lima.leonardo> (fun () -> write w_sink stream);
<discocaml> <lima.leonardo> (fun () -> read r_buf ~domain_mgr)
<discocaml> <lima.leonardo> ];
<discocaml> <lima.leonardo> with Exit -> ());
<discocaml> <lima.leonardo> ```
<discocaml> <lima.leonardo> where
<discocaml> <lima.leonardo> ```ocaml
<discocaml> <lima.leonardo> let write w_sink stream =
<discocaml> <lima.leonardo> Eio.Flow.copy_string (parse_line_from_stream stream) w_sink;
<discocaml> <lima.leonardo> Fiber.yield ()
<discocaml> <lima.leonardo>
<discocaml> <lima.leonardo> let read r_buf ~domain_mgr =
<discocaml> <lima.leonardo> let break = ref false in
<discocaml> <lima.leonardo> while not !break do
<discocaml> <lima.leonardo> Just realized that I should have properly have asked in a different channel. Sorry for the long message.
<discocaml> <lima.leonardo> Just realized that I should probably have asked in a different channel. Sorry for the long message.
<discocaml> <yawaramin> maybe #concurrency
<discocaml> <lima.leonardo> Thanks. Will repost it there.
Serpent7776 has joined #ocaml
Haudegen has joined #ocaml
<discocaml> <yosefbutbitter> what is the best place to ask about ocaml/setup-ocaml
<discocaml> <yosefbutbitter> what is the best place to ask about ocaml/setup-ocaml?
<discocaml> <yosefbutbitter> (Doesn't have to be in this forum)
<discocaml> <yosefbutbitter> what is the best place to ask about ocaml/setup-ocaml? (the github action step to download opam + setup a switch)
<dh`> here's probably as good as anywhere
toastal has quit [Quit: Gateway shutdown]
toastal has joined #ocaml
toastal has quit [Client Quit]
toastal has joined #ocaml
Tuplanolla has joined #ocaml
szkl has joined #ocaml
Everything has joined #ocaml
rgrinberg has joined #ocaml
zenes has joined #ocaml
zenes has quit [Changing host]
zenes has joined #ocaml
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
pi3ce has quit [Client Quit]
zenes has quit [Quit: zenes]
mrtz has joined #ocaml
mrtz has quit [Remote host closed the connection]
bartholin has joined #ocaml
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
Everything has quit [Quit: leaving]