Ayende @ Rahien

Refunds available at head office

Why NH Prof isn't functional

One of the things that I wanted to do with NH Prof is to build it in a way that would be very close to the Erlang way. That is, functional, immutable message passing. After spending some time trying to do this, I backed off, and used mutable OO with message passing.

The reason for that is quite simple. State.

Erlang can get away with being functional language with immutable state because it has a framework that manages that state around, and allow you to replace your state all the time. With C#, while I can create immutable data structures, if I want to actually create a large scale application using this manner, I have to write the state management framework, which is something that I didn't feel like doing.

Instead, I am using a more natural model for C#, and using the bus model to manage thread safety and multi threading scenarios.

Comments

William Riley-Land
11/18/2008 06:10 PM by
William Riley-Land

That sounds very interesting. This is the one that isn't open source right? I'm not complaining, and I look forward to purchasing it when it is complete. What's a good reference for this kind of design pattern? Where can I see source that deals in what you are talking about (obviously not from NHP itself)?

Dajo
11/19/2008 12:08 PM by
Dajo

i think there could be a way to do it in the erlang style, because there is an erlang compiler for .Net ( http://erlangdotnet.net/). i dont know wich language is used for it, but i think it's c#.

Ted
11/19/2008 02:01 PM by
Ted

How does the bus model manage thread safety/multi-threading?

Comments have been closed on this topic.