proposal: add bytesof Property, reduce pointer/cast requires

redsea redsea at 163.com
Sat Nov 17 20:37:29 PST 2007


Robert Fraser Wrote:

> redsea Wrote:
> 
> > if d can supply a internal property, let's say bytes of, can give us the correctly byte [] slice
> 
> It's not a bad idea, but I can see it being used rarely enough it wouldn't be necessary. Plus, if you're really serializing something for cross-platform use, you should consider endianness, which neither your method nor bytesof would capture.

I don't care endians in most case, because most of my application need high performance, I don't want to waste CPU time when I use X86 servers (&clients).  X86 serve is powerfull and cheap. 

At china, here are many mass online game providers, theire program would also direct send struct for simplify and efficiency, don't care about endians too.

At, I  use share memory to do comunications between processes,  between a D program and C++ program,  even send struct via netlink interface to linux kernel, here we don't have endians  problem -- but the align problem want to be check carefully, we write a  public .inc head file, include in c and  mixin(import) in d, and a program to verify their size is match.

En, perhaps later, I would care about endians, because I maybe would use MIPS network processor (hope gdc stable enough to write the management program on the chip at that time), but there still more high bandwidth internal communication don't need to care about endians.




More information about the Digitalmars-d mailing list