
Ask HN: Transpiling a C lib to use in Electron app? - epx
Many years ago, I worked on a C library [0] that implements the IEEE 11073:20601 protocol stack. It was a mistake to implement in C, but it was a sponsor requirement back in 2010.<p>Now, some folks have an Electron app that needs to talk with a 20601-compatible device, and asked for help.<p>Apart from encapsulating the C code in a subprocess or in a Node.js module, I was wondering if it would be practical to transpile the lib into Javascript. That would spare the app from native code, platform-dependent build settings, crashes, etc.<p>[0] https:&#x2F;&#x2F;github.com&#x2F;signove&#x2F;antidote
======
jetti
You could always try using Emscripten [0] to generate Javascript from the
existing C library and see how that turns out. However, I feel like it could
introduce a lot of potential issues.

[0] [http://kripken.github.io/emscripten-
site/](http://kripken.github.io/emscripten-site/)

~~~
therealmarv
yep, would also try emscripten which transpiles c to js code. I think it maybe
nowadays you can also transpile with the same method from c to WebAssembly
which is "native" code essentially.

