Home icon indicating copy to clipboard operation
Home copied to clipboard

Support for generics <T>

Open josesimoes opened this issue 4 years ago • 20 comments

nanoFramework area: (CLR)

Work was started to on adding support for generics. Considering that this is a work intensive effort, we are currently seeking financial sponsors to resume the work on this. If you're a commercial user in need for this feature please reach out to to the Core Team. Keep in mind that all this it's a combined and community effort. Several small contributions can add up and bring in a huge impact!

https://docs.nanoframework.net/content/contributing/index.html

Workload breakdown:

  • [x] CLR
  • [x] Type System
  • [x] Interpreter
  • [x] Debugger Library (partial work)
  • [x] Metadata processor (partial work)
  • [x] Support in Visual Studio debugger engine

josesimoes avatar Jun 23 '21 09:06 josesimoes

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 22 '21 18:08 stale[bot]

Could we have an update on your status on generics support please? I think this feature is a show stopper for us.

acrigney avatar Sep 24 '21 04:09 acrigney

Could we have an update on your status on generics support please? I think this feature is a show stopper for us.

Hey @acrigney! Thanks for asking. This is it's still on the queue waiting for free time to get back to it...

josesimoes avatar Sep 24 '21 06:09 josesimoes

Any news about this issue?

Martinn2 avatar Feb 04 '22 19:02 Martinn2

Any news about this issue?

This will require funding, more than what is available as it's still a long road to go and hard to do just as a community effort.

Ellerbach avatar Feb 05 '22 14:02 Ellerbach

To be able to sort the whole thing a little better, since I unfortunately could not find a Roadmap. Are the "generics" needed first before we can use ".NET standard" libraries?

DocBrown101 avatar Feb 07 '22 18:02 DocBrown101

Are the "generics" needed first before we can use ".NET standard" libraries?

Short answer: Yes Longer answer: you need more to support .NET Standard. Also, there is technically many ways to support .NE Standard even without generics or async or Linq. But that would not help much :-) In all cases, there is a very very very long way to support .NET Standard on such small MCU!

Ellerbach avatar Feb 07 '22 19:02 Ellerbach

To be able to sort the whole thing a little better, since I unfortunately could not find a Roadmap. Are the "generics" needed first before we can use ".NET standard" libraries?

The existing CLR and execution engine require a "parsed" version of a .NET library. That's why we can't reference directly the "standard" NuGets and .NET libraries. Main reason being that you won't have enough flash and RAM to deploy them in the 1st place. Generics or no generics that it's unlikely to change. So you'll always need a trimmed down version of any .NET library.

josesimoes avatar Feb 07 '22 19:02 josesimoes

Okay, that's very unfortunate. It sounds more like it will never be possible in the future because there are not enough resources for ".NET standard" in the micro-controller area.

DocBrown101 avatar Feb 07 '22 19:02 DocBrown101

@DocBrown101 not sure if I follow up... we are running .NET on microcontrollers for years now! Just that you can't use the same libraries that you use on "Desktop" for the reasons explained.

josesimoes avatar Feb 07 '22 19:02 josesimoes

Sorry, that was worded wrong, of course I meant ".NET Standard"

DocBrown101 avatar Feb 07 '22 19:02 DocBrown101

The same applies. .NET nanoFramework mscorlib (along with the other libs that "mirror" .NET) are aligned with the full framework as much as possible. The exceptions are, obviously, the lack of generics and all that goes in tow like async/await, etc. When generics become available the "alignment" will be worked on.

josesimoes avatar Feb 07 '22 19:02 josesimoes

Any estimate on funding required? What about a Gofundme? Get some heavy hitters in the .NET world to help spread the word (I could hit up one). I think a lot of C# fans would throw in some $ as they like the idea of improvement in this area even if they are not embedded developers or hobbyists.

@Ellerbach said "still a long road to go" but 5 of 6 tasks are complete. Is that final task super challenging?

t9mike avatar Feb 08 '22 21:02 t9mike

Hi @t9mike, It’s hard to estimate how much funding is required but we are speaking in units of 10K€, most likely 40K€+. Even if you see checked boxes, there is still quite some things to do. A checkbox in this context means: the minimum to see if it’s working is done. It doesn’t mean, it’s production code quality ready with all the tests. As soon as you introduce something that is a large change like this one, there will be, some small issues which will have to be investigated, some may be edge cases because some elements may be missing in the platform and will have to be added. It took years to have something stable on generics on the .NET Framework! OK, the compiler is now perfect for that but it has to be fitting into the small device. The debugger part is extremely complex. It takes hours to setup (2 Visual Studio sessions plus 1 VS Code plus hardware debugging), you need then to understand step by step what’s happening, it’s a lot of work. I love the idea of having a fund raising, I would love as well to see professional users funding this seriously as well. I’m sure that all together, something can be achieved. And it has as well to be fair and enough to make the changes and support afterward properly. Up to the point it can become a community effort.

Ellerbach avatar Feb 09 '22 10:02 Ellerbach

Support for generics <T> now? I want use nanoCLR for game develop C# script

lvzuoxin avatar Aug 10 '22 08:08 lvzuoxin

Support for generics now? I want use nanoCLR for game develop C# script

I would think it is easier and cheaper to develop your game in Raspberry Pi and full dotnet framework is available. Maybe look at Meadows where full framework C# is supported.

alberk8 avatar Aug 10 '22 08:08 alberk8

Development of this it's on hold. Progress will be reported here. 🙂

josesimoes avatar Aug 10 '22 08:08 josesimoes

Meadows is awesome with full generics support.

On Wed, 10 Aug. 2022, 6:51 pm alberk8, @.***> wrote:

Support for generics now? I want use nanoCLR for game develop C# script

I would think it is easier and cheaper to develop your game in Raspberry Pi and full dotnet framework is available. Maybe look at Meadows https://www.wildernesslabs.co/ where full framework C# is supported.

— Reply to this email directly, view it on GitHub https://github.com/nanoframework/Home/issues/782#issuecomment-1210364253, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCSC7OVRK7PFUFJFOSAI23VYNUQ3ANCNFSM47FOLUUQ . You are receiving this because you were mentioned.Message ID: @.***>

acrigney avatar Aug 10 '22 10:08 acrigney

@acrigney But Meadow only works with a single board, which isn't cheap either.

DocBrown101 avatar Aug 10 '22 10:08 DocBrown101