Welcome, Guest. Please login or register.

Author Topic: Serialization / persistance library for C  (Read 3005 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Trev

  • Hero Member
  • *****
  • Join Date: May 2003
  • Posts: 1550
  • Country: 00
    • Show all replies
Re: Serialization / persistance library for C
« on: February 18, 2008, 12:19:51 AM »
To start, I think the documentation would benefit from a concise description of the problem you're trying to solve and how you propose to solve it--in plain language, of course. Perhaps a few examples of serialization common in other languages would be appropriate, as you're trying to fix a problem in C for which  many languages have intrinsic or at least commonly accepted solutions. As part of that, you might compare and contrast serialization and persistence as implemented in COM, Corba, or Java.

I have to agree with some of the past comments on the library: the names of the macros are quite confusing. If you must use abbreviations, I would use the accepted (or de facto standard) English abbreviations, e.g. "ser" for serial and serialize and "ptr" for pointer. That's still making an assumption about your audience, though. You may choose to use abbreviations accepted by the computer science community or some other group of programmers. In any case, after skimming the document, it's not at all clear to me what each macro does. Perhaps it should be? That could also indicate a lack of knowledge on my part, so that particular comment may not hold any weight. ;-)

Are the library and serialized objects portable? i.e. Can I serialize an object on a big-endian system and deserialize the output on a little-endian system without corrupting data? How about interoperability with other serialization schemes?

Have you looked at tpl <http://tpl.sourceforge.net/>? (I imagine it's pronounced tuple, but I can't confirm that.) Many of the concepts appear similar to yours. Perhaps your project could add value to tpl or vice versa.

Trev
 

Offline Trev

  • Hero Member
  • *****
  • Join Date: May 2003
  • Posts: 1550
  • Country: 00
    • Show all replies
Re: Serialization / persistance library for C
« Reply #1 on: February 18, 2008, 01:49:53 AM »
Quote
I've allways wondered how the printf function can compare the variables one passes to it with the the format string (which in a way seems to be kind of like tpl works) so that the compiler can issue warnings, I've allways thought this was embedded in the C language itself and not accessible to the user ?


The warnings are compiler-specific. For example, Microsoft exposes Visual C++'s checks in sal.h. See SAL Annotations <http://msdn2.microsoft.com/en-us/library/ms235402.aspx> for more information. (Actually, this is the first time I've bothered to check how Visual C++ does this.) Vbcc exposes similar funcitonality via the printflike pragma, and GCC exposes it via the printf attribute.

The implementation of stdarg.h is platform-specific.

tpl uses the BSD license, which means you can do whatever you want with the source code, including keeping changes to yourself, as long as you include the tpl copyright notice somewhere in your documentation. How you distribute your own software is, of course, entirely up to you. Personally, I think there are far too many closed source Amiga libraries. I find myself constantly reinventing the wheel because I don't want to trust a library on Aminet that was written 15 years ago by an author that's nowhere to be found. Source code would have allowed bug fixes. Apart from that, no one's going to make money selling development libraries for Amiga-like operating systems. There just isn't a market for them. :-(

Trev