From: Kim Hiongun
Subject: Q:How to mix Lisp with C?
Date: 
Message-ID: <2qqdin$nad@worak.kaist.ac.kr>
Hello Lisp'ers,

I wonder how can I handle a 50,000-entry dictionary using LISP.
When I programmed it in C, it was trivial because I can use the
'ndbm' or 'dbm' libraries that is packaged in a Unix OS.

The best solution is to "interface Lisp with C". If it is not
so easy, then I have to program all the dictionary file accessing
routines in Lisp only, but how to?

I'm developing a morphological analyzer, on either

	Sun Unix, Austin Kyoto Common Lisp (or Allegro Common Lisp).
or
	Mac OS, xlisp

Thanks in advance.
-hgkim
------------------------------------	-----------------------
beyond the language barrier to peace	Kim Hiongun
preter la lingva baro al paco		·····@hanul.kaist.ac.kr

From: Marcus Daniels
Subject: Re: Q:How to mix Lisp with C?
Date: 
Message-ID: <MARCUS.94May11052303@tdb.ee.pdx.edu>
>>>>> "Kim" == Kim Hiongun <·····@hanul.kaist.ac.kr> writes:
In article <··········@worak.kaist.ac.kr> ·····@hanul.kaist.ac.kr (Kim Hiongun) writes:

Kim> Hello Lisp'ers, I wonder how can I handle a 50,000-entry
Kim> dictionary using LISP.  When I programmed it in C, it was trivial
Kim> because I can use the 'ndbm' or 'dbm' libraries that is packaged
Kim> in a Unix OS.

Kim> I'm developing a morphological analyzer, on either

Kim> 	Sun Unix, Austin Kyoto Common Lisp (or Allegro Common Lisp).

CMU LISP, Allegro, and AKCL, at least, have an adequate FFI for using
the gdbm (or ndbm) directly.  A few simple wrappers for gdbm_fetch,
gdbm_store, gdbm_delete, gdbm_first/next, etc..  Just be careful not
to leave any LISP memory in C pointers (or mark it appropriately for
the particular FFI).

It's true that LISP has all the archiving and hash table features one
would need to implement such as simple database in text-files or
otherwise, but it can be handy, though, to use gdbm when there are
various non-lisp external programs generating, preprocessing or
reporting from the same database (say, in FORTRAN, C, and Perl).

Kim> or Mac OS, xlisp

Mac XLISP(stat) has (had) a simple FFI and supports simple dynamic loading.
Probably would be adequate for use with gdbm (I haven't tried it).
From: Marco Antoniotti
Subject: Re: Q:How to mix Lisp with C?
Date: 
Message-ID: <MARCOXA.94May11142816@graphics.cs.nyu.edu>
In article <····················@tdb.ee.pdx.edu> ······@ee.pdx.edu (Marcus Daniels) writes:


   From: ······@ee.pdx.edu (Marcus Daniels)
   Newsgroups: comp.lang.lisp
   Date: 11 May 1994 12:23:02 GMT
   Lines: 33
   Distribution: inet
   References: <··········@worak.kaist.ac.kr>


   >>>>> "Kim" == Kim Hiongun <·····@hanul.kaist.ac.kr> writes:
   In article <··········@worak.kaist.ac.kr> ·····@hanul.kaist.ac.kr (Kim Hiongun) writes:

   Kim> Hello Lisp'ers, I wonder how can I handle a 50,000-entry
   Kim> dictionary using LISP.  When I programmed it in C, it was trivial
   Kim> because I can use the 'ndbm' or 'dbm' libraries that is packaged
   Kim> in a Unix OS.

		...

What about implementing a CL interface from scratch capable of using
the [gn]*dbm files?

Any volunteers out there?

--
Marco Antoniotti - Resistente Umano
-------------------------------------------------------------------------------
Robotics Lab		| room: 1220 - tel. #: (212) 998 3370
Courant Institute NYU	| e-mail: ·······@cs.nyu.edu

...e` la semplicita` che e` difficile a farsi.
...it is simplicity that is difficult to make.
				Bertholdt Brecht