Page 1 of 2

Moving to .Net 4.0

PostPosted: Mon May 27, 2013 5:50 am
by hopscc
C# .Net 4.0 has some additional goodies that Cobra may benefit from.
Is there an intention of enhancing cobra for these?

We already have type inference and late binding with a ticket/note for supporting (or using) the .Net 4.0 code for that
i.e var and dynamic - see ticket:319.

The obvious ones not covered yet are
  • Optional Parameters (default parameter values)
  • Named Parameters
  • Variance (maybe - probably just augmenting syntax support)
  • I think simpler COM interop should just fall out of the update....

see C 4.0s New Features Explained

Re: Moving to .Net 4.0

PostPosted: Mon May 27, 2013 12:01 pm
by Charles
Sure. Also:

* Generate C# lambdas for Cobra lambdas
* Generate C# property initializers for Cobra property initializers
* Switch Set<T> to inherit from HashSet<T>

And we're still behind on not binding to C# extension methods which is probably the #1 pain point among all of these.

Re: Moving to .Net 4.0

PostPosted: Mon May 27, 2013 12:03 pm
by Charles
Btw, for everyone's info, after the last release, I bumped Cobra to .NET 4.0 in the repository.

Re: Moving to .Net 4.0

PostPosted: Mon May 27, 2013 10:53 pm
by hopscc
Maybe set these up as two tickets/task groups
One for things that cobra already does but Net 4.0 now has things to support better - codegen changes in other words
  • Use 'dynamic' dcl for cobra dynamic Type
  • use '''var''' for type inference (where necessary) ??
  • Generate C# lambdas for Cobra lambdas
  • Generate C# property initializers for Cobra property initializers
  • Switch Set<T> to inherit from HashSet<T>

Another for overt changes that need changes/augmentation of cobra language itself (as well as codegen)
  • Optional Parameters (default parameter values)
  • Named Parameters
  • Support Net 4.0 Variance


Change ticket:319 to something like 'Change codegen to use 4.0 capabilities' for the first group
or would you rather them each pulled out as separate items?

Whats the ticket#/description/discussion topic for the 'not binding to C# extension methods' ?

Re: Moving to .Net 4.0

PostPosted: Tue May 28, 2013 6:35 am
by gourD
Charles wrote:Btw, for everyone's info, after the last release, I bumped Cobra to .NET 4.0 in the repository.


In Mono FAQ I read the following:

The Mono API today is somewhere in between .NET 2.0 and .NET 4.0...


Does the move of Cobra to .net 4.0 mean that Linux users will degrade into some lower status? :?

Re: Moving to .Net 4.0

PostPosted: Tue May 28, 2013 11:20 am
by Charles
hopscc wrote:Change ticket:319 to something like 'Change codegen to use 4.0 capabilities' for the first group
or would you rather them each pulled out as separate items?

Whats the ticket#/description/discussion topic for the 'not binding to C# extension methods' ?

Separate tickets would be better.

I don't see a ticket for binding to C# extension methods.

Re: Moving to .Net 4.0

PostPosted: Tue May 28, 2013 11:21 am
by Charles
gourD wrote:
Charles wrote:Btw, for everyone's info, after the last release, I bumped Cobra to .NET 4.0 in the repository.


In Mono FAQ I read the following:

The Mono API today is somewhere in between .NET 2.0 and .NET 4.0...


Does the move of Cobra to .net 4.0 mean that Linux users will degrade into some lower status? :?

Typically what comes in late are more obscure parts of the API. I don't think we'll have any problems.

Re: Moving to .Net 4.0

PostPosted: Wed May 29, 2013 5:01 am
by hopscc
OK I'll open some tkts for .Net 4.0 support work.

Theres 5 tickets for extensions, do any of them apply to the 'binding to C# extn methods' you mean ?

130: The compiler doesnt find the closest Extension method
1: Extension methods and properties
26: Recognize extension methods in dynamic binding
146: bug when adding an extension method that is an overload of a BCL class
145: Complete the collection of string.split extension methods

If not can we get a ticket ( or expand one of the existing ones) describing what the issue is?

Re: Moving to .Net 4.0

PostPosted: Wed May 29, 2013 4:12 pm
by Charles

Re: Moving to .Net 4.0

PostPosted: Thu May 30, 2013 5:36 am
by hopscc
Good O.

ticket:324 - ticket:330 are for tasks for support work identified to date.