Yeah, you're probably getting bored of these. You're probably wondering: "Jacob, what exactly is a MUD, anyway? Well, at least some of you are. But I'm not going to get in to that. The Internet is a big place, you can find that on your own. Suffice (for me) to say, it's my current hobby, a "pet project" of mine spanning nearly a decade. Off and on. Okay, so mostly off, but some on.
On with the update! If you keep up with this blog (and I can only assume you do if you read this), you know I've run in to issues with unstructured text files and saving complicated data objects to a storage media and then restoring them. I began a search for the right solution—a white whale, a magic bullet, whatever you wish to call it. My first instinct was to leap to XML because it can surely solve this small problem with ease. Right?
Wrong! XML is complicated, both to read and write (by machines anyway). Yes, there are libraries to help with that. Oh there are such libraries that you have no idea what you may be getting yourself in to (most of you, anyway).
Throwing out XML, and going with a cow-orker's recommendation of implementing JSON, I began writing a proof-of-concept program to save and restore data, but quickly ran in to a serious issue: JSON doesn't support multi-line strings.
Yet more searching around yielded a link to YAML, which I posted about the other day. YAML is easy to read from a human standpoint, and even has a couple of C++ libraries to help read it. YAML supports everything I want to do. So I scrapped the JSON project and started a proof-of-concept for YAML. I quickly ran in to an issue reading YAML, but it turned out to be my own fault: I didn't understand how a part of the library worked. Shortly after that, though, I did uncover a bug in the yaml-cpp library with indicator characters used as scalars (this is where you non-technical people either stop reading, or stick your fingers in your ears—metaphorically—and ignore me from here on out). With that issue wrapped up, serious work began and the proof-of-concept grew wings and took off. Just like I hoped it would.
Now I'm in the midst of tearing out underlying serialization code (the part that handles the loading and saving of objects), and it looks like it may take many hours to get things back up and working again. But hopefully by that time I'll have a full-blown, ready-to-use system that will require very little future modification.
Since then I have also become aware of (thanks Keith) the Boost Serialization library. It does the same thing I'm looking at doing, but a little more generically, just like Boost always does. Now the dilemma is: do I go forward with the YAML code, or switch to boost::serialization? Perhaps another proof-of-concept program should be written to determine this, but I need to do a little more research. Right now I have no idea how the serialized data looks to human eyes, and I haven't found any examples yet. It's important to my project to have these files as easily modified by humans as by machines.
In summary, that's where the project sits today. I may have some time this week to work on it, but if it's anything like last week I'm not going to have the brainwidth (I just came up with that word!) to work on it. Fortunately, Lorien and I plan a vacation to see family in Oregon in another week, so I should have a few idle days to work on it then.
PS. And wouldn't you know it, I just ran across Google's Protocol Buffers, yet another solution for basically the same problem. I have my work cut out for me!
- The further I get with my #mud project, the more I think I should use a good XML library. Going to evaluate Apache's Xerces first... #
- My youngest brother Wes is coming over. Programming will stop soon. #
- Multitasking at work-like usual. Always have a dozen projects going at the same time... #
- Once again, the office is realy warm #
- Way too warm in the office today. #
- Dinner at Cedars tonight. Trying to figure out how we're all getting there. #
- Cedars was nice. Expensive but nice. Out at Blue Creek Bay again for the big going away party. #
- Tired, but have a little work to get done, despite it being my day off. See how dedicated I am? #
- Writing a new, shinier MySQL server and query API #
- Holy cow have you seen the Firefly Serenity model @QMXInsider made?! http://www.quantummechanix.com/Serenity.html #
- Had yesterday off work, it's hard being back. #
- Bummer. The C++0x schedule has slipped at least a year. C++ concepts are on the backburner. #
- .tar.bzip2'ing website. It's at 4Gb and climbing.. Jake is sad. #
- A website just shouldn't be this big... #
- Awesome hilarity about the C++0x standard: http://bit.ly/jBEs7 #
- The @wootoff is going strong. And I'm going home #
- Woohoo! More Bacon Salt from the @wootoff !! #
- Reading through a C++ library to parse JSON-encoded data. It looks hopeful to use in my #mud project. #
- Looking up some information on YAML now. Would it be more viable than JSON? #
- The issues are: a good C++ library and multi-line string support. Not sure about JSON on that second matter. #
- Apparently you can trick JSON in to supporting mutli-line strings by separating them with the Unicode Newline char. What a hack... #
- It looks like YAML is a clear winner. Next step: write a proof-of-concept! #
- Well the @wootoff is over. Got more bacon salt. No bag o' crap this time. #
- Got a YAML file written with real data. Tested on the YAML website and it parses valid. I'd write more tonight, but..hey wait, no I won't! #
- Really tired this morning, didn't sleep well at all. #
- Waiting for Lorien in the car, we're going to work together today #
- Need lunch. No time.....Need TIME! #
- REALLY frustrated with Microsoft's s***ty DHCP and DNS updating mechanism #
- Running biweekly tape drive cleaning. Hiding out in the cool server room. #
- Woot the Dow broke 9k finally. Now if only I hadn't already lost tons of money... #
- Working on my YAML parser. The yaml-cpp project doesn't seem to support the entire YAML 1.2 standard... #
- Done coding for the day. Going to read some Charles Stross. Mmmm, that's good science fiction! #
- RT @muskrat_john: #Munchkin turns Eight Years Old. Go up a level! in reply to muskrat_john #
- I saw a werewolf with a Chinese menu in his hand... #
- There is talk of #munchkin bites for lunch. I already had lunch. But I think I will still play. #
- Done setting up for the annual company picnic tomorrow. #
- Time to break out the happy pellets: peanut M&Ms. Unhappy side note: Costco rejected my review of them! Contains no weasels indeed... #
- Specced out new process for demo software registrations for our next version. I <3 meetings. #
- Bought my tickets for the #rifftrax live event on Aug. 20 (mine's for Spokane WA). Have you got yours yet? #
- Trying to get an answer from the #yaml channel on the FreeNode IRC server. Everyone's asleep there. My YAML parser seems to work, though #
- There may be an error with the way the yaml-cpp library reads indicator characters, though. This is what I'm trying to clarify. #
- Just finished reading GDCU level 8 lesson. Thinking about the homeplay assignment #
- Off to do some more reading, then turn in. Company picnic tomorrow. No answer from the #yaml IRC channel yet. #
- Got my answer from #yaml IRC channel by....sleeping! Turns out my YAML code _is_ valid, but yaml-cpp doesn't want to parse it. #
- Won $75 at the company picnic. That's 11.50/hour #
- My YAML issue was confirmed as a bug in the yaml-cpp library, and it's fixed already! Yay! #
- Just got back from JT and Melanie's. They had a computer problem. 5 minutes to fix, 1 hour of chatting to catch up
#
