A .NET Analysis Engine
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



A runtime in which developers can define, compile, and execute calculations against arbitrary data schemas

When Would You Use It?

You have a project whose problem domain centers around analysis: generating data by examining existing data. A survey system is a common example, as it collects values from users and performs different kinds of calculations on the answers:

  • How many people filled out the entire survey?
  • What is the average value of question 7?
  • What percentage of the survey did Bob complete?
  • Did Mary answer all required questions?
  • What is the total of Joe's answers on page 3?

The results of asking each of these questions becomes a new data point available to future rounds of analysis. This allows a very fine-grained and iterative approach to describing relationships within a set of data.

Thanks to its declarative and compositional nature, Grasp works very well at the core of dynamic systems. Let's say your project involves letting users create their own surveys, complete with calculations and validation; your application, then, doesn't define a survey itself but instead serves as a middleman between its users and Grasp. This neatly sidesteps the problem of inventing a data definition and execution engine (as usually happens in this scenario) and instead allows you to focus on building features for your users.

Surveys are just one example of a form structure; Grasp targets any system which asks questions about data. See the Articles section below for more examples.



Get it in the package manager console:

PM> Install-Package Grasp

Or from the online gallery:


Working with the Code

Code Contracts

You will need the Code Contracts tooling to build the solution correctly. The method calls in the System.Diagnostics.Contracts namespace are included in .NET 4; this simply allows Visual Studio to rewrite the assembly after it compiles:



All tests are written using NUnit In order to run them, you will need a test runner that supports NUnit 2.5. I recommend the excellent TestDriven.NET.


MIT License


Copyright © 2012 Bryan Watts