Hello

Phobos or Tango? 

In fact, both have the functionality that I need (except Phobos has not XML) 
... but they do not have the design I'm looking for 

For example: 

Stdout("message").newline // Stdout is a function, or a global variable of a 
class? opCall is an operator for functions? or for printing?

In addition, the Tango IO only caused problems to me. Also there are many 
unnecessary global class instances  (like stdout and Trace... why not only 
Trace?)... All programs will have many instances Format! (wchar) in memory, 
only because theyr functions arent static. 

Also why use many templates for char, wchar, and dchar? instead use only wchar. 
I cant print an exception in Spanish (my language), because Exception msg is 
char[] and not wchar[].

What I'm looking for, is an API that more than running fast, have design and 
elegance. I like the idea of mixing the power of D with an API like .NET base 
classes.

For example it solves many GC design problems with IDisposable. Then when 
writing code, do a simple look if an object implements that interface, and call 
that method when the object is no longer necessary (to clean everything that is 
done with a C API).

It has its big and unique problems, (like the streams Close method and 
Dispose), but they can be solved while translating it to D, but also  they can 
be redesigned and enhanced.
Power, Speed and Native + Portable and Elegance.

PD: currently I dont use .NET because it is only for Windows. At the same time 
I finded D, and Mono, but I prefer D.

I apologize if this sounds offensive... Only I want is that D will be a better 
alternative for the peopple that was passed years translating code from one to 
other platform because a "little" design problem, makes the write operation of 
a big program, an inelegant and difficult to read code.

At the time, while I used Tango, I writed a little IO API, that was taked some 
design from .NET and Tango. With it, write a file can be done with something 
like this:

scope auto fileStream = new FileStream("file.dat"w, FileAccess.Discard, 256); 
// creates an empty file, and the magic number 1024 is the stream buffer size, 
if it is skipped is 1024 by default (can be zero).

scope auto output = new BinaryOutput(fileStream); 
// this filter can write binary data, and swap bytes for little endian and big 
endian

struct SampleData
{
     int a;
     wchar[] b;
     int c;
     Color d; // an other struct
}

output.put(SampleData(0, "hello world"w, 2, Color.White)); 
// this gets the struct tuple and writes each element recursively.

fileStream.dispose(); 
// flush buffered contents and close the file

I think that this little library can be expanded to a complete Standard Library 
for D. What do you think?

Thank, and sorry for my bad english.

Reply via email to