forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Lib io
brson edited this page Apr 17, 2013
·
29 revisions
Module editing plan template
- Proposed editor: your name
- Date proposed: date of proposal
- Link: link to email
- There are some
- Standard: standard - link to docs - ...
- .NET
- Java io nio
- C / C++ stdio
- C++ iostreams - Probably don't want to take a lot of influence from C++
- C++ boost iostreams
- C (Plan 9) bio - tidied up / simplified stdio
- D stdio - stdio-like
- Go - many fine-grained interfaces
- Python 3 io - includes text/binary division
- Common Lisp streams - very composable, possibly over-engineered
- Haskell System.IO
- Ada streams streamIO sequentialIO
- File
- TCP socket
- Unix domain socket
- Pipe
- UDP
- Memory buffer
- String
- Formatting + formatted values
- Serialization
- Pattern matching and replacement
- Character encodings
- Compression
- Encryption
- Return values - requires explicit checks, lots of noise
- Exceptions - results in nicer looking code, error handling at arbitrary granularity
- Pull request: link to bug
I/O is an area where nearly every operation can result in unexpected errors. It needs to be convenient to use I/O on the non-error path while also possible to handle errors efficiently.
Some use cases:
- I'm hacking together a quick prototype or script that does a bunch of file manipulation. Thinking about all the possible ways I/O could fail is not the point of this work and it's ok for the entire process to fail if something goes wrong. I don't want to be inconvenienced with handling errors.
- I'm doing some performance critical I/O on a server and want to recover from an I/O failure in the most efficient way possible. I'm ok with writing extra error handling code.