Earlier quoted context omitted.
Qt already uses JS in the form of QtQuick with quite a bit of success. JS using a prototypal system means that it can emulate almost any other OOP trivially (while the reverse is much harder). I prefer embedding lisp, but I realize that most developers don't know that language family (which mostly defeats the point of an embedded scripting language). JS seems to be the closest widely-known languages have come to this…
Do you happen to know an embeddable Lisp that can easily bind to C++ objects (rather like AngelScript or luabind)? I too would mostly rather a Lisp, but doing all the plumbing sucks .
Duktape: an embeddable JavaScript engine
31–40 of 44 posts
Re: Duktape: an embeddable JavaScript engine
#32This 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 impleme…
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).
There's a nice overview here: http://blog.bignerdranch.com/3784-javascriptcore-and-ios-7/
Re: Duktape: an embeddable JavaScript engine
#33Bloody wonderful! I'm quite pleased to see a compact and reasonable C interface for a JS engine--v8 can go eat a bag of rocks.
Agreed. I really like the engineering behind V8, but the interface is such a pain to work with. I actually switched my game from C++ to the JVM so I could use Rhino.
Would you mind elaborating a bit what makes v8 tedious to work with?
Re: Duktape: an embeddable JavaScript engine
#34Is size the main selling point? 4 years ago or so, I integrated SpiderMonkey into a C++ program with relative ease; it has an easy to understand C API and no dependencies.
Re: Duktape: an embeddable JavaScript engine
#35Is size the main selling point? 4 years ago or so, I integrated SpiderMonkey into a C++ program with relative ease; it has an easy to understand C API and no dependencies.
I'd say the combination of being small, easily embeddable and having a liberal license make it attractive.
It's not tiny though (for an underbelly feeling, I found an old binary Windows build online of about 800kb).
Looking at the current SpiderMonkey docs, things look like they've only improved. Back in the day, I just took SpiderMonkey from the "js" subdirectory of the Firefox repo. They split it off and documented build steps since then.
I'm not saying there's no space for contenders here, but don't underestimate the quality of what's out there already. SpiderMonkey really is remarkably easy to interface with.
Re: Duktape: an embeddable JavaScript engine
#36Earlier quoted context omitted.
I'd say the combination of being small, easily embeddable and having a liberal license make it attractive.
SpiderMonkey is easily embeddable like I said. The Mozilla Public License is less liberal than BSD/MIT, but for most practical purposes it's the same. It's not tiny though (for an underbelly feeling, I found an old binary Windows build online of about 800kb). Looking at the current SpiderMonkey docs, things look like they've only improved. Back in the day, I just took SpiderMonkey from the "js" subdirectory of the Fi…
Re: Duktape: an embeddable JavaScript engine
#37The idea is good, I remember that other projects like Avidemux integrate QtScript or Spidermonkey for scripting. Has anybody experience, how the integration overhead is? Looks as this could be integrated very simply. The problem is, that it is in alpha stage and how stable and complete is it currently?
Re: Duktape: an embeddable JavaScript engine
#38Re: Duktape: an embeddable JavaScript engine
#39What is the advantage of something like this? (Not trying to be cynical, I just have no idea).
Re: Duktape: an embeddable JavaScript engine
#40Awesome. This is exactly what I wanted. Hopefully now I can make a standalone statically linked version jslint, lessjs, etc, so I can use them as part of my workflow without needing the whole flipping Node stack installed...