Adding std::future support to ChaiScript

Yesterday I decided to look into adding std::future support to ChaiScript. To be fair future is the return value of several other higher level threading constructs, so we don't want just "std::future," we want enough support to make it usable.

ChaiScript works very well with functions and function objects, so ideally we want something like:

Complex Object Initialization Optimization with IIFE in C++11

IIFE (Immediately-Invoked Function Expression) is a common tool used in JavaScript. The idea is to both define an anonymous function and call it in the same expression. The point is to produce a local scope for variables so they do not pollute the global scope.

This same technique can be deployed in C++ to lead to cleaner, safer, more performant code when building up objects which require multiple steps to initialize.

Make Sure You Provide Virtual Destructors

If you make use of inheritance, it's likely that you need to provide a virtual destructor for your classes. Modern compilers will warn if you do not, but this is a pretty recent development.

The problem is best illustrated with an example:

ChaiScript (almost) 5 Years Later

July 13, 2009 Reddit covered Release 1.0 of ChaiScript. Many things changed in the last 5 years. Features added, dependencies removed, and performance increased. With all of the changes, we decided it was time to provide a 5 year retrospective and give the world a second first-look at ChaiScript.

To start with, we've celebrated 5 years with a brand new website with organized examples (in progress) and documentation links:

And a continuous integration system: Build Status Coverage Status

Tech Roundup

I've been following a few different news sources lately and have found a few good articles and projects I thought I would share.

New ChaiScript Releases

We are proud to announce two new ChaiScript releases:

ChaiScript 4.0.0

  • Lots of bug fixes
  • Performance improvements
  • Support for ?: ternary operators
  • Support for switch statements

ChaiScript 5.0.0

This release is a complete retooling of ChaiScript that uses C++11 instead of Boost.

C++11: Auto

We've already covered C++11 decltype and why you should start using C++11 features today. Now we will move on to one of the most widely supported C++11 features: the new auto keyword.;

Are You Using make_shared Yet?

Recently, while watching the GoingNative conference, I learned about the new std::shared_ptr helper function std::make_shared.

Using Non-Standard Resolutions with VirtualBox RDP

I like to connect to Virtual Box guest operating systems remotely over RDP connections. This generally works well except if I connect from my 1280x720 laptop to a Windows guest. In this case the Windows guest will tend to resize to a "standard" resolution that fits inside of the 1280x720, which is 800x600. This can be rather obnoxious.

Trigraphs, Digraphs and Alternative Tokens

Quick, which language is the following code written in?