Комментарии:
So it can cross compile. From linux to windows binarys
ОтветитьYou at least understood the real worth of Native executable and talking this topic.
I see 90% of coders without knowing this, blindly coding in .NET and soon their applications is Cracked on the market.
How idiotic ?
For few lines of coded .NET app takes 75MB size of executable.
Note: This native compilation fails in bigger applications with additional nuget packages.
Now when starting a new project in VS. When you choose .NET 8; You can choose to use the Aot into native by default in a checkbox.
So when you open your project file. It has the <PublishAot>true</PublishAot> in it already.
This doesn't apply for .NET 7 or earlier.
I've installed .net 8 and it's not possibile that I cannot find a compiler for c# 12 in the stuff I've installed, where is it? Not the old csc.exe for c#5 from the windows directory
ОтветитьNice, short, clear and simple for understanding! Way to go man!
ОтветитьMicrosoft took the long road to a home brewed llvm 😂
ОтветитьThanks for the video , I am new in c# , do you have any tutorials / courses that show how to create Apis in c# and deploy the final app to linux cloud ?
ОтветитьThis is so underdocumented thank you so much for this video!
ОтветитьWhy we had to wait for .NET 7 for this remains a complete mystery.
ОтветитьFor iOS Apps, AOT is the only way to go.
Ответитьit's not a real native code. many of us want to compile c# into the native code, so others can not decompile the exe back to source code. but with this NativeAOT, one can easily decompile the exe/dll into source code again.
Is there any other tools to compile c# framework project into native code, so it can not decompile to source merely with exe/dll ? I am eager to find such tools
Love your explanation. Thank you
ОтветитьCan we convert windows forms into intermediate language? I'm guessing not lmk
ОтветитьI used "csc Program.cs" and the output was a single file and it wasn't stupidly huge.
ОтветитьCoooooool, hope this come to webapis
ОтветитьAot compiling dont supported for ASP .Net Core projects? Only for console?
ОтветитьImagine if you could AOT compile your c# program with clang -O3 and avx2 this would be nuts
Ответитьthe single file option is only slow on the first run when it unpacks the file. after that it's fast.
ОтветитьFinally!!! Since I've started the C# course I'm currently part of, and ever since becoming interested in C#, I've always hoped to find a way to build to every architecture natively in order to avoid relying on the end user having the .NET runtime, or having to ship gigantic amounts of supporting files!
The amount of performance optimization that can be done here is most likely a good chunk, and I can't wait to see what this AoT option evolves to!
Electron apps face the same issue, without having a framework preinstalled on the local machine each application must contain everything to run which makes each project unnecessarily large.
I'm hoping at some point web browsers adopt the ability to install DLL's which can be used by any site so that we can get away from having to use JS to interact with the DOM. Assuming Blazor takes hold maybe we can work towards Wasm's being cacheable for all domains.
Question: Is this new to C#/.NET?
ОтветитьI have waiting this moment for years. I waiting it from when it was called CoreRT.
ОтветитьThanks a lot for this video! Does it work if code contains reflection? Are there any other restrictions?
ОтветитьDoes AOT apps have GC and if not how are strings cleanup?
ОтветитьTo bad only works on console apps...
ОтветитьForgive me if the question is silly. Would it be possible to load PHP core library (written in C) into C# and build extensions with it? Or maybe with a PHP-CPP intermediary layer library?
ОтветитьLove your videos, thanks to this one I hadn't stop talking with friends about about how C# can now run naively without the CLR and JIT.
They all respond with "then you don't know what's a managed language" until I pull this video.
I think it's a game changer
Haven't they been announcing AOT for Blazor/ WASM too? I tried it once, it took very long to compile… and finally didn't work.
ОтветитьVery interesting. Comming from Commodore 64, Amiga, all native machinecode and then forward through C/C++, then now... C# and... Docker... and now we can get back to natively compiled code... I still love .NET for its scalability, but cool to know we can also bake and compile our code
ОтветитьHey man, how about write the exact same thing in C/C++ or Delphi and compare perf and memory footprint?
Because it's norm for me to pick a native code language when anything with client-side high performance is concerned.
Without supporting reflection.emit, does that mean EF lazy loading is out?
ОтветитьPrevious self-contained compilation was the NGEN?
ОтветитьMe when I read about generating native c# code : unity burst compiler
Ответитьvery interesting. i've always liked C#, having to carry around so much baggage (and expect target machines to have certain files installed) with every app had me go to another language. this will convince me to take another look at C# in the coming months.
ОтветитьThis is great! Now what we need is a lightweight web server and framework that doesn't rely on reflection. I'm not a fan of ASP, so I would have wanted that either way - but maybe now there's a more compelling reason to do it? 😄
ОтветитьI tried AoT native compilation pre-Net 5 (iirc) and it was nice but wouldn't reliably work. Looks like it's still in much the same place but at least it's getting officially included in the runtime which is something. Definitely something to think about if you're running in containers.
ОтветитьCan you talk about the hybrid mode? As far as I understand there is an AOT mode where dynamically loaded code is supported, however it actually runs using an interpreter (the eval is running off of IL directly). I'm really curious about the internals and details of that approach.
ОтветитьI wonder if this could be used on a Raspberry Pi - the small footprint
ОтветитьOuch, that platform-specific headache... Not again :)
ОтветитьOr Swift, which I created a whole shipping iOS app in but had to turn away from to go multiplatform.
ОтветитьWhat is more interesting in and of itself is the build time. Trying the same stunt in GraalVM it takes ages and stresses the compile machine to its limits just to take a lot more time to simply compile a damn java application to a native image, which makes the whole DX simply disgusting.
ОтветитьAOT is great! Thanks Nick for sharing. It finally solves self-contained exe's hugh size (with runtime packaged in it).
ОтветитьWe need winforms support.
ОтветитьC# native will still have more safeguards to prevent any dangerous errors, it's still garbage collected and it's still primarily heap based. This makes C# a delight to program in, but it also limits how much you can optimize your code on the low level. On the other hand, C# has automatic memory pools which makes heap allocations faster in C# than, for example C++. C++ is propably faster overall but it's not usually that much faster unless you think about the performance. Though C++ allows for more deeper optimizations which makes it run circles around C#, in those cases however you'll be writing much more custom code and thinking about CPU cache lines.
So far my experiences are... C# is easy and fast to use. C++ anywhere from medium easy to absolute nightmare depending what you're doing and how much you care about performance. C++ doesn't really have a centralized ecosystem of libraries so you may end up spending a lot of time finding the stuff you need or programming it yourself. It's really about a tradeoff between how much time you're willing to spend programming to make the application spend less time executing.
I usually prefer C++ as I find it more interesting and closer to the metal, but I also like the relative simplicity of C#. I haven't used Go, or Rust yet but I can definitely see the appeal.
Compile C#? Isn’t that just the Beef programming language?
Ответитьno winforms support unfortunately
ОтветитьHey Nick, can you make a video on the purpose of .pdb files and how to use them, please?
Ответить