First C# 7 Design Meeting Notes
21–30 of 82 posts
Re: First C# 7 Design Meeting Notes
#22I 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 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
#23Good 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…
http://fsharpforfunandprofit.com/posts/is-your-language-unre...
Re: First C# 7 Design Meeting Notes
#24Good 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…
Re: First C# 7 Design Meeting Notes
#25Good 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#?
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
#26I'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 overloadsFull 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 codedThe 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
#27If 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?
Re: First C# 7 Design Meeting Notes
#28Re: First C# 7 Design Meeting Notes
#29If 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).
Re: First C# 7 Design Meeting Notes
#30Earlier 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…
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"