From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <6a6ede0513410d20e423e6e233df4039@yourdomain.dom> To: 9fans@cse.psu.edu Subject: Re: [9fans] Ruby port From: "Federico G. Benavento" Date: Sun, 2 Dec 2007 20:12:26 -0300 In-Reply-To: <6387B78A-AB82-4513-8827-E9B804344063@tinker.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 10a31984-ead3-11e9-9d60-3106f5b1d025 hola, > One feature I like about Ruby is the ability to add libraries > of code that contain C code. Ruby does this through dynamic > linking. Since Plan 9 doesn't support dynamic linking, (and I > am not suggesting that it be added to Plan 9), what is the > general consensus on how to achieve similar functionality without > resorting to dynamic linking? ron has a hacked 8c with support for dynamic loading, he did it for python. I recently did an APE port of python with the standard 8c. if I need/want a new module I just rebuild it, I have /$objtype/lib/ape/libpython.a and a special mkfile in a Extra/ where I just put .c files in a dir per module, the mkfiles are smart enough to build everything and add the init fn() calls to some initmodule() maybe it's a bit overkill, but who knows... lotte% ls -l /sys/src/cmd/python/Extra/ --rw-r--r-- M 241 fgb fgb 56 Nov 19 04:32 /sys/src/cmd/python/Extra/dummy.c d-rwxr-xr-x M 241 fgb fgb 0 Dec 2 20:06 /sys/src/cmd/python/Extra/mercurial --rw-r--r-- M 241 fgb fgb 253 Nov 19 09:36 /sys/src/cmd/python/Extra/mkfile lotte% ls -l /sys/src/cmd/python/Extra/mercurial/ --rw-r--r-- M 241 fgb fgb 3249 Nov 19 08:03 /sys/src/cmd/python/Extra/mercurial/base85.c --rw-r--r-- M 241 fgb fgb 7930 Nov 19 08:03 /sys/src/cmd/python/Extra/mercurial/bdiff.c Federico G. Benavento --- /bin/fortune: I taught him everything he knows. Now he knows more. -Randal L. Schwartz