Hacker News new | ask | show | jobs
by chubot 4474 days ago
This looks really cool. I always wanted a small embeddable JS engine with a C interface. And it looks like you modelled the C API after the Lua C API? That is what I wanted as well.

Here are some related projects I saved links to. I think there were a few others.

http://code.google.com/p/tiny-js/

http://adaptive-enterprises.com/~d/software/see/

http://sourceforge.net/projects/njs/

v8 is an obvious open source implementation, because it's packaged separately (and used in node.js), but its API is C++ and relatively complex. For a lot of applications, it's overkill.

1 comments

JavaScriptCore (the engine from WebKit) also has a very simple C interface (and I've seen it embedded by people as a static library without serious difficulty).
It's also got a really expressive and transparent Objective-C interface, if you happen to be writing iOS/OS X apps.

There's a nice overview here: http://blog.bignerdranch.com/3784-javascriptcore-and-ios-7/

It's LGPL though, which is too restrictive for some projects (especially as a static library).
FWIW, the only times I've seen it as a static library (and the only real place you need a static library) is on iOS (where it was actually extra-dubious and I'm surprised more people didn't point out the problems; specifically this was as part of one of those JavaScript app frameworks like Titanium, although I don't quite remember if it was specifically Titanium), and JavaScriptCore is now provided on the system by Apple as a public framework as of iOS 7. On any other platform you should have no trouble shipping it as a dynamically-linked library due to its simple C API.