Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 13 20:57
    kit-ty-kate synchronize #751
  • Dec 13 20:26
    kit-ty-kate opened #751
  • Dec 06 20:47
    imbsky commented #750
  • Dec 06 20:47
    aantron commented #750
  • Dec 06 20:46

    aantron on master

    Update README.md (#750) (compare)

  • Dec 06 20:46
    aantron closed #750
  • Dec 06 20:43
    imbsky opened #750
  • Dec 06 17:30
    SumitPadhiyar commented #583
  • Dec 06 13:55
    aantron commented #583
  • Dec 06 08:04
    SumitPadhiyar commented #583
  • Dec 06 07:19
    aantron commented #583
  • Dec 06 05:19
    SumitPadhiyar commented #583
  • Dec 05 19:02
    aantron commented #583
  • Dec 05 17:21
    SumitPadhiyar commented #583
  • Dec 05 17:20
    SumitPadhiyar commented #583
  • Dec 05 15:38
    aantron closed #740
  • Dec 05 15:38

    aantron on master

    discover.ml: expose --verbose f… (compare)

  • Dec 05 11:08
    madroach closed #749
  • Dec 05 11:08
    madroach commented #749
  • Dec 05 10:32
    aantron commented #749
Anton Bachin
@aantron
Orbifx: by the way, we switched Bisect_ppx to MPL 2.0, because it seemed like a good license that has the best features of copyleft and permissive licenses
however, it seems complex and unfamiliar enough that people still have issues. my impression from that experiment is that since we don't intend to go after anyone anyway, it's best to switch Bisect_ppx to MIT at some point
matrixbot
@matrixbot
Orbifx True. I hope we are not going to miss out on companies using the code but not contributing back, cause they think it's ok.
Orbifx Given Lwt's functionality, I don't think it's critical either.
Anton Bachin
@aantron
i hope so too. i hope it's not legal requirements that have been driving contributions :)
matrixbot
@matrixbot
Orbifx Well..maybe in this case.
Anton Bachin
@aantron
Lwt 4.0.0, 4.0.1 are now out :)
matrixbot
@matrixbot
Orbifx 🎉
Angelo Corsaro
@kydos
Hello Anton, I am experiencing some problems when providing a Lwt version of a relatively complex native communication library. In brief, it seams that a blocking I/O call on a function executed as Lwt_schedule.detach blocks anything else from progressing. I've worked around the problem, but I'd like to get to the bottom of this and understand what is causing this strange interaction. To this end, is there any place where I can see the things that a native library may do or don't. Like masking signals, etc. Thanks very much in advance!
Angelo Corsaro
@kydos
Problem solved. It was due to the fact that some of the ctypes calls were retaining the runtime_lock. I think it would be good to mention this somewhere in the doc. I'll document it on our binding and share the link.
Anton Bachin
@aantron
great :) i assume you were using Lwt_preemptive.detach. there is nothing in Lwt itself that should prevent the thread from progressing, modulo any bugs in Lwt. Lwt_preemptive is ultimately a wrapper around ocaml's own threads. the biggest gotcha in it is probably that the default thread limit is 4 or something, which is not enough for many uses. we definitely want to document any other likely snags, so i'll be happy to look at that link :)
Bruce Ricard
@bruce-ricard
Hello, is there any testing framework that is recommended to test Lwt code? I can't find any documentation about that. I found that you have a test directory at the base of the Lwt repo, are we supposed to be using the same thing? What is it?
Angelo Corsaro
@kydos
Thanks @aantron !
Fabian
@copy
@bruce-ricard Alcotest supports lwt and is used by the Mirage team, as far as I know
Anton Bachin
@aantron
@bruce-ricard, @copy makes a good suggestion with alcotest :) here's a link: https://github.com/mirage/alcotest
@bruce-ricard we have a list of libraries you might want to use with Lwt in the README, perhaps we need to move it higher though https://github.com/ocsigen/lwt#libraries-to-use-with-lwt
and if you find something else that should be on there, please tell us about it/open a PR :)
Bruce Ricard
@bruce-ricard
Great, thank you! I'll give alcotest a try.
I feel like that might be a good thing to put there: https://ocsigen.org/lwt/2.7.0/manual/manual A short section about testing with a reference to alcotest.
Pavel Argentov
@argent-smith
@aantron slighty of-topic: do you know anything about libs/compatibility (perhaps lwt port) in Multicore?
Anton Bachin
@aantron
@argent-smith not off-topic at all :) lwt will be ported to whatever happens in multicore, so code written against it should carry into the future
Pavel Argentov
@argent-smith
Thanks for relief :D
Tóth Róbert
@StrykerKKD
Hi guys, I was wondering if there was a way to create a line reading stream from the end of the file with lwt?
Basically what I want is a read_lines function, which starts reading from the end of the file.
Anton Bachin
@aantron
@StrykerKKD sorry for the delayed reply (was away). reading files backwards is usually not so easy. you can either read the whole file normally, split it into lines, and replay the lines in reverse order, or read chunks of the file, starting from the end, into a buffer, and extract lines from there
Tóth Róbert
@StrykerKKD
@aantron Guess I will try to make the second option work, because the first option isn't really space efficient. Thanks for the answer.
Avni Fatehpuria
@AvniFatehpuria
I just made my first PR, and I'm wondering if anyone can give me advice on what issue to work on next? I'm fairly familiar with OCaml, but new to open-source + large codebases in genera
Anton Bachin
@aantron
@AvniFatehpuria thanks, i'm currently reviewing the PR. it's tricky code :)
I think Lwt is out of truly easy issues. you may want to browse around other projects that you use/know of
you could of course try something more complicated in Lwt, or try publishing some code of your own :)
Avni Fatehpuria
@AvniFatehpuria
I would be happy to try something more complicated
Is there something in particular I should look at?
Thank you for all your help!
Didier Le Botlan
@lebotlan
Hi Lwt lobby (is someone still there ? last message seems one year ago).
matrixbot
@matrixbot
slekaml Salut Didier!
slekaml Oh sorry I mistook this chan for the chan of the people who took the ocaml mooc
Didier Le Botlan
@lebotlan

@matrixbot slekaml (Salut ! Et qui est slekaml ?)

Anyway, I have run into a curious pb :

let open Lwt_io in
let () = Printf.printf "FLUSH-1.1b\n%!" in          
flush stderr ;%lwt
let () = Printf.printf "FLUSH-1.1c\n%!" in
[etc.]
The above code blocks at flush (FLUSH-1.1b is printed, but not FLUSH-1.1c)
BUT, this occurs in a very big program, involving ocsigenserver, eliom, various libraries of mine. Of course, I am unable to reproduce it in a small example.
Question : how can possibly flush stderr block ?
Hint : it really blocks the process. CTRL+C has no effect on the running process.
Didier Le Botlan
@lebotlan

Other hint : I have a periodic (debug) task which prints dots :

 let rec loop () =
    Lwt_io.printf "." ;%lwt
    Lwt_unix.sleep 0.1 ;%lwt
    loop ()

As the FLUSH blocks, this loop may block or not (same executable launched a couple of times : once it prints dots repeatedly, but FLUSH is blocked, once it does not print dots and FLUSH is also blocked).

Finally, I am using lwt.4.3.0 (opam pin --dev-repo), ocaml 4.08.1
Anton Bachin
@aantron
@lebotlan I'm not sure why it would hang like that. Looking at the code, it seems like Lwt_bytes.write would have to hang, emptying the internal Lwt_io channel buffer. I suggest to either narrow the case as much as you can, by deleting huge chunks of code from a second copy of your project, or to put lwt as a sibling project of yours into a dune workspace and instrument Lwt_io with prints to get a better idea of what is going on
as for gitter, it still sends me notifications :) though issues is easier, because the notifications are immediate, whereas gitter delays them. i may disable gitter because of that
Didier Le Botlan
@lebotlan

@aantron Thank you for your reply (I wasn't sure this deserved an issue :) )
I'll follow your advice (and also try some other hacks that came to my mind).

For the moment, the bug has disappeared (also I am pretty sure I have not recompiled, only changed the environment - IP, dual screen). So it seems non-deterministic.

My guess is that it is some sort of race-condition, which might be difficult to reproduce in a small program. Anyway, I'll see what I can do.
Anton Bachin
@aantron
+1
also check this issue, which has just been solved in master: ocsigen/lwt#704. it affected Lwt programs that called fork, on glibc > 2.24 (not sure exactly which version of glibc introduced the problem). if you used opam pin --dev-repo, you are likely not using exactly lwt 4.3.0. to be sure about which commit you are using, do a normal git clone, check git log, and then do opam pin add lwt .
Didier Le Botlan
@lebotlan
Thanks, I'll have a look. First I need to get my unsolved bug back :)