Keep your multi-core CPU busy with F#
The growth of computer CPU speed is slowly being replaced by the growth of number of CPUs (or cores) in the computer at least for the close future. This causes a revolution in the way software is written, because traditional and most widely used way of writing concurrent applications using threads is difficult and brings several serious issues. Some predictions say that within a few years, almost every computer will have about 16 cores, so there is a huge need for programming paradigms or idioms that help developers write concurrent software easily (see also The Free Lunch Is Over [^] written by Herb Sutter).
Functional programming languages (especially pure functional languages) are interesting from this point of view, because the program doesn't have side-effects which makes it very easy to parallelize it (programs in pure functional languages can't have any side-effects by design, in other functional languages like F# the side-effects can be eliminated by following functional programming style).
This article describes the code that makes it possible to parallelize some common F# constructs like the
CLinq - LINQ support for the C++/CLI language
I started working on this project, because I attended C++ class at our university and I had to do some application in C++. Because I hate doing useless projects I wanted to work on something interesting and so I started thinking whether it would be possible to enable LINQ support in C++/CLI...
C++/CLI is a very flexible language and the following example proves that enabling LINQ support in C++/CLI isn't impossible. The following database query returns name of contact and company for all customers living in London:
// create connection to database NorthwindData db(".. connection string .."); // declare database query Expr<Customers^> cvar = Var<Customers^>("c"); CQuery<String^>^ q = db.QCustomers ->Where(clq::fun(cvar, cvar.City == "London")) ->Select(clq::fun(cvar, cvar.ContactName + Expr<String^>(", ") + cvar.CompanyName)); // execute query and output results for each(String^ s in q->Query) Console::WriteLine(s);
If you are interested in more information about CLinq project you can...