tags:

views:

91

answers:

3

In my existing software I have an implementation of genetic programing using home grown decission making tree that is able to apply basic logic operators (AND OR NOT) in some boolean data that are provided to it in a form of an array. The platform I am using is .NET / C# with SQLServer back end. Looking for ways to improve the performance of my genetic program I concluded that I need almost all the additional functionality that comes with a functional language and I believe Scheme or to a lesser extend LISP are the best solutions for it unless I want to implement features like COND, IF, comparisson operators etc myself extending the existing implementation.

My question to the forum is if there is any efficient way to call Scheme (or LISP) from a .NET application passing data back and front in some array form. If this is not possible, do you thing that it will better just to bite the bullet and implement it from scratch or I should look for alternative ways, like for example communicating using a text file?

A: 

Why not look at F#?

(www.fsharp.net)

It's basically an adaptation of OCaml in .Net.

Or you can always use IronScheme, but I don't think it's as mature.

sukru
What is wrong with IronScheme?
sukru
What's wrong with IronScheme here is that he's concerned about performance; F# has a considerable edge there, and it provides all the functional-language goodness you could ask for. In most cases, IronScheme is great.
JasonFruit
+3  A: 

There is an R6RS compliant Scheme implementation for the DLR called IronScheme. Since IronScheme uses the DLR, it can be embedded into any .NET application using the standardized DLR embedding APIs in exactly the same way that you would embed, say, IronRuby or IronPython:

dynamic Scheme = new SchemeEnvironment();
var list = Scheme.list;
var map = Scheme.map;
// and so on

The full snippet can be found in a blog post by IronScheme's author, leppie. It also shows how to pass a C# lambda to a Scheme higher-order function and other cool stuff.

Jörg W Mittag
+1  A: 

Unless you go with IronScheme (above), I'd probably use something like ZeroMQ (which has both Common Lisp and .Net drivers) to pass messages between the two systems.

Shaun