1

I'm working on an opensource application that processes JSON in C, because I would like to make it easier for people to help me in the project and because JSON is so close to JS. I want to embed a JS engine and compile the JS into the software.

The reason I've chosen C for this particular program is because of C's speed. Is there any reason why I shouldn't include JS? I find it difficult to find any information regarding this particular topic.

1 Answers1

4

No reason why not... people embed Lua in C++ engines all the time, and sometimes JS engines. This enables them to run script-based code (eg for games, levels can be described in script).

However, it does raise a large level of additional complexity that may not be needed if all you want to do is parse JSON. For that get a JSON library for C instead (Spirit or libjson)

gbjbaanb
  • 48,749
  • 7
  • 106
  • 173