Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for generics <T> #782

Open
3 of 6 tasks
josesimoes opened this issue Jun 23, 2021 · 19 comments
Open
3 of 6 tasks

Support for generics <T> #782

josesimoes opened this issue Jun 23, 2021 · 19 comments

Comments

@josesimoes
Copy link
Member

josesimoes commented Jun 23, 2021

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:

  • CLR
  • Type System
  • Interpreter
  • Debugger Library (partial work)
  • Metadata processor (partial work)
  • Support in Visual Studio debugger engine
@josesimoes josesimoes self-assigned this Jun 23, 2021
@josesimoes josesimoes pinned this issue Jun 23, 2021
@josesimoes josesimoes changed the title Support for generics T<> Support for generics Generic<T> Jun 23, 2021
@josesimoes josesimoes changed the title Support for generics Generic<T> Support for generics <T> Jun 23, 2021
@stale
Copy link

stale bot commented Aug 22, 2021

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 stale bot added the stale The issue/PR hasn't seen any activity from the past 60 days. label Aug 22, 2021
@stale stale bot closed this as completed Sep 19, 2021
@josesimoes josesimoes added 📌 pinned This issue is meant to be permantely open. and removed stale The issue/PR hasn't seen any activity from the past 60 days. labels Sep 19, 2021
@josesimoes josesimoes reopened this Sep 19, 2021
@acrigney
Copy link

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

@josesimoes
Copy link
Member Author

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...

@Martinn2
Copy link

Martinn2 commented Feb 4, 2022

Any news about this issue?

@Ellerbach
Copy link
Member

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.

@DocBrown101
Copy link

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?

@Ellerbach
Copy link
Member

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!

@josesimoes
Copy link
Member Author

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.

@DocBrown101
Copy link

DocBrown101 commented Feb 7, 2022

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.

@josesimoes
Copy link
Member Author

josesimoes commented Feb 7, 2022

@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.

@DocBrown101
Copy link

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

@josesimoes
Copy link
Member Author

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.

@t9mike
Copy link
Sponsor

t9mike commented Feb 8, 2022

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?

@Ellerbach
Copy link
Member

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.

@lvzuoxin
Copy link

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

@alberk8
Copy link

alberk8 commented Aug 10, 2022

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.

@josesimoes
Copy link
Member Author

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

@acrigney
Copy link

acrigney commented Aug 10, 2022 via email

@DocBrown101
Copy link

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

@TerryFogg TerryFogg unpinned this issue Mar 8, 2023
@josesimoes josesimoes pinned this issue Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants