Addin / Plug-In

Is there a way to write Calc function plug ins with JavaScript?
Could I use the same addin API as in LibreOffice to integrate a V8 JavaScript engine?