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

.NET 8 Pre-planning #7565

Open
richlander opened this issue Jun 25, 2022 · 13 comments
Open

.NET 8 Pre-planning #7565

richlander opened this issue Jun 25, 2022 · 13 comments

Comments

@richlander
Copy link
Member

richlander commented Jun 25, 2022

Now is a good time to start thinking about what might come next. I've started some issues to that end. Feel free to comment with links to improvements that you'd like to see in .NET 8.

@shaggygi
Copy link
Contributor

Would be nice to see more thoughts and possible roadmap around Wasm/Wasi (understanding there is still lots of spec churn that blocks/determines future of .NET support).

https://github.com/SteveSandersonMS/dotnet-wasi-sdk

@richlander
Copy link
Member Author

We have discussed it. I think it is just a when not if. The best way to make that happen sooner is offer scenarios where you think that would be useful and compelling.

@shaggygi
Copy link
Contributor

shaggygi commented Jun 25, 2022

We have discussed it. I think it is just a when not if. The best way to make that happen sooner is offer scenarios where you think that would be useful and compelling.

I'm actually just starting to get into this space (watching Wasm vids, reading intro books on Rust, etc.). I'm blown away on what Steve has demoed in this space and see great potential. However, with my limited knowledge on topic I'm more just watching from a distance currently.

I think what I struggle with right now is what should we expect from a .NET perspective (again, understanding there is going to be lots of change/innovation as it picks up steam). For example, how will it execute in a Wasm runtime? Can we have a few C# classes that compile down to the Wasm bytecode or is a trimmed down .NET runtime and such required to bundle? And what are some average sizes of .NET code used in the space?

I'm more interested in this using with IoT (smaller constrained device). The selling point for Wasm is the compliance on different devices. Does this mean we could run .NET code on smaller devices like ESP32 using something like WAMR? Lastly, I could see some really nifty things come out of this with the work done over in dotnet/iot. But would those current bindings work if using in a bare-metal scenario or will it require Wasm to be running under Linux?

Anywhos, this definitely will be an interesting space to watch. Thx

@richlander
Copy link
Member Author

The dotnet/iot bindings will work as long as we can write a GpioWasmController. One of the huge advantages we have is that our implementation is abstracted and easy to port. Most of the bindings would not notice the difference.

I didn't know about the ESP32 implementation. I would worry more about resource constraints (memory, clock cycles).

@AliShahesmaeili
Copy link

AliShahesmaeili commented Jun 25, 2022

Okay. Here are the things I want/love to see in .NET 8

1- Native Support of Python
As we know, Python is popular with many libraries. Especially in the field of artificial intelligence (This can greatly help the development of ML.NET, TorchSharp ...)
I would like to be able to call Python code directly and interact with it in .NET (Something like P/Invoke for c++ communication)
This can now be done with IronPython library.

2- C++/CLI on other platforms
I know that C++/CLI is Windows OS specific technology, but is there a way to use C++/CLI on Mobile? (Xamarin/MAUI projects)
Our team wrote part of a large project with cpp/cli and we use it in the WPF project.
We would love to be able to use it in a future MAUI project. (I think this can even help the development of Unity games)

3- FFmpeg
Today, FFmpeg is used by millions of projects
Microsoft has introduced an easy way to use FFmpeg library in C#, But it only works on Windows
I know this is a library and it has no direct connection to the .NET kernel, but something can be used in millions of projects, can it exist in kernel? Isn't that so? (Same as when Microsoft added system.text.json)

4- HttpClient response time
I am currently using this solution
Something like RoundtripTime in Ping Class

@arthastheking113
Copy link

I hope .NET 8 main focus will be Blazor.

  1. Blazor WASM size should be smaller. A production Blazor WASM should only about < 4mb.
  2. Blazor should have the ability to switch mode between Server and WASM on runtime. Just like mentioned in #38128, #35358, and #17678
  3. Blazor WASM Prerendering should include authentication #29634
  4. Blazor WASM SSG (Static Site Generation). User want their content to be generated on build time to host on Azure Static Web to have a best delivery time to user. This should be also apply to Blazor WASM Hosted Model.

These 4 are the missing pieces that I think Blazor will need to be used by a wider audience.

  • The main issue with Blazor WASM now is size.
  1. People is interested with Blazor but when they see a production Blazor size > 4mb. They will look into other JS Framework like Astro, Svelte, or NextJs.
    • These JS framework allow them to ship raw HTML and JS will be hydrate when user interact with elements so their Size is extremely small. I see their compete with each other by kb, not even mb.
    • These JS framework allow them to generate Static content page on build time and host them on CDN.
  2. Since Blazor WASM size become too large and lower the size to < 4mb is not possible then I think give the user the ability to switch mode on Runtime will become a great solution. The page first load will be Blazor Server, .wasm and .dll will be downloaded in the background, then when everything is downloaded, browser will switch mode to WASM.

@lofcz
Copy link
Contributor

lofcz commented Dec 3, 2022

It would be nice to reconsider Blazor custom directives for .NET 8. While the original proposal targets Razor, it makes even more sense for Blazor. There are built-in directives such as @page serving purely as a syntax sugar to @attribute []. Exposing an API to do the same would be great.

FooAttribute.cs:

public class FooAttribute : Attribute, IBlazorDirective {
   public FooAttribute(string arg) {

  }
}

BarPage.razor:

@foo "hello world"
<h1>Page title</h1>

@aymen157
Copy link

Would love to see (ranked from best):

  • More WASM support (smaller sizes, more docs, independence from Blazor, faster build times...)
  • More C++/C interop cross platformism
  • Extension properties/fields

@wf-soft
Copy link

wf-soft commented Jan 11, 2023

Unfortunately, both Trimmed and AOT compilations have a lot of bugs, so they only work for a small percentage of applications so far

@sgf
Copy link

sgf commented Jan 11, 2023

I hope .NET 8 C#
more support for native development.These are old problems.

  1. bit-field support ,from C# Bitfield struct support csharplang#465
  2. define custom struct fxied size buffer support. from Champion: fixed-sized buffers csharplang#1314 ,https://github.com/dotnet/csharplang/blob/main/proposals/fixed-sized-buffers.md
  3. c-style anonymous unions and structs. from Provide a mechanism for declaring c-style anonymous unions and structs. csharplang#687
  4. Union and Intersection types Discussion: Union and Intersection types csharplang#399
  5. support sizeof() used to fixed size buffer, support span<T> direct access the fixed size buffer

Although more code can be written to implement it, or a corresponding library can be developed to support it. But obviously, C# has been around for so many years, and no useful library has been developed. This means that this is not an easy job.
I hope that C# can become a language closer to native programming. Although, my proposal is trivial, but I still hope: Please consider supporting these features.

@ygc369
Copy link

ygc369 commented Feb 17, 2023

I'd love to see:

  1. escape analysis to stack-allocate objects automatically and reduce GC pressure.
  2. fixed size buffer for any type.
  3. more performant GC.

@ryanwinter
Copy link

Targeted AOT compilation for WASM, as well as improved Webpack (and others) JS bundling support.

@deeprobin
Copy link

@richlander

Is this issue still relevant or can it be closed?
.NET 8 is already in GA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests