emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs dynamic modules and SWIG


From: Ken Raeburn
Subject: emacs dynamic modules and SWIG
Date: Wed, 16 Nov 2016 00:51:53 -0500

I was recently thinking about getting back to a couple of Emacs module projects 
I started toying with a while back (a module for sqlite3, though I think Sacha 
posted a link to someone else’s work on this; a module for dbm/gdbm), when it 
occurred to me that something along the lines of SWIG, which generates wrappers 
for C/C++ code to be callable from numerous other languages including Perl, 
Python, Javascript, Tcl, CLISP, Go, Guile, Java…, might be a big help.  It 
processes C/C++ source describing the functions or types to be wrapped, and 
generates code for the appropriate target language including module 
initialization, type checking, value conversions, registering commands with the 
interpreter, etc.  Well, “C++-ish” source… it accepts various sorts of 
annotations so you can describe special handling for certain types, whether 
pointer arguments are input or output, stuff like that.

Basically, it handles much of the template-based code generation for making 
wrapper functions, initialization routines, and the like.  If the C/C++ API 
isn’t very suitable for a scripting-type language, you can define a shim layer 
in C/C++ and have SWIG provide wrappers for that.

Has anyone looked at enhancing SWIG for Emacs module code generation?

It’d be a pretty big project, but streamlining module generation and providing 
templates to take care of much of the work for novice Emacs coders could be a 
huge help to future module writers.

Ken


reply via email to

[Prev in Thread] Current Thread [Next in Thread]