Live data from Hacker News

First C# 7 Design Meeting Notes

github.com

21–30 of 82 posts

Re: First C# 7 Design Meeting Notes

#22
post #15
post #9

I would LOVE for C# to get language support for go style channels complete with select and friends. C# already has the fantastic Task stuff, and while they aren't as cheap as go's go-routines they work very well. Channels would just ice the cake so well. :D~~~ And while I'm at it. I did some testing recently and realized that manually currying in a for loop is faster than using function composition with delegates by…

If you mean what I think you mean by "manually currying", it's likely because behind the scenes, there is a proxy class created for most (all?) lambdas that contains everything it needs to execute, including any scope variables maintained. So there's some extra overhead there, though not as much as you'd expect since everything, even value types, are pulled in by reference in the context of lambdas.

I did not know that! That explains a lot of the memory performance problems I was having (structs being moved to the heap...icky); lambdas are sneaky little turds.

I solved the problem by avoiding lambdas altogether in code where performance is a concern, using delegates instead and ensuring all arguments are passed in rather than closed on (so structs would remain structs, GC pressure is avoided).

Re: First C# 7 Design Meeting Notes

#23

Good start, finally adding records, patterns, tuples, non null, would be a good first step to making C# not feel so heavyweight compared to F#. If the F# team ever gets enough resources to complete with C#'s VS features, perhaps we'd get some serious adoption. As is, F# comes across second class both in tooling and MS marketing - that's not really competing fairly ;) But without making things expressions, it's still…

Just yesterday there was this article illustrating how C# fundamentally can't catch-up with F# on some important characteristics:

http://fsharpforfunandprofit.com/posts/is-your-language-unre...

Re: First C# 7 Design Meeting Notes

#24

Good start, finally adding records, patterns, tuples, non null, would be a good first step to making C# not feel so heavyweight compared to F#. If the F# team ever gets enough resources to complete with C#'s VS features, perhaps we'd get some serious adoption. As is, F# comes across second class both in tooling and MS marketing - that's not really competing fairly ;) But without making things expressions, it's still…

AFAIK F# is the first class VS citizen since VS 2010. They have a small yet good team working on it. What do you think is missing support in VS for f#?

Re: First C# 7 Design Meeting Notes

#25

Good start, finally adding records, patterns, tuples, non null, would be a good first step to making C# not feel so heavyweight compared to F#. If the F# team ever gets enough resources to complete with C#'s VS features, perhaps we'd get some serious adoption. As is, F# comes across second class both in tooling and MS marketing - that's not really competing fairly ;) But without making things expressions, it's still…

AFAIK F# is the first class VS citizen since VS 2010. They have a small yet good team working on it. What do you think is missing support in VS for f#?

In general, overall tooling is not at the same level. Code gen is focused on a C#-like model, designers aren't there, debugging isn't the same (immediate window, for instance). Last i checked (which was a while ago), VS testing didn't work with F#. Even Intellisense is not as complete. I'm happy with F#, very happy indeed. But it lacks the resources that C# gets thrown at it. And it suffers from MS not having the honesty to just admit MSR outdid them again (as they did with generics), that as a language, F# simply outclasses C#. Instead, we get lines like "F# is for scientific computing" or similar spin.

So yes, shipping F# with VS is a good step, and technically it's supported, it's obvious MS has some discomfort there. Which is too bad, cause F# is a rare jewel, nothing else has the combination of language features, interop/library, performance, and tooling.

Re: First C# 7 Design Meeting Notes

#26
I've been trying to think of something that drastically change how I coded. Bugs and productivity really are the two major dragons to slay.

I'm just spitballing here but something I'd really like to see stuff like code contracts and unit testing, but more integrated with the language, less verbose and requiring less to setup. Being able to let the "meat" of a method be separated from all the error-checking, post, pre conditions etc would really make things cleaner.

Current implementation feels like it requires too much setup with separate classes, duplicate method signatures in several places etc etc. It would be really cool to have something like

  public int SomeMethod(int a, int b)

  pre 
  { 
    Requires (a > 5);
    Requires (b >= 0, new Exception("something something"));
  }

  {
     // DoStuffHere
  }

  post
  {
    Ensures (result > 0, new Exception("needs to be above 0"));
  }
I'd even want to be able to separate it into separate files using partial classes (or something) so you could the condition stuff separate , with or without duplicating signature depending if you wanted to target specific overloads

Full signature would simply be without the body:

  public int SomeMethod(int a, int b)

  pre
  {
    Requires (a > 5);
    Requires (b >= 0 ,new Exception("something something"));
  }

  post
  {
    Ensures (result > 0);
  }
Without signature is trickier, but would be cool since you could use same conditions for several overloads, and just target the variables that are included in each:

  Conditions.SomeMethod
  {
    pre
    {
      Requires (a > 5);
      Requires (b >= 0, new Exception("something something"));
    }

   post
   {
     Ensures (result > 0);
   }
  }

heck, why not even throw in "test blocks" and Visual studio could run light-weight kind of unit test as you programmed and mark the whole method as functioning or not. Imagine having a sort method and throw in something like:

  public IEnumerable Sort (IEnumerable list, Order order)
  test
  {
     (list = {3,5,6,2}, order = Order.Ascending) => result == {2,3,5,6};
     (list = {3,5,6,2}, order = Order.Descending) => result == {6,5,3,2}
  }
VS could highlight the failed test(s) directly in the editor as you coded

The specifics and syntaxes of these things requires some thought but I love the basic premise, am I rambling?

edit: I saw that something in this direction if not as extensive was actually discussed

Re: First C# 7 Design Meeting Notes

#27
post #20
post #4

If only the open source languages we use had that many resources and paid developers... (Well, technically C# and the related libs are fully OSS now too, IIRC).

What's the matter? Open-source did not turn out to be such a silver bullet?

There is no silver bullet as such. Open source is just a bullet, the one that keeps the community armed.

Re: First C# 7 Design Meeting Notes

#30
post #7

Earlier quoted context omitted.

IIRC, they (MS) said would steer the language and .NET libs, and not involve a community style effort (because they want to ensure compatibility for their customers), did they change that?

That's not different than some open source projects and has no bearing on it being open source. Some project leads call attempted contributors idiots and refuse to even fix security bugs. Some have differing visions for their project. Which projects run by a strict vote, and how would you even decide who gets to vote? Most likely you'd elect leaders that will vote in the benefit of the project... Which is what MS has…

>That's not different than some open source projects and has no bearing on it being open source.

I didn't say it's different, or that it's not open source for that.

I asked because the parent said: "If you want to contribute actual code and have it actually incorporated into the language, then all you need to do is follow the contribution guidelines here"

Post reply on HN