Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

D: What about streams?

Tags:

stream

d

D seems like a language with very high potential and I'm highly interested in what the future holds for it. I'm curious though, is there any discussion about including streams in D? The C++ streams have been of great help to me in the past and they seem a lot cleaner than using functions like printf/writefln or whatever.

like image 732
Paul Manta Avatar asked Apr 06 '11 05:04

Paul Manta


People also ask

What are streams explain?

STREAMS is a general, flexible programming model for UNIX system communication services. STREAMS defines standard interfaces for character input/output (I/O) within the kernel, and between the kernel and the rest of the UNIX system. The mechanism consists of a set of system calls, kernel resources, and kernel routines.

What are the 3 types of streams?

One method of classifying streams is through physical, hydrological, and biological characteristics. Using these features, streams can fall into one of three types: perennial, intermittent, and ephemeral. Definitions and characteristics of each stream type are provided in this Appendix.

What are streams called?

Depending on its location or certain characteristics, a stream may be referred to by a variety of local or regional names. Long large streams are usually called rivers, while smaller, less voluminous and more intermittent streams are known as streamlets, brooks or creeks.

What is the example of a streams?

The definition of a stream is a steady movement or flow of liquid. An example of a stream is water pouring from a rain gutter during a storm. (computers) A steady flow of data. A flow of water in a channel or bed, as a brook, rivulet, or small river.


3 Answers

There's currently talk of deprecating the current std.stream design and rewriting it. Andrei Alexandrescu posted the interfaces for a proposed new design based on D2's ranges awhile back. Unfortunately the community is short on manpower and trying to get a whole bunch of other library support working, like networking, parallelism, database APIs, containers, etc. Streams are on the agenda, but not on the front burner.

like image 164
dsimcha Avatar answered Nov 09 '22 06:11

dsimcha


Well the current streaming interface is in http://www.digitalmars.com/d/2.0/phobos/std_stream.html

But I think it will be refactored sometime.

like image 45
Trass3r Avatar answered Nov 09 '22 06:11

Trass3r


D has a standard way to pass around thing like a file, a open network connection and stdout. (See other answers) It also has a standard way to convert a struct/object to a string (toString, unless it's been changed). Personally, that gets you all of the parts of C++ streams that I like. I would be opposed to adding the operator overloading stuff as it makes thing like separation of data and format nearly impossible.

like image 25
BCS Avatar answered Nov 09 '22 06:11

BCS