none
What lang is .NET Rx Framework written in? RRS feed

Answers

  • Rx for .NET has been entirely written in C# using some homebrew patterns to simulate anonymous inner classes, using generics, lambdas, type inference, extension methods and all kinds of other neat language features available.

    VB probably would have worked just as well though.

    Jeffrey

    Friday, April 16, 2010 1:45 PM

All replies

  • Rx for .NET has been entirely written in C# using some homebrew patterns to simulate anonymous inner classes, using generics, lambdas, type inference, extension methods and all kinds of other neat language features available.

    VB probably would have worked just as well though.

    Jeffrey

    Friday, April 16, 2010 1:45 PM
  • No, we use too many statement lambdas, which fortunately are now available to VB programmers as well http://msdn.microsoft.com/en-us/library/we86c8x2.aspx.

    Of course Rx works beautifully in VB as well as in C# (and F#, ....); the query comprehension syntax is very compositional in VB.

    Friday, April 16, 2010 2:44 PM
  • I would think F# would have lended itself very well to this problem domain. Any reason that wasn't chosen? Perhaps b/c of the constant flux in the language until recently?
    Saturday, April 17, 2010 6:21 PM
  • I would think F# would have lended itself very well to this problem domain.

    F# already has first class events which offer much of the same capabilities as RX.

    (Some of the initial blog posts on RX started from F# events.)


    Richard J Cox
    Sunday, April 18, 2010 1:20 PM
  • Rx for .NET has been entirely written in C# using some homebrew patterns to simulate anonymous inner classes, using generics, lambdas, type inference, extension methods and all kinds of other neat language features available.

    Are there any blog posts about these "homebrew patterns"? Would they be patterns which could or should be better supported by the language? Do you think they have applicability outside Rx?

    As I'm primarily a C# language enthusiast, I'd love to hear about any insights you could share...

    Jon


    Web site: http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
    Thursday, April 22, 2010 8:33 PM
  • I believe one of the patterns he is referring to is the "Anonymous Implementation Pattern" used by Observable.Create<T>(...) and Disposable.Create(...).

    Thursday, April 22, 2010 10:53 PM
  • Note that "anonymous implementation pattern" is really just a hack that uses anonymous methods/lambda expressions to compensate for the lack of true anonymous inner classes. It quickly becomes inadequate when you want to create an instance with recursive or virtual methods. 

    Another restriction I would like to see lifted in C# is that lambdas and anonymous are not serializable.

    We use extension methods a lot, and it is quite a pain that you have to define them in a separate static class.

    Finally, I wish there was a SQO that mapped to "let" in a query and that queries could start with a "let".

    Apart from that, as an ex-Haskell programmer, the coding style is quite standard. C# is a pretty decent functional language!

    I am not sure that using a different language would make a huge difference on code size, performance or quality, the most tricky part of the implementation is locking and concurrency control (thanks to everybody for reporting deadlock, I am happy to have not seen many citings of those recently), and making sure all the edge cases are covered. Those are hard things to get right no matter what language you are using. But ask me again after we have finished the C++ version of Rx :-)

     

    Friday, April 23, 2010 3:50 AM