In order to write a module in [[Emacs]] you must simply implement the emacs_module_init [[C]] function specified in the emacs-module.h C header file.
emacs_module_init
emacs-module.h