c11n: Serialization in C
October 31, 2008 on 1:28 am | In General | 2 CommentsA couple years ago i mused on the idea of writing something similar to libs11n, but for C. At first i dismissed it outright, and after writing a small bit of code to see what the data structures might look like, i dismissed it again. C simply doesn’t have the expressiveness to pull it off as elegantly as C++.
Until a year or so ago, i hadn’t used C since about 13 years. Inspired by the Fossil project, however, i’ve taken a new interest in it. A few days ago, while working on pegc, i stumbled across an idea which looked like it might make a C variant of s11n possible. So i sat down and started hashing some code out, again to see what the data structures might need to look like. Low and behold, i found an approach which isn’t nearly as elegant as C++ allows for (namely due to automatic selection of types and functions via template resolution), but it would indeed seem to be possible.
As one might have suspected, i named the code “c11n”, short for “Cerialization” or “Serialization in C”.
[... one day later ...]
At about 16:00 CET/GMT+1 on October 30th, 2008, i successfully serialized and deserialized an integer value using c11n, so the general approach has proven itself to work. A few hours later it had support for all the standard PODs and a client-side custom struct type had also been demonstrated.
There is much work to be done, in particular in how to simplify integration of client-side structs. After that there’s even more work to be done to add at least one file format (like s11n, c11n’s core is ignorant of all data formats).
Since the code is basically alpha right now i haven’t bothered to put it online. Once i’ve got support for more “Cerializable” types than the basic PODs i’ll get something put into SVN so others can play with it. Barring an unforeseen catastrophe, c11n will eventually be released as part of the s11n project. (While s11n and c11n are in no way compatible with each other, c11n falls comfortably within the s11n project’s goals and ideals.)
Anyway… back to hacking…
Update: 2 Nov 2008: c11n now has a source repository:
http://fossil.wanderinghorse.net/repos/c11n/
As of about an hour ago it has support for two file formats (one adopted from libs11n and one saves and loads objects as SQL code). However, the public API for i/o isn’t yet as transparent/uniform as i’d like it. All in all, though, it’s coming along nicely.
Qt Developer Days: Oct 13-15, 2008
October 15, 2008 on 4:27 pm | In software-dev | 1 Commenti just got back from the Munich, Germany session of this year’s Qt Developer Days 2008, and now have a few things to say about Qt and ostriches…
First off, if you’re an avid Qt developer and you’re not already a guru, the DevDays
almost certainly has something for you. i’ve used Qt off and on since the middle of 2000, but am very far from being a Qt guru. In August i heard about the DevDays and saw that it would coincidentally be held less than 100 meters from my current place of work. So i signed up with the hopes that i could learn some things to help me improve QBoard and to get some tips which might be useful for another Qt-based project i hope to eventually start writing some day. (And it gave me a great excuse to skip work for three days.)
This was my first ever software seminar, so i had absolutely no clue what to expect. i certainly didn’t expect an ostrich.
Overall i’m glad i went. While most of the topics were, in my opinion, too high-level (that is, not complex enough), some of the presentations were really good and were at a reasonable complexity level (especially the “The Depths of Qt” presentation, the session from which i learned the most). All of the speakers knew their topics well and while most were also good presenters, one or two of them will need to work on their presentation skills before next year’s conference.
Day One was basically an intro to Qt, with an instructor showing us (about 45 people) the basics of Qt and answering questions (most of them from yours truly). At the start of the presentation the instructor explained that the course was actually over-booked. They normally take only 25 people, but the web page registration process had a bug and didn’t close registration until some 47 people had registered. So we were packed in a bit tight, and i was glad i hadn’t bothered to take my laptop (i was one of only two or three without a laptop that day). Aside from the tight seating (and the correspondingly long lines for the lunch buffet (none of it containing ostrich meat)), the course was (IMO) a success, and i went away feeling that i had a better understanding of the basics of Qt.
The most notable thing about Day One was this: of the 45 or so participants present, there were 3 or 4 women in the group. As we all took our seats before the presentation started, i listened to what was going on in the room. i could hear about 40 pairs of hands typing away and clicking on mice, most of them trying to figure out if there was a wireless network (there was, but at 108 Euros for 1 week of access… no, thanks). And i heard 3 or 4 female voices chattering away. None of the men spoke, despite their close proximity to one another - they were all too obsessed with their PCs. The women, however, chitchatted freely with one another (very possibly about ostriches). It was an interesting observation, though i don’t dare to [publically] speculate on the deeper meaning of it.
Days Two and Three were completely different from the first day. When i arrived i was amazed to see not 40-some-odd people, but around 400-500, most of them obviously programmers (the black t-shirts are a dead giveaway) but also a number of business-side customers and managers, but no ostriches were yet to be spotted [that's the cheatah's job, actually]. The first few hours of Day Two was marketing hype and other (largely off-topic) presentations from Qt/Trolltech/Nokia management (each presenter made the point (several times) about Qt now belonging to Nokia), and an interesting (but also largely off-topic) discussion of concurrency and multi-CPU/core/thread platforms by the Editor in Chief of Dr. Dobb’s Journal, Mr. Jonathan Erickson. (While i didn’t notice it at the time, another visitor later pointed out how Mr. Erickson (quite innocently) suggested the use of Boost Threads, instead of advertising the QThread class of the seminar’s sponsor. Also, i found it funny that his last name is Erickson but he’s at a Nokia conferrence.)
After that it was a series of technical presentations, just over an hour each and running three at a time (you had to pick which of three to visit). As in Day One, they had apparently over-booked just a bit, and invariably we had a significant number of people who had no seats and ended up lined up along the walls or on the floor in front of the podium. (The caterer, by the way, did an excellent job of handling the crowds (and the food was exceptional), except that during one break we ran out of coffee. A downright tragedy.)
A few things really surprised me about the conference in general, namely:
- The Qt developers call it “Cute”, not “Q-T”, which of course opens it up to tiresome puns like “it’s a cute bug” and “it’s not compatible with cute” [i.e. "it's ugly"].
- How many of the visiting developers were developing for Windows. The vast majority.
- How many visitors and Qt developers use/develop for an Apple product. That didn’t actually surprise me, but depressed me nonetheless. (i mean, Apple has less than 10% of the market, more than 90% of the hype, and less than 10% of their market share or hype are deserved.) i can’t count how many times i heard, “[this or that feature] cannot work the same in Mac because Apple won’t let us do it.” Apple “won’t let them” change the default font sizes or recolor a GUI button to red. My OS vendor doesn’t have any say-so in how i use my machine, and i can’t for the life of me understand why people tolerate that from any OS vendor.
- i was the only visitor i saw without a company name on his name tag. My assumption is that most Free/Open Source developers probably didn’t want to shell out the cost of admission, which was admittedly more than a few coins.
- 98% of the visitors had short hair. i apparently no longer fit the current software developer stereotype and will need to re-think my place in society. (Only two other men had hair nearly as long as mine, and the guy with the long dreadlocks could certainly have much longer hair if he’d bother to wash it.)
- Despite all the ostrich references, i hadn’t seen a single ostrich.
In any case, if you get a chance to visit Qt Dev Days in the future i can heartily recommend it, especially if you haven’t been to one the previous year. i don’t know if visiting Dev Days two successive years would provide enough new content to justify the cost (at least for the private developer, such as myself, paying out of his hobby budget), as the presenters often said, “this presentation is similar to the one given last year.” But the seminar was informative and a great opportunity for networking (if one is into that type of thing).
And if a Qt’er mentions ostriches (and does so way out of context, as in “I’m glad this slide has no ostrich on it”)…
After the next-to-last session i caught up with one of the Qt developers and said, “you’re the 3rd or 4th presenter i’ve heard make pointless ostrich references. There’s gotta be a story there. What is it?” He broke his previously serious manner to laugh and explained that it’s a running gag with the sole purpose of getting people to ask, “what’s with all the ostrich references?” Apparently this gag changes from year to year - last year a visitor raised his hand during one of the sessions to ask, “why does everyone keep mentioning steak restaurants?” While i did refrain from asking during the session (i considered it too off-topic), i couldn’t resist asking when i got the chance. And, like it or not, there’s the answer.
Anyway…
Happy hacking and happy ostrich hunting!
PS: if you were at DevDays and are curious who i am - i was the one with the bandana on his head (it keeps The Hair out of my eyes).
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^