News for hackers. Stuff that matters.
Re:C# functional language extensions and Erlang-like concurr... by mattferderer on Sunday January 29, 2017 @12:59PM (#13515537)
As someone new to Erlang, I'm curious what the main benefits of this are? It's obviously pretty popular on GitHub. To my understanding, you can use F# with C# in .NET projects. Also from what I've read, it seems like the biggest benefit of Erlang is BEAM. Would anyone be willing to explain the benefits of this? Is the main benefit just to allow more functional programming in C#?
Re:C# functional language extensions and Erlang-like concurr... by bitwalker on Sunday January 29, 2017 @01:46PM (#13515821)
As a long-time C# dev, now full-time Erlang/Elixir dev, I've written things like this before myself when attempting to bring some of the FP tools I loved back to C# for my own benefit - so this looks really familiar in that sense. This is by no means an actual competitor to Erlang's actors - for one thing it lacks any form of supervision, which is really the most important aspect of Erlang's actor model (i.e. the "let it crash" philosophy). There are other things missing as well (such as the OTP behaviours, e.g. gen_server, provided by Erlang).

That said, this looks like something I'd definitely use, or at least experiment with in C# if I was still doing work in the language - though for the actor bits I would probably lean on Orleans.

Re:C# functional language extensions and Erlang-like concurr... by louthy on Monday January 30, 2017 @05:16PM (#13525572)
> This is by no means an actual competitor to Erlang's actors - for one thing it lacks any form of supervision

Author here. That is simply not correct. It has a full supervision hierarchy as well as a compositional strategy system for creating policies that handle failures. The strategies can also be scripted as part of the config, to detach the failure handling entirely from the actor itself.

Re:C# functional language extensions and Erlang-like concurr... by louthy on Monday January 30, 2017 @05:30PM (#13525696)
Hi Matt, I'm the author of the project. The reason I wrote it is because I have a 12 year old C# project that's creaking at the seams from the issues of OO development. I believe OO becomes cognitively very difficult when a project reaches a certain scale. Functional programming allows my brain to manage complexity much better.

I couldn't just jump ship and use F#, Haskell, or Erlang; so I decided to bring what I'd learned from those languages into C#, and create a library that will help me write better C# code.

My mission is to create a library that reduces the cognitive burden of writing C#. It isn't a functional manifesto for C#, it just looks like it because I've found that's the best way to achieve my goals.

The Process system (Erlang style actors) is there to deal with the 'edges' of functional code. It's not possible to be pure like in Haskell, and so you will have stateful code - with all the problems that come with it, i.e. shared memory, locks, mutability, etc. Actors allow a certain amount of control that you don't get from C# classes: Single-threaded and no-shared state. They can be distributed anywhere and the mechanism for interaction is the same. You can build in routing or proxying to do load-balancing, etc.

Re:C# functional language extensions and Erlang-like concurr... by mattferderer on Monday January 30, 2017 @11:21PM (#13527575)
That makes perfect sense. Thank you for taking the time to reply.

The thought of trying to fix up an old code base did not even cross my mind. Probably because that is what my nightmares are made of.