[Top][All Lists]

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

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

From: Felix Höfling
Subject: Re: [h5md-user] Mandate Variable-length string datatype
Date: Mon, 23 Sep 2013 17:45:51 +0200
User-agent: Opera Mail/12.15 (Linux)

Am 23.09.2013, 17:38 Uhr, schrieb Peter Colberg

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.

I don't get your point. Why are readers and writers not interoperable? The
only thing needed is that the reader queries the type of string using
H5Tis_variable_str() and acts accordingly. These are just a few lines
which are needed once in a function read_string().

The writer can write fixed or variable-length strings as it likes.


reply via email to

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