Parallel programming with ParaSail

July 30, 2011

An interesting ACM news item recently is a write-up about a language called ParaSail, which is specifically designed for multi-core optimization. It uses a technique called pico-threading, effectively splitting a program into “thousands of smaller tasks,” which can be executed concurrently on however many processor cores the target system has.

Although Duncan Graham-Rowe’s article on the language likens ParaSail to C# and Java, the syntax only very vaguely resembles those modern programming languages, instead taking after languages like Basic or possibly Lua. The syntax is a little ugly to me personally, but I will definitely be watching this project with interest. The implications for high-performance applications are immense, especially with the rising numbers of cores in today’s processors.

On an unrelated note, I just got back from a family trip to Disneyland, which was quite fun. I’ve been very interested in the special effects in Disney’s rides for several years now, so I might write a bit about that later on…


On the Road to V8

July 21, 2011

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!


Follow

Get every new post delivered to your Inbox.