Sean Middleditch » Scriptix
More work is now done on the AweMUD and Scriptix mergers.
I’ve unified the string representation used in both systems for starts, which wasn’t too bad. I also unified Scriptix::Value with AweMUD’s ScriptValue wrapper class, which was a *huge* pain. Mainly due to C++ type conversion rules kicking me in the ass over and over.
The ScriptValue wrapper had all sorts of automatic converters to turn various native and AweMUD-specific types into Scriptix values. The Scriptix::Value class did not, relying on manual creation of a IValue* object to assign to the value. Making one class that did automatic conversion and making code not intended for automatic conversion was… painful.
The biggest offender was the bool converter. Every native type converts to bool, and when some of the old code (modified in batch with sed and ViM scripts) tried to assigned slightly incorrect pointers or other data to the new Value class it would often just convert it as a bool instead of giving me a type mismatch error. After finally finding the problem after many hours of [drunken] debugging, I solved things by just removing the bool converter. There is no bool type in Scriptix yet, and C++ bool values were just converted to ints anyway. Once that was out of the way, I then had to track down some issues with the String type conversion that manifested in the bowels of Scriptix where I was doing a few funky optimization hacks.
The final problem, which sucked up a huge amount of time, was this little tidbit of code:
class Value {
…
Value (long value);
Value (int value) { Value((long)value); }
};
The problem was of course the second constructor. What I had intended to do was make it so that ints would be converted to Scriptix numbers just like longs without C++ giving me weird type mismatch errors (because apparantly an ‘int’ is just as likely to really be a ‘void*’ as it is to be a ‘long’… yeah, I know _why_ C++ does this, but it’s still irritating). What the code actually does is quite different, though. The Value constructor contructs another value, throws away the result, and returns leaving the pointer member unassigned and thus full of garbage. Once I finally realized what the code was doing and beating my head into a wall for not only writing that crap but looking at it 100 times and not seeing the problem, I fixed it up and everything was good to go.
The following items still need to be done for the merger:
* Get rid of ugly varargs/C-like error handling code in Scriptix and use the AweMUD logging facilities
* Move the AweMUD ScriptFunction* wrappers into Scriptix’s tree and integrate nicely
* Merge Scriptix::System with the AweMUD’s derived version and the IManager-based controller
* De-namespace all of Scriptix, except for the compiler, since Scriptix is no longer a reusable library
* Merge Scriptix::Struct and Scriptable, pick a naming convention for attributes/members
AweMUD 0.23 is out. Scriptix 0.31 is along for the ride, of course.
Well, the biggest AweMUD news is that I have merged the Scriptix codebase in with AweMUD. There is now no longer any need to download, build, and install Scriptix separately from AweMUD. This should make building AweMUD a piece of cake now.
The next big piece of news is that the snapshots should be working again. Of course, nobody actually ever told me they were broken. Who knows how many users downloaded it, saw it didn’t build, and moved on with their lives. ::sigh:: I’m updating my auto-build system to pull off of the snapshots instead of the Arch repo. The snapshots are pulled from the Arch repo, so the change should create a complete test of all distributions of AweMUD, as well as the code itself.
I think that once I push 0.23 out the door, I’m going to concentrate on cleaning up the AweMUD/Scriptix merged code, and push out 0.24.
I decided to skimp on studying today and instead break out Vim and GCC and do a little work on AweMUD.
It’s been two months to the day since the last commit to AweMUD. Certainly feels like it’s been two months. I just haven’t had time for coding. It’s really refreshing to be doing it again, even if it is tedious stuff like making small API cleanups and then fixing the thousands of lines of code that the change affects. :-/
I still need to get the final releases of the new stable AweMUD and Scriptix released. The two weeks with no problem reports is well more than over. Guess I need to wait for the website to come back up first, though.
I’ve got a rather nice looking Todo List for the weekend. Who wants to place bets that I get no more than two items on it done, despite having enough a time for all of them?
- Attempt gateway exam for Calculus III **- Punting**
- Study for regular exam for Calculus III **- Done**
- Study for Latin “quiz” **- Done**
- Do Latin homework **- Done**
- Minor contract work for one website
- Minor contract work for a second website
- Create kanar.org forums (visible and usable by staff/board members only) **- Done**
- Kanar.org PayPal code to test with the winter feast **- Punting**
- Kanar.org event editing UI **- Done**
- Push the final releases of AweMUD 0.23 and Scriptix 0.31 which are a week behind
- Watch the Trigun video (VHS, shudder) I rented **- Done**
- Clean my room
- Clean my Ranger **- Punting**
- Drink lots of rum **- Done**
Prizes to whoever guesses which of those items are the two I successfully get done this weekend.
**Update:** Marking items done as I finish them.
**Update 2:** Looks like I got everything done except for the AweMUD stuff and the work that actually earns me money. :-/
Being the evil lazy bastard that I am, I started making updates to Scriptix instead of working on Scriptix2.
Aside from API updates, there are some langauge changes.
For one, you now have to declare variables using the var keyword:
var foo = 1;
var bar;
Pretty simple. The second big change is that I’ve changed the dereference operator from . to ->. I’m not sure if I like this one, to be honest, so it may change back before I commit the changes.
var foo = object->get_id();
I was planning on using the . operator for string concatenation (instead of using +). However, if I manage to get static typing into Scriptix 1, there won’t be a need for two operators for this other than cleanliness. I could also just use another operator like %, &, or so on. Hmm… let’s compare:
adj + name;
adj . name;
adj & name;
adj % name;
adj @ name;
adj ~ name;
adj | name;
I like the first two best. The second option, using ., is like PHP, which is a language I use a lot. The rest of the options just look alien to me, probably because I don’t regularly use any languages that have operators like those for string concatenation.
The current plan is actually to fold Scriptix into AweMUD. There is no real benefit from having the codebases be separate, and there is a lot of pain and missed opportunities for integration, so I might as well just do it.
I’d want to clean up the Scriptix code a bit to be more AweMUD-style and cleanup the headers a good deal. Then just move the code over and fix up the build. Should make downloading/compiling AweMUD a lot easier, too. I might even go so far as to include a copy of the Boehm GC with AweMUD to make things even easier. Finally, with the merger, I could start using some other mini-libraries like PStrings without having to worry about bloating the build requirements any further by just folding them in.
I’ve been working on Scriptix2 some more again. I still stand by original statement that it would only take a couple of weeks to get done. What I didn’t say is that those couple of weeks worth of work would be spread over half a year. ;-)
So far as Scriptix1 (or Scriptix0, I guess you could call it), I made the mistake of getting in the trap of, “Oh, I can improve it a little, make it a little closer to what Scriptix2 will be like…” Yeah. Week down the drain there. (That week was also spread over many months.)
I’m currently thinking of pulling Scriptix1 into AweMUD. Nobody else is actually using Scriptix, and if they are, I pity them. ;-) Having Scriptix be a separate library just means that AweMUD can’t integrate as well. So right now I’m trimming tons of cruft from Scriptix that was there only because Scriptix was supposed to be general purpose, and then I can see about just dropping Scriptix in the AweMUD source tree and combining a bunch of redundant code.
While I’m at it, I might just drop the GC library into the AweMUD source tree so that people have an easier time compiling AweMUD.
Hmm, I actually touched AweMUD and Scriptix today. Just fixed them up a bit to compile with GCC 4.0, which is now in Fedora Core. (A pre-release is, anyways.)
Also submitted my ported gnome-vfs/gssapi patch to Fedora bugzilla (#150132), since they’re more interested in Kerberos than the GNOME project in general. I’m guessing GNOME upstream won’t integrate my patch at all, but will instead just wait until they do the migration to Neon 0.25. Fedora is pretty keen on Kerberos support, though, so I figured they might want to integrate the patch for FC4.
After a several month slump where coding just wasn’t interesting, and I wasn’t getting much done, I managed to do a whole lot last night. Some big API updates to Scriptix and work on AweMUD. Hopefully I can keep out of the slump for a while longer. ;-)
Lot of work to do this next week. My boss is off on vacation for a week and half, so I’m pretty much responsible for everything at the Township. Fun fun. I’m reaaally hoping nothing breaks…
Also have several contract jobs to work on, including the KANAR web site to finish off. I’m fairly sure I can manage them all this week, given that I have no school and only have work three days this week.
I should even be able to get a good deal of AweMUD work in. Good news. I’m been slowly working on the ruleset code for AweMUD, alternating that work with my Scriptix2 work. I might have some sort of usable demo of Scriptix2 ready in a couple weeks, finally.