9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Federico G. Benavento" <benavento@gmail.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Ruby port
Date: Sun,  2 Dec 2007 20:12:26 -0300	[thread overview]
Message-ID: <6a6ede0513410d20e423e6e233df4039@yourdomain.dom> (raw)
In-Reply-To: <6387B78A-AB82-4513-8827-E9B804344063@tinker.com>

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


  reply	other threads:[~2007-12-02 23:12 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-11 20:44 Christopher Nielsen
2007-11-11 20:54 ` Pietro Gagliardi
2007-11-12  5:28 ` ron minnich
2007-11-12 14:19   ` David Leimbach
2007-11-12 15:40   ` [9fans] " prem
2007-11-12 19:01     ` ron minnich
2007-11-12 19:39       ` Steve Simon
2007-11-12 21:39         ` Aki Nyrhinen
2007-11-12 22:39           ` Pietro Gagliardi
2007-11-12 23:21             ` Steve Simon
2007-11-12 23:32             ` William Josephson
2007-11-12 23:55               ` Charles Forsyth
2007-11-12 23:52                 ` Pietro Gagliardi
2007-11-13  0:00                 ` William K. Josephson
2007-11-13  0:53                 ` Joel C. Salomon
2007-11-13  0:57                   ` Pietro Gagliardi
2007-11-13  1:32                     ` [9fans] Re: Ruby port ( off topic ) fernanbolando
2007-11-14 21:50                 ` [9fans] Re: Ruby port y i y u s
2007-11-13  0:27             ` Aki Nyrhinen
2007-11-13  0:33             ` David Leimbach
2007-11-13  0:35             ` Aki Nyrhinen
2007-11-13  0:50             ` [9fans] Fortran Lyndon Nerenberg
2007-11-13  0:52               ` erik quanstrom
2007-11-13  1:08                 ` Lyndon Nerenberg
2007-11-13  1:08                 ` Pietro Gagliardi
2007-11-13  1:48                   ` erik quanstrom
2007-11-13  1:12                 ` [9fans] Money, guns, and lawyers Lyndon Nerenberg
2007-11-13  1:41                   ` erik quanstrom
2007-11-13  1:59                     ` Lyndon Nerenberg
2007-11-13  2:02                       ` erik quanstrom
2007-11-14 16:55                 ` [9fans] Fortran plan9
2007-11-14 17:05                   ` erik quanstrom
2007-11-14 19:45                   ` Pietro Gagliardi
2007-11-14 20:04                     ` Uriel
2007-11-14 20:09                       ` William K. Josephson
2007-11-13  0:59         ` [9fans] Re: Ruby port Lyndon Nerenberg
2007-11-13  1:23           ` Hagen Paul Pfeifer
2007-11-13  1:25           ` Pietro Gagliardi
2007-11-14 19:05         ` ron minnich
2007-11-14 19:14           ` Latchesar Ionkov
2007-11-14 19:19             ` ron minnich
2007-11-14 19:25               ` erik quanstrom
2007-11-14 19:53                 ` Charles Forsyth
2007-11-14 20:43                   ` Robert William Fuller
2007-11-14 21:15                     ` Charles Forsyth
2007-11-14 21:22                 ` ron minnich
2007-11-14 23:04                   ` erik quanstrom
2007-11-15 23:12                   ` Pietro Gagliardi
2007-11-14 19:36               ` Bakul Shah
2007-11-14 19:45                 ` Latchesar Ionkov
2007-11-14 20:16                   ` Bakul Shah
2007-11-14 21:00                     ` Latchesar Ionkov
2007-11-14 21:12                     ` Pietro Gagliardi
2007-11-14 23:12                     ` erik quanstrom
2007-11-14 19:37               ` Federico G. Benavento
2007-11-18  3:32                 ` Pietro Gagliardi
2007-11-18 23:28                   ` Federico G. Benavento
2007-12-02 22:55 ` [9fans] " Kim Shrier
2007-12-02 23:12   ` Federico G. Benavento [this message]
2007-12-03  5:11     ` Charles Forsyth
2007-12-03  5:13       ` lucio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a6ede0513410d20e423e6e233df4039@yourdomain.dom \
    --to=benavento@gmail.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).