On 14.05.2012 16:37, Steven Schveighoffer wrote:
On Sun, 13 May 2012 16:52:15 -0400, Dmitry Olshansky
<[email protected]> wrote:
On 14.05.2012 0:48, Stewart Gordon wrote:
On 13/05/2012 20:42, Walter Bright wrote:
<snip>
I'd like to see std.stream dumped. I don't see any reason for it to
exist that std.stdio
doesn't do (or should do).
So std.stdio.File is the replacement for the std.stream stuff?
How does/will it provide all the different kinds of stream that
std.stream provides, as well as the other kinds of stream that
applications will need?
I think I've seen proper replacement (or rather a draft of it). If
only Steven can be bothered to finish it :)
Yes, I know.
I hate starting things and then not finishing them. Especially when I've
got so much of it completed...
I'm going to make some time to finish this. I need probably a good few
days (of solid time). Which means, based on my normal schedule, 2-3
weeks. Most of the difficult parts are complete, I have a working buffer
implementation, fast unicode translation (meaning UTF-8, UTF-16,
UTF-16LE, UTF-32, and UTF-32LE), and a path to use RAII for seamless
integration with std.stdio.File. I even have preliminary agreement from
Andrei and Walter on a design (no guarantees they accept the final
product, but I think I can massage it into acceptance).
Great!
The one last puzzle to solve is sharing. File is this half-breed of
sharing, because it contains a FILE *, which is a shared type, but File
is not. Then it does some casting to get around the problems.
And it all went nice and well till I spotted FILE*. Boom.
I mean I half assumed we are going to drop this crutch. Yep, too harsh.
So probably leave it as *one* of file backends that features
compatibility with C. Because IMHO using C-runtime this way is not
buying us anything else other then C compatibility and "welcome to the
world of unportable hacks where performance matters".
We need a
better solution than this, but shared is so difficult to use, I think
I'm going to have to implement something similar. It has been stipulated
by Walter and Andrei that fixing this shared situation is a requirement
for any new replacement. I have some ideas, but I have to play around to
see if they actually work and make sense.
Probably it worths checking how std.stdio does it.
--
Dmitry Olshansky