Live data from Hacker News

.NET 10 Preview 6 brings JIT improvements, one-shot tool execution

infoworld.com

151–160 of 231 posts

Re: .NET 10 Preview 6 brings JIT improvements, one-shot tool execution

#151
post #14

.NET was the most sane programming ecosystem that I worked in. Great CLI, great package manager, very good stdlib, strong IDEs/Debuggers, etc. but sadly interesting jobs like OSes, databases and compilers are way less common than in C++ world :(

On my little enterprise bubble, the only place remaining for C and C++ is writing native libraries to be consumed by managed languages, or bindings. The last time I wrote pure C++ applications at work, was in 2005. Libraries still regularly.

Sometimes I feel like there ought to be a Hacker News like forum for us dinosaurs stuck in the Enterprise tarpit. Instead of talking about Elixir and AWS startup credits, we’d complain about the weather and legacy CORBA components.

Re: .NET 10 Preview 6 brings JIT improvements, one-shot tool execution

#152
post #53

Earlier quoted context omitted.

Is upgrading every 3 years really that bad? As far as I know, they typically aren’t removing features or causing disruptive changes in .NET versions. They did when switching away from .NET Framework, but this was because they had to reimplement many features from scratch to work on other platforms, and certain parts got left behind.

.NET LTS is on a 2-year cycle, isn't it? I've worked in .NET shops with very niche WPF/WinForms applications where customers were years behind with our software/major .NET Framework releases. I don't think it's a technical challenge, more a cultural one.

You are right that it’s on a 2 year cycle. Though there is support for 3 years, so you could safely put off an upgrade for up to a year if there are breaking changes one release.

Re: .NET 10 Preview 6 brings JIT improvements, one-shot tool execution

#153

Earlier quoted context omitted.

The issue was in the beginning they didn’t think interop with C/C++ was value add. People complained and they added “Managed C++” which unfortunately influenced C++03’s design a lot. It wasn’t until C++11 that Microsoft gave up. You couldn’t effectively interop with C++ without writing a managed C++ wrapper, which only worked on windows. They added support for P/Invoke to aid in Win32 calls (shell.dll, user32.dll) as…

Interestingly, the Rust windows crate is generated from an MSIL assembly. And same metadata might be used to generate C# bindings thanks to cswin32 [1] project. The meta-assembly generation (Win32 metadata project) is based on clangsharp and it's fairly straightforward to generate interop code for native Windows libraries. Some time ago I described this process on my blog for the detours library [2] [1] https://githu…

Yes, and this approach is an extension of the one taken with WinRT metadata which is also ".NET assembly" based.

Re: .NET 10 Preview 6 brings JIT improvements, one-shot tool execution

#154

Earlier quoted context omitted.

> .NET nowadays has a serious adoption problem It's seriously going to make people question the future of the platform. Look at Microsoft's actions, not their words. TS Compiler: Go New TUI Editor: Rust Winget: C++ (this would have been a great candidate for .NET) At least PowerToys is C#. .NET is great, but why isn't it good enough for Microsoft? The company that historically has had such a strong culture of dogfood…

Windows and Office never adopted .NET for client code in the first place except for the Longhorn period in the mid-00s, which burned them and put them off it. If that didn't stop .NET in the two decades between then and now, I'm not sure why it would today. Actually, Windows is just now starting to adopt C# now that AOT is supported (I think the new native Copilot app is C#).

Many Windows Server admin tools (such as Server Manager or Virtual Machine Connection) and MMC snap-ins (e.g. Event Viewer, Hyper-V Manager) are written in .NET Framework 4. PowerShell is .NET Framework 4. Everyone’s favorite bloated IDE (Visual Studio) is .NET Framework 4 as well.

In the Office land, Excel’s Power Query is .NET Framework 4.

Adopting the modern .NET is probably harder due to its lifecycle.

Re: .NET 10 Preview 6 brings JIT improvements, one-shot tool execution

#155

I haven't used C#/.NET since .NET 4 - I remember it was great, yet heavily tied into Visual Studio, and forget about using CLI for things like most other languages. It was all GUI or nothing. Insurmountable XML files. How are things these days with .NET 10! Jesus, 10! Dudes who use it daily, what is your favorite feature you think?

.NET 4 doesn't exist and was avoided on purpose. There was a .NET Framework 4, but after Framework was abandonned in favour of Core they dropped the core suffix and skipped to 5.

Re: .NET 10 Preview 6 brings JIT improvements, one-shot tool execution

#156
post #32

My favorite .NET 10 feature so far is not within the .NET library itself, but `dotnet tool exec` to run C# files as scripts without a build step. This has been available in F# for a long time via `dotnet fsi`, and for C# also via the third party cs-script tool. It took a surprisingly long time to officially reach the primary .NET language! I only really wish C# would’ve been directly integrated as an alternative scri…

I've wanted this for a long time. After reading this link, and the MS release announcement, I still don't understand what a "tool" is, or how you can use `tool exec` to run a single *.cs file. Is there a straight-forward recipe anywhere for doing this targeted at absolute simpletons?

The docs are terrible right now (prerelease and all that), but to get started:

1. Install the dotnet sdk preview

2. Make a .CS file with top level statements.

3. dotnet run

https://devblogs.microsoft.com/dotnet/announcing-dotnet-run-...

Re: .NET 10 Preview 6 brings JIT improvements, one-shot tool execution

#157

Earlier quoted context omitted.

Well if you're familiar with the node ecosystem it's a corollary for npx/bunx/etc. It is so that folks can build and run "tools" that are executed, utilizing the nuget ecosystem. Relevant links in the dotnet docs (was just a quick google away): * https://learn.microsoft.com/en-us/dotnet/core/tools/global-t... * https://learn.microsoft.com/en-us/dotnet/core/tools/global-t... It's actually a top-level doc section in th…

Sorry for being unclear. Using tools isn't my goal. I want to run a single *.cs file from the console. It may be possible to achieve this using tools, but I don't know how. I did read the resources I could find, and didn't find any information about this.

Ah rereading your original comment that makes sense.

I found the announcement page here: https://devblogs.microsoft.com/dotnet/announcing-dotnet-run-...

And here are the docs for “dotnet run” https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-r...

You’re right that it’s missing this new functionality. The blog post has some details to get started, but I’m guessing that a docs link or section is missing for that.

Dotnet covers quite a bit so the docs are accordingly larger than other projects that have a smaller scope. I will say though that while hit or miss, on average I’ve enjoyed their docs more than the average project.

Re: .NET 10 Preview 6 brings JIT improvements, one-shot tool execution

#158
post #72

Earlier quoted context omitted.

F# has been a third class citizen for a long time... Last I heard the entire f# team was ~10 people. Pretty sure "find references" still doesn't work across c# and f# (if you call a c# method from f# or vise versa). That also means symbol renames don't work correctly.

I agree, but somewhat paradoxically, F#’s lack of new features kind of becomes a feature. Have you seen the number of C# features added in the last 5-10 years? It’s crazy

Half-baked adhoc features which didn't bring the language closer to Scala.

Still no HKTs and typeclasses, call-site expansion can only be simulated with partials and text-level code generation, etc, etc.

Re: .NET 10 Preview 6 brings JIT improvements, one-shot tool execution

#159
post #105

Earlier quoted context omitted.

dotnet run *.cs is my favorite new feature for scripting. It has basically replaced powershell for me. It's trivial to script powerful operations now.

I guess LinqPad will lose some users to this feature.

This isn't LinqPad's selling point. All that dotnet run *.cs has done is remove the need to have a project file for each "script" you write.

LinqPad maybe has this feature but it's selling point is as a scratch pad to experiment with working with data and general futzing around.

Re: .NET 10 Preview 6 brings JIT improvements, one-shot tool execution

#160

Earlier quoted context omitted.

Blazor static server side + HTMX is probably the only way to make a cost efficient and performant version of Blazor suitable for public websites. WASM is way too big and slow, Websockets take up server resources and cause problems with timeouts where the user has to refresh their screen losing all state.

What would be the benefit over Razor pages tho ? Component model ? Feels like partial views and razor templates might not be the cleanest/dry-est solution but would make the implementation super straightforawd.

Yeah there is basically no real difference between MVC or RazorPages or BlazorStaticServer pick your poison depending on your preference. Personally I wish the .NET team would just add components to MVC and RazorPages then we can forget about Blazor.
Post reply on HN