That’s V8 the ECMAScript engine, by the way. I’ve been looking at it recently because I’m suddenly feeling very interested in embedding a scripting language in a C++ application. Since I’m out of school for the moment, I have some time to fiddle with open source projects and see if I can get them to work.
I find V8 very interesting. It’s the engine used for JavaScript in Google Chrome, and it’s designed for high performance. Unfortunately, the build process is a little… I don’t know… “wonky” might be a good word for it. Instead of a standard tool that just about every developer has (like make), Google uses an esoteric bit of engineering called SCons for the build process. It’s been updated relatively recently (within the last year), but the “installer” looks like something from the 1990′s with its full-screen background window. Finishing up the installation, because the program available for download just copies a bunch of files into your Python directory, is even more of a hassle than having to look at the so-called installer.
After about half an hour of increasingly despondent searching for answers, I found an article on Google Code explaining where the files were actually installed, and that the installer didn’t put that directory in the system path. Then I realized that the page was linked to from the main V8 build guide, and felt a little silly for missing it. Once that directory was in my PATH, SCons worked well enough, building the DLL and static library with the Microsoft Visual C++ compiler. I have since found out how to compile it with MinGW instead, and although it’s a little more involved, it also works fairly well.
Once I got past the build process, I was quite impressed with how easy it is to use V8. A really basic embedded interpreter can be written in under 50 lines of code. At the same time, if you want to crank up the complexity, V8 is fully capable of delivering much, much more. I’m currently working on a scripting environment based on V8 which could end up being fairly useful; one of the things I’ve already added rudimentary support for is loading native code libraries at runtime. The exports of those libraries are then available to the currently executing script.
So, pretty neat stuff… I’m also hoping to incorporate V8 into a game at some point. The future can be an exciting thing!