all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Can elisp call C functions without recompilation of emacs?
@ 2010-06-28  5:34 Fren Zeee
  0 siblings, 0 replies; only message in thread
From: Fren Zeee @ 2010-06-28  5:34 UTC (permalink / raw)
  To: help-gnu-emacs

In 1996, Stephen Eglin asked the following question which was never
answered but is of interest to people in C , Lisp and users of Emacs :

http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/a89c2d3ddd89768d/a2368ff6f5ea1b7b?q=%22Writing+Emacs+Primitives%22

Newsgroups: comp.emacs, gnu.emacs.help
From: steph...@cogs.susx.ac.uk (Stephen Eglen)
Date: 1996/04/10
Subject: Can elisp call C functions without recompilation of emacs?
Reply to author | Forward | Print | Individual message | Show original
| Report this message | Find messages by this author
Can elisp call functions written in C without recompilation of emacs?

I think what I am asking is not possible, but here goes anyway...

Here at Sussex we have an environment called POP-11, which is a lisp
style interactive AI programming environment.  One of its main
features is that you can call C functions from POP-11 after the shared
object files containing the C functions have been loaded into POP-11.
This can be done interactively, and does not require either POP-11 to
be recompiled or for the C functions to be compiled with any special
options.  So for example, if I write a function called add(x,y) in C,
and then compile it into a shared object, I can then call this C
function from POP-11 once I have loaded in the object file storing the
add function.  Of course,one of the restrictions made on the POP:C
interface is that I think the arguments to a c function must be ints,
floats, doubles and chars, rather than abstract c data types.

This is a very useful facility, especially when debugging c functions,
since you can write the test functions in POP-11, which is an
interactive language, and so only the C functions need compiling, and
not the test functions.   (I'm not sure exactly how the mechanism
works
in POP-11, but I think it uses some form of incremental compiler?)

My question therefore is does emacs offer this facility of calling c
functions from elisp?  I notice in the elisp info files (Writing Emacs
Primitives) that of course some emacs primitives are written in c, but
am I right in thinking that once the c function has been written, the
whole of emacs needs recompiling?  If this is the case, then I guess
the compile time of emacs would be a big overhead, and probably not
worth it.  Also, it looks like the c functions have to be written
especially with elisp in mind (eg use of the DEFUN macros.)

I only have access to emacs 19.27 at the moment, but if it works for
other versions, I would be interested in hearing about them.

Thanks in advance, Stephen Eglen.
--
Stephen Eglen, DPhil Student,
steph...@cogs.susx.ac.uk
School of Cognitive and Computing Sciences,       Fax: +44-(0)1273
671320
University of Sussex,                           Phone: +44-
(0)1273-678524
Falmer,  BRIGHTON, BN1 9QH, UK http://www.cogs.susx.ac.uk/users/stephene/



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-28  5:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-28  5:34 Can elisp call C functions without recompilation of emacs? Fren Zeee

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.