11 ms·
Announcing .NET Core 2.1
- parvenu74 8y agoI wonder if it was on purpose or accident that the LTS release of .NET Core coincides with the LTS release of Ubuntu...
- neilsimp1 8y agoWhat do the two have to do with each other? I'd say it's a coincidence, I don't think MS is trying to steal Canonical's thunder or anything.
- runfaster2000 8y agoNo relationship to the 18.04 LTS, but we were following that release closely. We started testing on 18.04 at the start of the year, and offering Docker images for it at around the same time. We're also watching the Alpine 3.8 release closely.
- parvenu74 8y agoAny chance .NET Core is going to be supported on FreeBSD/NetBSD/OpenBSD in the near future?
- tybit 8y agoAs part of Google Summer of Code a participant is looking at porting .net core to FreeBSD https://github.com/dotnet/coreclr/issues/18067 https://github.com/dotnet/coreclr/issues/18067
- oaiey 8y agoFreeBSD was the first community port, but vanished again. Seem like lack of size of the community interst there.
- runevault 8y agoAnxious to finally play with this, been wanting the full library/stack update for span<t>/memory<t> to get a feel for actually using them to optimize code.
- algorithmsRcool 8y agoI've been moving some libraries over from T[] to Memory<T> and Span<T>. I've found it's a little tricky to get used to calling Slice() all the time. But it opens up so many doors for allocation reduction and perf improvement. Also, it is so nice to not have to pass (array, offset, length) around everywhere
- algorithmsRcool 8y agoThis is a landmark release for .NET. The most important since at least framework 4.0 maybe even 3.0. We are getting: - Span<T>/Memory<T> : A 0-copy, unified way of accessing Managed or Unmanaged memory. - Channel<T> : High performance thread-safe queues (like go channels) - Pipelines : an async, 0-copy version of Stream - In-box support for Array/Buffer pooling (finally!) (MemoryPool, ArrayPool) - Better primitives for pointer manipulation and memory marshaling. (MemoryMarshal) - New primitives for high performance parsers and formatters (System.Buffers.Binary and System.Buffers.Text) - Improved support for SSE/NEON via Vector<T> - Microsoft.Windows.Compatibility : Windows specific APIs on .NET Core (Registry, EventLog, NamedPipes...) - Tiered Compilation - Faster tooling - Wider Platform support If you write code on .NET, you should [Edit] evaluate this release with to see if it fits your business needs [/Edit] Doubly so if you care about runtime performance.
- quickthrower2 8y agoWhere can I find out more about Channel<T>? I've been googling but it's hard to find anything (especially as Channel 9, and old WCF channels comes up a lot in the results).
- ihsw2 8y agoThe closest analogue is probably `ConcurrentQueue<T>`. https://msdn.microsoft.com/en-us/library/dd267265(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/dd267265(v=vs.110)....
- 8y ago
- hnrodey 8y agoAny idea about required VS versions? The announcement makes no mention of Visual Studio (or maybe I missed it?) but the download pages says it requires a preview version of VS2017 which is unfortunate.
- algorithmsRcool 8y agoSo the .NET Core SDK and command line tools do not require VS at all. VSCode works fine or whatever editor you like that supports omnisharp. But if you are using VS you will need to update to 15.7 to take advantage of some of the features/
- vonseel 8y agoWhat is the best setup for coding .NET core on Mac? Rider? Asking because you seem to know what you’re talking about.
- lostmsu 8y agoRider presumably is better than VSCode if you do a lot of refactoring. If not, it's an overkill, and VSCode or slightly heavier Visual Studio for Mac are your best options.
- vizzier 8y agoMicrosoft's Docs for getting started are pretty great: https://www.microsoft.com/net/learn/get-started/macos https://www.microsoft.com/net/learn/get-started/macos On mac they appear to be recommending visual studio code with the c# extension. I'd agree that that makes for a decent experience. Alternatively: Rider: https://www.jetbrains.com/rider/ https://www.jetbrains.com/rider/ VS for Mac: https://www.visualstudio.com/vs/mac/ https://www.visualstudio.com/vs/mac/
- algorithmsRcool 8y agoI'm flattered, but unfortunately I'm not a mac person. VSCode and Rider are the two standouts. I love VSCode on windows and Linux, but I have heard nothing but good things about Rider.
- nlawalker 8y agoHumble request: can anyone explain whether or not Span<T> is interesting if you mostly work with application code (as opposed to, say, low-level or framework code) and never work with unmanaged/native code, and why? From my perspective, it seems like something that'll be used in the guts of ASP.NET and the rest of the base class library that will benefit the performance of my code, but I'd never really use it directly.
- runfaster2000 8y agoCorrect. Most developers will not deal with it much directly, particularly not in the way that it is used in the "guts" of the product.
- yread 8y agoIt can help prevent allocations if you work with large arrays or strings
- benaadams 8y agoIf you take substrings of strings; using string.AsSpan() then allows you to work it as a Span<T> and take windows of the string without allocating an new string for the substrings. Also it means you can now pass readonly arrays (the elements) to things using ReadOnlySpan<T>; so don't have to do defensive copies
- algorithmsRcool 8y agoIf you are at the application level then you can use whatever, but Span<T> is pretty handy. If you are calling an method that has both Span and Array overloads, prefer the Span version since it is less likely to copy or allocate. The real selling point is that Span is much more flexible than an Array. Both Managed and Unmanged memory can work with it. If you load a big string and need to get each line from it, you can slice into the middle of the string safely and get a ReadOnlySpan<char> that supports most 'string' operations without allocating any memory. Or imagine you need to process some huge file, typically you would read it chunk by chunk copying the data from the Stream into some byte[]. But with Span you could open a Memory Mapped File and work on segments of the file without copying into temp buffers. You gain a lot by avoiding memory copies and by allocating fewer objects (less work for the GC). For some workloads then can be a huge speedup.
- yread 8y agoAnybody knows how much improvement can you expect from tiered compilation? And are there any drawbacks - is it stable?
- algorithmsRcool 8y agoRight now I wouldn't expect much. I did some very very rudimentary benchmarks and saw a slight drop in perf using Tiered Compilation. But now that it exists we can expect regular improvements with every point release.
- runfaster2000 8y agoIt depends on your app. We've seen massive improvements for webservers and long-running apps. Short-lived apps don't benefit. We'll be posting more on it soon. Give it a try!
- algorithmsRcool 8y agoThis guy works on dotnet his answer is much better than mine.
- yread 8y agoMy app is a asp web app that spends most of its cycles in ef core code and unmanaged. Would be nice to read more about it especially how to measure performance benefits
- zamalek 8y agoDoes it ever optimize more aggressively than previously? i.e. would we see, as a bad but relatable example, more functions inlined?
- scott00 8y agoOne benefit caught my eye, but was not explained: "Much easier to manage platform dependencies in project files and with self-contained application publishing." Anybody know anything about this? I frequently deal with applications that have platform specific components, and it's a real pain. Sometimes the platform specific code is a platform-specific native dll that gets called from the same P/Invoke wrapper, sometimes it's two different managed implementations of the same interface, sometimes it's both. It'd be great if this sort of thing got easier to do.
- runfaster2000 8y agoSorry! Poor wording on my part. I updated the wording to: "Much easier to manage .NET Core and ASP.NET Core versions in project files and with self-contained application publishing." The thing that you are talking about still needs to be improved. Sadly, that didn't happen in this release.
- MarkSweep 8y agoThis does not mention my favorite new feature: BindingFlags.DoNotWrapExceptions. It lets you prevent exceptions from being wrapped in TargetInvocationException when invoking methods using reflection. I wrote about this feature here if anyone is interested: http://www.awise.us/2018/04/25/do-no-wrap-exceptions.html http://www.awise.us/2018/04/25/do-no-wrap-exceptions.html
- CodeCube 8y agowow, this is huge for some use cases!
- alexeiz 8y agoIs there any data on the size of the .NET Core user base? It was my impression that .NET Core was unsuitable for production deployments so far. Also, .NET Core is primarily targeted at Linux users, right? Why would you even consider using .NET Core on Windows when you can utilize a fully featured .NET Framework?
- runfaster2000 8y agoFew points: - Deployments: https://www.microsoft.com/net/customers https://www.microsoft.com/net/customers - Monthly engaged developers is >500k for NET Core. - >50% of developers are on Windows.
- sjellis 8y agoNote that some of the pull quotes on that site don't specify .NET Core, and probably predate it (e.g. the Stack Overflow story dates back to 2014, and refers to Framework). We know that .NET Core is generally liked by Microsoft developers (with good reason), but I have no idea what corporate adoption is like, and would love to see indicators that people are actually migrating production systems. The existance of Core makes Framework that bit more annoying to deal with, and it would be nice to see that things are moving.
- oaiey 8y agoStackoverflow team contributes to .NET Core itself since pre 1.0 dates. It is a pretty safe bet that they use it in production. Corporate adoption is very good afaik. For .NET developers, .NET Core is a lot of fresh air and also a long overdue defence against Node. They want to continue to work with C# :)
- pjmlp 8y ago> For .NET developers, .NET Core is a lot of fresh air and also a long overdue defence against Node. Really?! US .NET developers or what? I never worried about Node ever, with so many nice languages in .NET and Java worlds to chose from.
- shock 8y agoI'm most excited about the added SourceLink support. This will allow us to see and navigate library sources right in the IDE and also allow us to step through library code when debugging.
- ryanmarsh 8y agoWhat is the difference between Core and Framework?
- UK-Al05 8y agoBiggest difference is core is cross platform.
- dustinchilson 8y agoCore is a portable re-implementation of the Framework https://docs.microsoft.com/en-us/dotnet/standard/choosing-core-framework-server https://docs.microsoft.com/en-us/dotnet/standard/choosing-co...
- ksec 8y agoSo basically a renamed Mono?
- teyc 8y agoNo. I believe it's a fork of the Silverlight runtime, used to be a tiny 2MB runtime to compete with Flash on the browser.
- orionblastar 8y agoMicrosoft open sourced Dotnet to have others port it to different platforms and fork the code not rename it. Big difference between just renaming something and forking it under a different name. The license allows it to be forked.
- oaiey 8y agoIt is the runtime from the Silverlight Project, which evolved over the years for their Windows Phone and later UWP platforms. .NET Core is a very old platform already. It shares the jitter and the garbage collector with the full framework. It is actually the opposite of your statement. Mono is massively adopting .NET Core source code but without loosing their own benefits (portability and factoring).
- yummybear 8y agoDoes anyone else experience high CPU on mac when running dotnet run?
- snake_plissken 8y agoWhere is the source for this or is it not up yet? Jones'n to dive into Channel<T> to see what's going on in there.
- halter73 8y agoFor Channel<T>, you can take a look at https://github.com/dotnet/corefx/tree/v2.1.0/src/System.Threading.Channels/src/System/Threading/Channels https://github.com/dotnet/corefx/tree/v2.1.0/src/System.Thre...
- kgwxd 8y agoJust a reminder, telemetry is opt-out: https://news.ycombinator.com/item?id=17177241 https://news.ycombinator.com/item?id=17177241 Be sure to check your environment variables are set properly. Also, be sure to check that they haven't added additional opt-out settings, or remove the ability to opt-out all together. If you haven't opted-out on purpose, be sure you're still OK with what they're collecting.
- ksec 8y agoAnd I just realise, .Net Core is MIT licensed..... that is far too good to be true right? Given the immense engineering hours went into CoreCLR, why aren't more languages built on top of .NET runtime?
- algorithmsRcool 8y agoThere are scattered few. Leppie has maintained IronScheme for years now and the good folks as Peachpie have PHP running on CoreClr(via Roslyn even!)
- oaiey 8y agoWhy more if you have good oo, procedurel and functional contenders :). C# and F# are top contenders in their areas. Language alternatives show up by need (not given here) or specialization (niche you never heard of).