[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [h5md-user] Mandate Variable-length string datatype

From: Peter Colberg
Subject: Re: [h5md-user] Mandate Variable-length string datatype
Date: Mon, 23 Sep 2013 11:38:03 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Sep 23, 2013 at 10:43:39AM +0200, Felix Höfling wrote:
> I'm not in favour of restricting the string types and also not of
> variable-length strings.
> I don't see any benefit for the file format in such a restriction.
> From a C++ perspective which hides memory allocation in std::string for
> instance, reading a fixed string is much easier. Otherwise, one has to
> read a C-string first and to copy to std::string second. (I definitely
> don't want to return a plain C-string in C++) For low-level languages the
> converse is true. Eventually, reading a string will go to a single
> function inside the reader program and there it is not too much pain to
> implement both types of strings IMO.

Abstractions are very hard to get right. To day I have not seen a
single C++ interface to HDF5 that is useful beyond the initial goals
at its conception.

While it is important to have high-level interfaces that guide new
H5MD users (e.g., pyh5md), it is equally important to support those
users that write high-performance programs using the HDF5 API.

Keeping the choice between fixed- and variable-length strings will
simply mean that many writers and readers will not be interoperable,
even if they use the same domain-specific data.

> Concerning string arrays, I'm not sure whether it is possible to store
> vlen strings.

Of course. I should clarify that the restriction to variable-length
strings would only apply to existing elements of the specification.
For a string dataset, it is more efficient to use the fixed-length
string datatype, if the string elements are of similar length.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]