Older blog entries for wainstead (starting at number 97)

13 Jul 2012 (updated 14 Jul 2012 at 04:10 UTC) »

A C++ version of Stunt is born

Compiling:


-*- mode: compilation; default-directory: "~/Sites/projects/moowork/stunt-swain/" -*-
Compilation started at Thu Jul 12 19:38:35

make
[ config.h : config.status ]
./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
g++ -m32 -O -DHAVE_CONFIG_H -c -o ast.o ast.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o base64.o base64.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o code_gen.o code_gen.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o collection.o collection.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o db_file.o db_file.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o db_io.o db_io.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o db_objects.o db_objects.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o db_properties.o db_properties.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o db_verbs.o db_verbs.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o decompile.o decompile.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o disassemble.o disassemble.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o eval_env.o eval_env.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o eval_vm.o eval_vm.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o exceptions.o exceptions.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o exec.o exec.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o execute.o execute.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o extension-fileio.o extension-fileio.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o extensions.o extensions.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o functions.o functions.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o hmac_sha2.o hmac_sha2.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o http_parser.o http_parser.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o json.o json.c
bison -y -d parser.y
mv -f y.tab.c parser.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o parser.o parser.c
touch y.tab.h
g++ -m32 -O -DHAVE_CONFIG_H -c -o keywords.o keywords.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o list.o list.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o log.o log.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o map.o map.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o match.o match.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o md5.o md5.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o name_lookup.o name_lookup.c
touch net_single.o
touch net_multi.o
g++ -m32 -O -DHAVE_CONFIG_H -c -o network.o network.c
touch net_mp_selct.o
touch net_mp_poll.o
touch net_mp_fake.o
g++ -m32 -O -DHAVE_CONFIG_H -c -o net_mplex.o net_mplex.c
touch net_bsd_tcp.o
touch net_bsd_lcl.o
touch net_sysv_tcp.o
touch net_sysv_lcl.o
g++ -m32 -O -DHAVE_CONFIG_H -c -o net_proto.o net_proto.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o numbers.o numbers.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o objects.o objects.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o parse_cmd.o parse_cmd.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o pattern.o pattern.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o program.o program.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o property.o property.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o quota.o quota.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o regexpr.o regexpr.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o server.o server.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o sha1.o sha1.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o sha256.o sha256.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o storage.o storage.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o streams.o streams.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o str_intern.o str_intern.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o sym_table.o sym_table.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o tasks.o tasks.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o timers.o timers.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o unparse.o unparse.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o utils.o utils.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o verbs.o verbs.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o version.o version.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl.o yajl.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_alloc.o yajl_alloc.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_buf.o yajl_buf.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_encode.o yajl_encode.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_gen.o yajl_gen.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_lex.o yajl_lex.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_parser.o yajl_parser.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_version.o yajl_version.c
g++ -m32 -O -DHAVE_CONFIG_H ast.o base64.o code_gen.o collection.o db_file.o db_io.o
db_objects.o db_properties.o db_verbs.o decompile.o disassemble.o eval_env.o
eval_vm.o exceptions.o exec.o execute.o extension-fileio.o extensions.o functions.o
hmac_sha2.o http_parser.o json.o keywords.o list.o log.o map.o match.o md5.o
name_lookup.o network.o net_mplex.o net_proto.o numbers.o objects.o parse_cmd.o
pattern.o program.o property.o quota.o regexpr.o server.o sha1.o sha256.o storage.o
streams.o str_intern.o sym_table.o tasks.o timers.o unparse.o utils.o verbs.o
version.o yajl.o yajl_alloc.o yajl_buf.o yajl_encode.o yajl_gen.o yajl_lex.o
yajl_parser.o yajl_version.o parser.o -lexpat -o moo
rm parser.c

Compilation finished at Thu Jul 12 19:38:51
Running:

bash-3.2$ ./moo Stunt.db Stunt.db.new
Jul 12 19:46:36: CMDLINE: Outbound network connections enabled.
Jul 12 19:46:36: STARTING: Version 1.8.3+?_ad_hoc_?? of the LambdaMOO server
Jul 12 19:46:36: (Using BSD/TCP protocol)
Jul 12 19:46:36: (Task timeouts measured in server CPU seconds.)
Jul 12 19:46:36: (Process id 39697)
Jul 12 19:46:36: LOADING: Stunt.db
Jul 12 19:46:36: LOADING: Reading 11 objects ...
Jul 12 19:46:36: LOADING: Done reading 11 objects ...
Jul 12 19:46:36: VALIDATING the object hierarchies ...
Jul 12 19:46:36: VALIDATE: Phase 1: Check for invalid objects ...
Jul 12 19:46:36: VALIDATE: Phase 2: Check for cycles ...
Jul 12 19:46:36: VALIDATE: Phase 3: Check for inconsistencies ...
Jul 12 19:46:36: VALIDATING the object hierarchies ... finished.
Jul 12 19:46:36: LOADING: Reading 94 MOO verb programs ...
Jul 12 19:46:36: NAME_LOOKUP: Started new lookup process
Jul 12 19:46:36: LOADING: Done reading 94 verb programs ...
Jul 12 19:46:36: LOADING: Reading forked and suspended tasks ...
Jul 12 19:46:36: LOADING: Reading list of formerly active connections ...
Jul 12 19:46:36: LOADING: Stunt.db done, will dump new database on Stunt.db.new
Jul 12 19:46:36: INTERN: 770 allocations saved, 9815 bytes
Jul 12 19:46:36: INTERN: at end, 750 entries in a 10007 bucket hash table.
Jul 12 19:46:36: Loaded protect cache for 177 builtin functions
Jul 12 19:46:36: LISTEN: #0 now listening on port 7777
Jul 12 19:46:36: > WARNING: Log-in via passkey is enabled for the following players
(specified in $passkey_players):
Jul 12 19:46:36: > WARNING: "Wizard" (#5)
Jul 12 19:46:36: > WARNING: "Programmer" (#6)
Jul 12 19:46:36: > WARNING: This is a severe security vulnerability. In a secure
environment you should:
Jul 12 19:46:36: > WARNING: disable passkey login:
Jul 12 19:46:36: > WARNING: ; $disable_passkey_login = 1
Jul 12 19:46:36: > WARNING: ; $passkey_players = {}
Jul 12 19:46:36: > WARNING: disable existing passkeys:
Jul 12 19:46:36: > WARNING: ; #5.passkey = 0
Jul 12 19:46:36: > WARNING: ; #6.passkey = 0
Jul 12 19:46:36: > WARNING: and for good measure:
Jul 12 19:46:36: > WARNING: ; set_player_flag(#5, 0)
Jul 12 19:46:36: > WARNING: ; set_player_flag(#6, 0)
Jul 12 19:46:36: > PASSKEY for "Wizard" (#5): 14FC3656E763CB43C5E16F4CE9A9B77EE742629677A29048C44423C640A59442 (keep it secret)
Jul 12 19:46:36: > PASSKEY for "Programmer" (#6): 2B3BE77D36447234AE5AEBB920FC1E3F7B0FDAB8D4169A3FED23C57C0753C398 (keep it secret)
Jul 12 19:46:54: ACCEPT: #-2 on port 7777 from localhost, port 56831
Jul 12 19:47:11: CONNECTED: Wizard (#5) on port 7777 from localhost, port 56831
And connecting:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Welcome to Stunt! For information about Stunt, check out http://stunt.io/. To
connect to the server, type "connect ".
connect 14FC3656E763CB43C5E16F4CE9A9B77EE742629677A29048C44423C640A59442
*** Connected ***
In truth, there's one more file that needs modification: exec.c, which uses goto as it was meant to be used but g++ doesn't like it. But that's a small obstacle to overcome.

UPDATE! Todd sent me a patch for exec.c. I've applied, compiled, tested, committed and pushed it.

Syndicated 2012-07-13 03:49:00 (Updated 2012-07-14 03:14:00) from Wainstead

9 Jul 2012 (updated 9 Jul 2012 at 18:09 UTC) »

The finish line nears!: Merging Waverous's C++ changes into Stunt

Yesterday I had several blissful hours to hack away, applying patches to the "waverous" branch in my fork of Stunt.

I had to deal with a few more places in the Stunt code that differed from the Waverous code; namely, Stunt was forked from a later commit of LambdaMOO than Waverous was. (I started with the code base on Sourceforge, whereas Todd started with the code base on Github). There are several places that use a new macro, TRY_STREAM, which in turn uses the original TRY macro. I fixed the compiler error occurring after macro expansion (which didn't turn out to be all that hard, fortunately).

By midnight last night I had the project successfully compiling, which was quite exciting. But the linking phase was failing; I found I was missing a handful of source files in Makefile.in, like json.[hc], collection.[hc] and a few others.

I think the Makefile.in is now up to date and I just have to update the files for File I/O to make g++ happy. After that, there's about 100-150 patches to look at but the vast majority of them are specific to my goals with Waverous, like including the LambdaMOO and JHCore databases, removing scripts used during porting, adding documentation, helper tools like Neil Fraser's Moo Database Browser, etc.

I think there are a handful of patches to apply still that deal mostly with updates to the Autotools but I consider those to come after the milestone of a running "Stunt++" server. Todd announced my work on the MOO Talk mailing list this morning.

Syndicated 2012-07-09 15:26:00 (Updated 2012-07-09 17:36:08) from Wainstead

1 Jul 2012 (updated 9 Jul 2012 at 17:10 UTC) »

Backporting: Patching Waverous from Stunt

Today I wrapped up a bit of work needed in db_file.c where the TRY/EXCEPT/ENDTRY macros were replaced with their respective code. Somehow one block went missing during the patching process, and I compared files by eyeball between Stunt and Waverous to figure out where things went wrong.

I then applied a change from Stunt to Waverous, the first such change: Todd found the files ref_count.h and ref_count.c were never used since their innards were never seen by the compiler, being hidden by #IF 0 ... #ENDIF blocks.

I cleaned up Waverous's Makefile.in dependency list the usual hard way, which means getting the project to compile and running make depend. I have to revisit how this is done some day because there has to be a better way. Maybe this approach will work. (Edit: actually, with a little bit of thought it isn't necessary to get the project to compile... one just has to run the bison command plus a couple others to generate y.tab.h and parser.c, and then make depend will work fine).

I finally found what I was looking for in git: git-format-patch. Running this in the Waverous project for every commit from where I am now in the commit history to HEAD, I get 223 files. This sounds worse than it actually is:


bash-3.2$ git format-patch 763e7648518c54cf011f4df6011cc796b6838175^..HEAD
0001-Another-questionable-change-that-could-cause-headach.patch
0002-largely-cast-fixes-and-replacing-new-with-_new.patch
0003-Another-one-to-watch-out-for-as-I-did-this.patch
0004-More-cast-fixes-should-have-all-instances-of-try-as-.patch
0005-A-tricky-one.-The-passed-in-data-struct-pointer-was-.patch
0006-Minor-cast-fix.-But-casting-TYPE_STR-is-getting-to-b.patch
0007-Changed-void-to-int-to-satisfy-longjmp-note-that-cb-.patch
0008-The-biggest-issue-in-this-commit-was-the-copying-of-.patch
0009-For-now-committing-this-even-though-the-compiler-iss.patch
0010-Oops.-Accidentally-converted-this_arm-to-self_arm-wh.patch
0011-Fixing-a-few-more-enum-comparisons-the-compiler-didn.patch
0012-Casts-all-around-to-satisfy-the-compiler.patch
0013-There-were-a-few-cases-of-__new-and-new-which-should.patch
0014-one-cast-to-fix-this-file-for-our-old-void-pointer-f.patch
0015-Moved-an-enum-out-of-a-struct-so-it-would-be-in-scop.patch
0016-one-_new-and-a-number-of-casts-made.patch
0017-scratch-file-to-be-deleted-later-list-of-occurances-.patch
0018-ignoring-the-TAGS-file.patch
0019-Added-comment-pointing-to-the-CPP-manual-explaining-.patch
0020-after-macro-expansion-g-complained-that.patch
0021-Fixed-calls-to-getsockname-with-casts.patch
0022-Borrowed-the-definition-of-the-struct-exception-from.patch
0023-various-casts-to-make-the-compiler-happy.patch
0024-More-cast-fixes.patch
0025-Casts-but-these-are-rather-suspicious-to-me.patch
0026-assorted-casts-none-too-scary-looking.patch
0027-Fixing-up-the-function-signatures-so-it-passes-g-.-T.patch
0028-Made-a-goof-changing-the-function-signature-omitting.patch
0029-Fixed-several-function-signatures-which-were-using-p.patch
0030-Some-casts-and-an-accidental-change-of-this_program-.patch
0031-More-casts-one-set-of-macros-expanded-to-fix-casting.patch
0032-fixed-a-missed-catch-keyword-changed-to-_catch-and-a.patch
0033-Casts-and-two-places-there-s-an-in-an-if-statement-w.patch
0034-Fix-cast-to-var_type.patch
0035-Added-workaround-for-casting-a-bitmask-operation.patch
0036-Another-casting-fix-to-get-rid-of-the-compiler-s-com.patch
0037-I-commented-out-the-definition-of-var_type-an-enum-i.patch
0038-cleaning-up-scripts-used-to-massage-the-code-base.patch
0039-cleaning-up-scripts-used-to-massage-the-code-base.patch
0040-cleaning-up-scripts-used-to-massage-the-code-base.patch
0041-cleaning-up-scripts-used-to-massage-the-code-base.patch
0042-Previously-in-execute.c-I-copied-an-enum-out-of-a-st.patch
0043-adding-FUP-to-the-project-not-yet-compiled-in-just-a.patch
0044-temporarily-stashing-this-in-svn-so-I-don-t-lose-it.patch
0045-commiting-Avalon-patch-files-for-now-will-delete-lat.patch
0046-adding-LambdaCore-database.patch
0047-Adding-FUP-files-per-install-instructions.patch
0048-Tweaks-to-compile-on-RedHat-based-linux-system.patch
0049-Tweak-to-let-crypt-be-found-on-linux-use-the-header-.patch
0050-Tweak-to-let-lrand48-be-found-on-linux-use-the-heade.patch
0051-applied-first-avalon-patch-tORIGINAL-d20040322.patch.patch
0052-applied-d20040322-d20040323.patch.patch
0053-applied-d20040323-d20040415.patch.patch
0054-applied-d20040415-d20040416.patch.patch
0055-applied-d20040416-d20041022.patch.patch
0056-applied-d20041022-d20050324.patch.patch
0057-applied-d20050327-d20051106.patch.patch
0058-applied-d20051106-d20051107.patch.patch
0059-Resolved-the-issues-with-expat-and-ident-and-the-cas.patch
0060-removing-ident-stuff-specifically-commented-it-out-o.patch
0061-This-largish-commit-is-mostly-the-work-of-Merlin-and.patch
0062-cleaning-up.patch
0063-oops-missed-one-new-file-to-commit.patch
0064-handle-nil-value-gracefully.patch
0065-Adding-a-tools-directory-and-two-of-Neil-Fraser-s-mo.patch
0066-Rudimentary-script-to-test-the-server.patch
0067-Minor-formatting-change.patch
0068-minor-formatting-change.patch
0069-adding-braces-so-Wall-does-not-complain-about-no-exp.patch
0070-Changed-the-formatter-in-printf-to-ld-to-satisfy-gcc.patch
0071-Linux-on-the-other-hand-does-not-like-ld-at-all-so-s.patch
0072-I-changed-the-printf-s-to-cout-s-to-try-to-make-the-.patch
0073-It-seems-for-Fedora-14-strchr-does-not-want-a-const-.patch
0074-removing-ending-comma-which-pedantic-errors-complain.patch
0075-Cleaning-up-warnings-generated-when-compiled-with-pe.patch
0076-Cleaning-up-warnings-generated-when-compiled-with-pe.patch
0077-though-I-don-t-see-what-the-deal-is-the-compiler-war.patch
0078-removing-unused-variable-timeout-from-proto_accept_c.patch
0079-Added-a-ifndef-for-INT32_MAX-which-is-predefined-by-.patch
0080-annotating-a-function-even-if-briefly.patch
0081-Adding-Neil-Fraser-s-Python-tool-to-convert-a-Moo-da.patch
0082-Minor-cleanup-creating-a-directory-to-store-database.patch
0083-Adding-a-set-of-moo-objects-I-ve-written-over-the-ye.patch
0084-added-a-note-about-missing-features-causing-objects-.patch
0085-directory-to-store-random-artifacts-like-patch-files.patch
0086-I-found-this-via-some-link-for-the-enCore-database-f.patch
0087-I-forget-where-I-picked-up-this-patch-but-it-shows-o.patch
0088-adding-JHCore-database-and-its-copyright-notice.patch
0089-gzipping-the-db-files-for-massive-space-savings.patch
0090-adding-config.log-and-config.cache-to-distclean.patch
0091-commenting-the-rule-pure_moo-purify-is-a-memory-acce.patch
0092-main-must-return-int-claims-g.patch
0093-noting-that-Pavel-used-a-custom-build-of-gperf-to-ge.patch
0094-fixing-the-subpath-to-Minimal.db.patch
0095-removed-the-t-flag-to-etags-which-it-doesn-t-have.-t.patch
0096-This-copy-of-configure.in-comes-from-wp-lambdamoo-of.patch
0097-ed-not-found-on-my-system-changing-it-to-ex.patch
0098-added-configure_input.patch
0099-Updated-versions-of-configure.in-and-the-generated-c.patch
0100-changing-AC_CONFIG_HEADER-to-AC_CONFIG_HEADERS-per-t.patch
0101-quoting-the-argument-to-AC_CONFIG_HEADERS.patch
0102-I-m-removing-the-hardcoded-definition-of-the-compile.patch
0103-Turns-out-I-just-needed-to-change-AC_PROG_CC-to-AC_P.patch
0104-New-generated-configure-file.patch
0105-default-to-m32-for-compiles-since-the-server-is-not-.patch
0106-I-added-the-following.patch
0107-Removing-the-distribution-making-rule-and-its-variab.patch
0108-Basic-top-level-Makefile-the-main-use-being-to-build.patch
0109-getting-rid-of-this-cvs-cruft.patch
0110-Creating-a-chrooted-environment-to-run-waverous-in.patch
0111-Removing-trailing-comma-to-make-pedantic-happy.patch
0112-Ran-GNU-indent-on-all-.h-and-.c-files-to-standardize.patch
0113-Cleanup-removing-all-the-old-rcs-string-constants-an.patch
0114-Currently-this-generates-HTML-only-i.e.-no-Latex-or-.patch
0115-removed-old-CVS-log-entries.patch
0116-removed-outdated-bits-updated-others.patch
0117-Renamed-task_queue-to-TaskQueue-as-a-start-to-making.patch
0118-Removing-more-hopefull-all-of-the-CVS-log-entries-an.patch
0119-Reformatted-struct-names-that-are-internal-to-this-m.patch
0120-In-options.h-it-was-noted-that-using-a-copy-of-GNU-s.patch
0121-removed-CVS-log-entries.patch
0122-commenting-what-a-static-inline-function-is-in-C-ter.patch
0123-Experimental-patch-that-converts-the-Task-struct-to-.patch
0124-1-CPPFLAGS-was-used-but-never-defined-I-ve-added-the.patch
0125-Adding-install-sh-per-the-GNU-Coding-Standards-the-m.patch
0126-stripped-out-old-CVS-log-entries.patch
0127-1-I-don-t-think-anyone-needs-to-mail-Pavil-anymore-r.patch
0128-newest-generated-configure-script.patch
0129-Check-for-expat.h-and-don-t-check-for-the-expat-libr.patch
0130-I-ve-removed-the-DEXPAT_XML-flag-from-the-compiler-f.patch
0131-added-the-standard-DEFS-DEFS-variable-and-DEFS-to-th.patch
0132-I-ve-added-conditionals-to-configure.in-to-test-if.patch
0133-typo-fix-missing-space.patch
0134-I-ve-removed-the-patches-for-configure-aclocal.m4-an.patch
0135-Now-the-user-can-specify-enable-expat-yes-no-to-.-co.patch
0136-Added-ifdef-endif-around-the-code-to-handle-conditio.patch
0137-Added-ifdef-endif-around-the-externs-and-function-ca.patch
0138-Added-USE_EXT_FUP-and-HAVE_EXPAT_H-for-conditional-c.patch
0139-Broke-out-ext-xml.c-from-the-main-group-of-source-fi.patch
0140-Let-the-user-choose-whether-to-include-expat-or-FUP-.patch
0141-Preparing-for-beta2-soonish.patch
0142-Updating-the-name-from-configure.in-to-configure.ac-.patch
0143-updating-the-rule-for-configure.in-to-confiture.ac.patch
0144-Experimental-you-can-now-say-.-configure-enable-open.patch
0145-The-macro-AC_TEST_PROGRAM-was-deprecated-and-replace.patch
0146-yet-another-newest-version-of-configure.patch
0147-Rolling-back-my-changes-for-now-not-sure-why-all-the.patch
0148-I-was-running-into-the-problem-of-in-gdb-linux-I-cou.patch
0149-Documented-the-depend-target-which-requires-files-ge.patch
0150-I-ve-changed-the-configure-options-from-enable-woobl.patch
0151-README-file-added-to-explain-this-directory-and-the-.patch
0152-removing-extraneous-lines-from-chroot.sh.patch
0153-Renaming-this-to-waverous-tester.exp-and-giving-it-t.patch
0154-Renamed-this-file-to-waverous-tester.exp.patch
0155-Adding-the-files-for-fileio.patch
0156-Adding-a-LICENSE-file-to-clarify-all-the-licenses-fo.patch
0157-Inserting-the-license-for-this-file-that-exists-in-a.patch
0158-Adding-the-license-on-behalf-of-Andy.patch
0159-Adding-the-licensing-that-goes-with-this-file.patch
0160-Commenting-on-the-licensing-of-this-file.patch
0161-Expounding-some-more-on-the-licensing-of-the-sources.patch
0162-Renaming-restart.sh-to-mooctl-in-line-with-scripts-i.patch
0163-Updating-the-instructions-by-s-restart-mooctl-g.-Not.patch
0164-Use-0-instead-of-the-script-name-use-gzip-instead-of.patch
0165-testbed-for-playing-with-the-features-of-getopt_long.patch
0166-Got-rid-of-optreset-which-GNU-didn-t-like-and-I-wasn.patch
0167-Explanatory-comments-for-the-case-of-zero.patch
0168-Moved-the-option-to-log-user-commands-in-the-event-o.patch
0169-Adding-the-MCP-2.1-implementation-updating-the-READM.patch
0170-Moved-UNFORKED_CHECKPOINTS-into-.-configure-and-frie.patch
0171-Minor-formatting-update.patch
0172-Redid-the-no-forking-configure-option-is-now-with-fo.patch
0173-Including-licensing-info-for-the-external-package-Fi.patch
0174-Notes-on-what-to-add-in-this-prototype-of-command-li.patch
0175-Largish-commit-to-add-finally-the-package-File-I-O-a.patch
0176-Two-file-wide-changes-and-one-small-one.patch
0177-Small-object-to-test-File-I-O.patch
0178-Added-a-small-example-for-file_open.patch
0179-Fixed-the-dumb-mistakes-I-made-in-my-first-attempt-t.patch
0180-Bumped-up-the-version-number-of-Waverous-tweaked-the.patch
0181-Updated-configure-file.patch
0182-Note-added-about-make-install-in-the-future.patch
0183-Changed-the-default-text-editor-mode-from-c-to-autoc.patch
0184-Dropped-pgperf-the-customized-verion-of-GNU-gperf-th.patch
0185-Removed-pgperf-from-the-LICENSE-file-as-it-s-no-long.patch
0186-Check-for-GNU-gperf-issue-a-warning-if-not-found.-gp.patch
0187-Latest-.-configure-script.patch
0188-Dropping-LambdaMOO-specific-redeclaration-of-AC_FUNC.patch
0189-Removed-checks-for-AUX-ALPHA-NeXT-SGI-HPUX.patch
0190-Moved-the-custom-MOO-m4-macros-into-their-own-file-i.patch
0191-Missing-quote-in-a-comment-fixed.patch
0192-Dropping-the-test-to-see-if-malloc-is-defined-in-std.patch
0193-Further-removing-MOO_MALLOC_H-from-configure.patch
0194-By-specifying-C-as-the-project-language-via-the-auto.patch
0195-At-some-point-in-the-past-I-modified-the-JHCore-db-b.patch
0196-Removing-the-test-for-bzero.-In-some-older-systems-i.patch
0197-Latest-configure.patch
0198-Dropping-the-test-for-the-compiler-s-support-for-the.patch
0199-Latest-configure-file.patch
0200-Next-version-number-will-be-0.2-instead-of-beta2.patch
0201-Removing-errant-use-of-AC_PREREQ-which-autoconf-2.61.patch
0202-I-dunno-if-I-have-the-wrong-version-of-aclocal-or-wh.patch
0203-Latest-.-configure-file-created-by-autoconf.patch
0204-Somehow-I-missed-the-call-to-MOO_CONST-and-autoconf-.patch
0205-Updated-.-configure-script-with-no-more-MOO_CONST.patch
0206-Make-OUTBOUND_NETWORK-a-configure-option.patch
0207-First-cut-at-crediting-the-authors-for-the-conversio.patch
0208-Updated-the-authors-list.patch
0209-Updated-authors-list-again.patch
0210-Adding-the-other-two-canonical-programmer-user-refer.patch
0211-Xythian-s-.gitignore-from-lambdamoo-on-github.patch
0212-Example-make-distcheck-per-the-Autotools-book.patch
0213-Removed-CVS-log-entries.patch
0214-New-version-of-autoconf-thus-new-version-of-.-config.patch
0215-Temporary-log-file-I-m-working-off-of-while-patching.patch
0216-I-m-marking-blocks-with-leading-semicolons-to-note-w.patch
0217-Fix-void-pointer-problems-when-BYTECODE_REDUCE_REF-i.patch
0218-Commented-out-SHAs-I-ve-applied-as-patches-to-Stunt-.patch
0219-Marked-another-commit-as-patched-to-Stunt.patch
0220-Porting-a-change-over-from-Stunt-ref_count.-hc-are-n.patch
0221-Removed-references-to-ref_count.h.patch
0222-Added-some-needed-macros-like-delref-copied-from-Stu.patch
0223-Removed-all-references-to-ref_count.h-and-ref_count..patch
Many of these are not germane to porting Stunt to C++. Some have funny names, and it's a lesson on why one should start every commit with what looks like a Subject: line, something I hadn't adopted while working in Subversion.

Syndicated 2012-07-01 22:35:00 (Updated 2012-07-09 16:37:33) from Wainstead

Porting code_gen.c and db_fileio.c

(This entry was written offline during a flight from Las Vegas to Milwaukee today, June 21st 2012. I'm continuing the task of merging Waverous into Stunt, or put another way, getting Stunt to be C++ compliant).

Here's something you hope to never see:


-*- mode: compilation; default-directory: "/Users/swain/Sites/projects/moowork/waverous/server/" -*-
Compilation started at Thu Jun 21 07:10:01

make
[ config.h : config.status ]
./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
g++ -m32 -O -DHAVE_CONFIG_H -c -o code_gen.o code_gen.c
code_gen.c: In function 'Bytecodes stmt_to_code(Stmt*, GState*)':
code_gen.c:1220: error: invalid conversion from 'int (*)(int*, int*)' to 'int (*)(const void*, const void*)'
code_gen.c:1220: error: initializing argument 4 of 'void qsort(void*, size_t, size_t, int (*)(const void*, const void*))'
make: *** [code_gen.o] Error 1

Compilation exited abnormally with code 2 at Thu Jun 21 07:10:01
The issue here is the standard qsort() function wants a pointer to a function whose signature has two const void pointers, but LambdaMOO's implementation has two int pointers:

void
qsort(void *base, size_t nel, size_t width,
int (*compar)(const void *, const void *));
I never caught this when I ported Waverous to C++ because I never defined BYTECODE_REDUCE_REF. This suggests to me a way of testing the server by compiling it with every possible combination of flags... this would be one hell of a build-and-smoke test. For every combination of compile-time options: compile the server, start it up, log in and do some basic tasks, shut down. I would have caught this long ago if I'd thought of writing such a test.

After some dedicated surfing via my phone at Milwaukee's airport, which does not have free wi-fi (pththth) I found the solution on www.cplusplus.com:


#ifdef BYTECODE_REDUCE_REF
// See http://www.cplusplus.com/reference/clibrary/cstdlib/qsort/ for
// this usage of standard C's qsort() function
static int
bbd_cmp(const void *a, const void *b)
{
return ( *(int *)a - *(int *)b );
}
#endif /* BYTECODE_REDUCE_REF */
It's curious and non-obvious to me that the args within the function are cast and that this satisfies the compiler. On a side note I think being able to google our compiler errors and find solutions is an exception to Fred Brooks's "No Silver Bullet" argument. It feels like an order of magnitude increase in productivity to get help so easily.

I'm now past one of the stickier parts of porting: past the TRY/EXECEPT/ENDTRY preprocessor macros in code_gen.c. I had to edit the file by hand and incorporate the needed expansion of the macros because the block of code in question had added blank lines spacing out the code. I would think patch would have a command line flag to account for this situation, but patch can only handle changes in leading and trailing whitespace.

Syndicated 2012-06-22 02:29:00 (Updated 2012-06-22 02:52:35) from Wainstead

Waverous-to-Stunt patching procedes

I'm making progress patching my fork of Stunt LambdaMOO by generating patches from the git log of Waverous LambdaMOO. There have been the occasional rejections by patch that have puzzled me a bit; I wonder if it's a white space problem? I doubt it. I didn't look terribly close because doing the edits by hand only took a minute. I'm now up against the dreaded TRY/EXCEPT/ENDTRY set of C preprocessor macros. By my commit log in Waverous:


commit c7b9cf521033fa816fbe650c8d00c720e453cfdf
Author: Steve Wainstead
Date: Sun Jun 7 19:28:43 2009 +0000

Replaced the TRY, CATCH and ENDTRY macros with their respective
code bodies to solve a void pointer problem.

server/db_file.c | 150 ++++++++++++++++++++++++++++++++++++------------------
1 file changed, 101 insertions(+), 49 deletions(-)
Geez, that was three years ago? I was hacking away in my little second-bedroom-turned-office in Jackson Heights, Queens; and these days I'm in a high rise in downtown Las Vegas.

Anyway this patch was completely rejected. It's late and my brain is too short on glucose to get the job done. Time to push to master and try to catch up on MOO-talk again. I can't keep up with it lately!

Syndicated 2012-06-20 06:10:00 (Updated 2012-06-20 06:11:44) from Wainstead

15 Jun 2012 (updated 9 Jul 2012 at 18:09 UTC) »

Hacking Waverous changes into Stunt

A few months ago Todd Sundsted, the owner/developer of the Stunt LambdaMOO server code, emailed me inquiring about the effort it took to get LambdaMOO to compile as C++. I ventured it would be interesting to try to apply my changes in Waverous LambdaMOO to a branch of Stunt LambdaMOO. A month or so ago I did fork Stunt on Github and made a local clone. I then looked at the git log of Waverous and chose my first commit that converted some of the files from C to C++. Applying that as a patch to Stunt was about, I'd say, 65% successful: some of the hunks applied, some failed and gave me .rej files.


patching file ast.c
Hunk #9 succeeded at 209 (offset 11 lines).
Hunk #10 succeeded at 220 (offset 11 lines).
Hunk #11 succeeded at 344 (offset 29 lines).
Hunk #12 succeeded at 413 (offset 29 lines).
patching file ast.h
Hunk #1 succeeded at 83 (offset 7 lines).
Hunk #2 succeeded at 112 with fuzz 2 (offset 9 lines).
Hunk #3 succeeded at 190 (offset 11 lines).
patching file db.h
Hunk #1 succeeded at 298 (offset 62 lines).
patching file exceptions.h
Hunk #6 FAILED at 159.
Hunk #7 succeeded at 182 (offset 3 lines).
1 out of 7 hunks FAILED -- saving rejects to file exceptions.h.rej
patching file execute.h
Hunk #1 FAILED at 46.
Hunk #2 FAILED at 94.
2 out of 2 hunks FAILED -- saving rejects to file execute.h.rej
I didn't have oodles of time so I let it slide for a few weeks... my time was being taken up by a Udacity course, running LVDev, campaigning for a political candidate, working on a GreenerBlocks.org project and more! But the itch is there and wants scratching. Tonight I packed my laptop and went over to the Vegas Jelly in /usr/lib above The Beat Coffeehouse. It meets every Thursday night. The Linux, Bitcoin and All Things Open Source group was meeting in the conference room (Hi, Julian!) and I took a seat in the back of the room. I worked while a debate raged about the prospects of Bitcoin but I barely took notice. What I first found was gcc, make and friends were not present on my system anymore. I upgraded my laptop to OS X Lion recently when I participated in an iOS Boot Camp. But I installed XCode; wtf? Googling told me I needed to install the command line tools via Preferences -> Downloads. Completely obvious in retrospect, heh. I renamed configure.in to configure.ac, copied my Waverous version of the file over it and ran autoconf. All good. I ran ./configure:

bash-3.2$ ./configure
checking for bison... bison -y
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.."
Another wtf moment. I googled around but didn't really find anything specific enough for my situation; maybe upgrading the autotools? I did port update on autoconf and automake; but still the same error. Finally I just copied install-sh from the automake directory; this is scratch hacking after all, and with version control you never have to say you're sorry. (EDIT: Duh, I forgot to run automake --install-missing, was all).

bash-3.2$ ./configure
checking for bison... bison -y
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether gcc needs -traditional... no
checking how to run the C preprocessor... gcc -g -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for library containing strerror... none required
checking for strftime... yes
checking for gcc -g option to accept ISO C99... unsupported
checking for gcc -g option to accept ISO C89... (cached) none needed
checking for gcc -g option to accept ISO Standard C... (cached) none needed
checking sys/bsdtypes.h usability... no
checking sys/bsdtypes.h presence... no
checking for sys/bsdtypes.h... no
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for memory.h... (cached) yes
checking for pid_t... yes
checking for mode_t... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... yes
./configure: line 4810: syntax error near unexpected token `sqrt,'
./configure: line 4810: `MOO_HAVE_FUNC_LIBS(sqrt, -lm /lib/libm.a "-static -lm")'
OK, more wtf material... I called it an evening, had a nice discussion with a couple of the Linux guys about LambdaMOO and the problems of getting the masses to use new software, and headed home.

Back in my home office I googled the error a bit, editing out the particulars of the error message to make the search query more generic; somewhere I found one forum post where the reply was "Your aclocal got borked." Ah! Did I not move some of the MOO m4 macros to another file to reduce the size/complexity of configure.ac?

Indeed I did, and I left a helpful log entry in git to that effect.

So I copied acinclude.m4 over from the Waverous project, ran aclocal, ran autoconf and finally ./configure and everything went well. I now have a Makefile that will correctly call g++ for the project. Time to commit my work, push it to github and sleep on it a bit.

What comes next, should I undertake it, is a lot of bare knuckle hacking to resolve conflicts between Waverous's code base and Stunt's. Todd has made a lot of edits to the C sources, I'm sure, and I started from the most recent version of LambdaMOO on Sourceforge. It means I'll have to come to understand a lot of the changes Todd made, and that will be challenging.

Syndicated 2012-06-15 06:21:00 (Updated 2012-07-09 18:03:16) from Wainstead

Package manager/code sharing for MOO code

Todd Sundsted has been doing some amazing work with his fork of LambdaMOO, Stunt. While I was trying to catch up on the MOO-Talk discussion list (which has been very busy as of late!) he announced Composed, a package manager he wrote and has been using for two years. Check it out! He even has a call to action for people to package their MOO code for release. Imagine one ANSI package to rule them all.

Syndicated 2012-05-06 19:45:00 (Updated 2012-05-06 19:45:33) from Wainstead

"Object frameworks and object browsers are not a substitute for good design or documentation, but they often get treated as one. Too many layers destroy transparency: It becomes too difficult to see down through them and mentally model what the code is actually doing."

-- Eric Raymond, "The Art of Unix Programming."
25 Mar 2012 (updated 25 Mar 2012 at 08:11 UTC) »

Let not a month go by without some work on thine open source project...

I closed a ticket today, a very minor one: the programmer's manual, which is a Texinfo document wasn't building on my Fedora 14 system on an Intel Mac Mini.Some months ago I decided to upgrade the Mini to Fedora 16 and that was the end of the Mini. Long story short: Fedora switched to the GRUB2 boot loader and after the distro is installed on the Mini it won't reboot. GRUB2 couldn't find the kernel, even when I explicitly passed the path on boot.The Mini has a flaky CDROM drive so installing anything means trying over and over until the installation process survives with no bad reads from the DVD disc. I should just pry the Mini open at this point and install a new optical drive.Tonight while doing another task (several, really) I kept trying to reinstall FC on the Mini, and the sixth or seventh try went without a hitch. Finally. I started "yum groupinstall"ing things to get the system fleshed out with the tools I need. It's almost there now.So I git cloned Waverous off Google Code and got the manual to build. Finally! It's not much but at least that's one ticket closed and the project inches forward. I still wanna try branching and doing a radical rewrite of the structs into classes just for kicks.

Syndicated 2012-03-25 07:10:00 (Updated 2012-03-25 07:14:58) from Wainstead

Long delay in doing anything

I'm posting to say I haven't gone away, nor plans for Waverous... I am still planning on releasing File I/O in a newly patched form for the MOO community.I'm also keen on doing some serious experimentation with Waverous by doing wholesale changes from C to C++, just to see what happens.I've been super busy here in Las Vegas running the Python Programmers Meetup and attending many other meetups, especially the Las Vegas Jellies. The weekly Jelly happens right down the street from me and has exploded with activity.

Syndicated 2012-02-24 00:45:00 (Updated 2012-02-24 00:45:16) from Wainstead

88 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!