emacselisp

load a dynamic library from elisp


I need to use some native code and I would like to try elisp as a scripting language. Is it possible to call native functions which are implemented in dynamic library (dll in windows)? Or the only possibility to do it is to implement native code, wrap it with DEFUN (...) macros and recompile emacs?


Solution

  • You can not dynamically load a library with Emacs Lisp code. To work around this people usually call out to an external program (process) and control it by sending commands to it and reading its output.

    You can look at slime, tramp, gnuserv, movemail and some other similar hacks for examples.