Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lwt_io, Printf and Format #310

Closed
Drup opened this issue Jan 9, 2017 · 6 comments
Closed

Lwt_io, Printf and Format #310

Drup opened this issue Jan 9, 2017 · 6 comments
Labels

Comments

@Drup
Copy link
Member

Drup commented Jan 9, 2017

There are two issues with Lwt_io:

  • It needs unix. but the printf part should not.
  • All the printf functions are basically broken. They rely on Printf instead of Format, which has become the standard in OCaml pretty printing, and they do not handle the %a very well.

My current idea is to:

  • Split Lwt_io in two parts, one unix-independent (Lwt_format ?)
  • Deprecate Lwt_io.print*
  • Reimplement all the printing functions in term of formats. There are some concerns with blocking, but I have some ideas to solve them.

I think this process would respect #293 and allows us to improve the state of lwt-based printing.

@aantron
Copy link
Collaborator

aantron commented Jan 9, 2017

I always had the impression that a lot of the functions in Lwt_io should be in a module that corresponds to the I/O functions of Pervasives and does not depend on Lwt_unix – not just the formatting functions.

@Drup
Copy link
Member Author

Drup commented Jan 9, 2017

@aantron maybe we should create new functions in Lwt_unix for the stuff that is unix-dependent in Lwt_io, deprecate them, and move Lwt_io in lwt after the deprecation ?

@aantron
Copy link
Collaborator

aantron commented Jan 9, 2017

Something to that effect. I am not sure if Lwt_unix is necessarily the right destination, but we can use a deprecation to warn about removal of functions from Lwt_io.

@hcarty
Copy link
Contributor

hcarty commented Jan 9, 2017

@Drup Lwt_fmt maybe? For the Format-focused code?

@Drup
Copy link
Member Author

Drup commented Jan 10, 2017

I was wondering if my idea would work, so here is an implementation: https://gist.github.com/Drup/2698c69fd70cf526ba3164b135177bcd

@aantron
Copy link
Collaborator

aantron commented Aug 5, 2019

The biggest part of this was done by @Drup in #548.

@aantron aantron closed this as completed Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants