Hacker News .hnnew | past | comments | ask | show | jobs | submit | mwkaufma's commentslogin

TL;DR compile with a fork of LLVM that enables runtime IR tracing. Very clever!

That's not what they're doing. They're directly modifying the IR to convert it into a tracing JIT. The final artifact is a binary w/ no IR. The problem is of course not introducing any subtle bugs in the process b/c they'd have to prove the modification they're making do not change actual runtime semantics for the final binary artifact.

Never before have people been able to effortlessly visualize whole landing pages to tell them to put glue on pizza.

From the generated descriptions of the sample images, it looks like their prompt is asking for a vaguely center-right gloss on demographics? Is that the agenda of the site operators, or an appeal to presumed paranoid libertarian site visitor?

Tell us more about this buggy "new internal service" that's scraping batch data :P

Looks like it's "just" type-erasure / syntactical sugar. E.g. value types are boxed.

Right, the default boxes into heap, but unions are different. Some languages pack them as a flat struct (tag + payload, no allocation).

Here is visual layout if anyone is interested - https://vectree.io/c/memory-layout-tagging-and-payload-overl...


That is not what C# has just added to the language though. These union types so far are just wrappers over an `object` field which gets downcasted.

F# offers actual field sharing for value-type (struct) unions by explicitly sharing field names across cases, which is as far as you can push it on the CLR without extra runtime support.


Yes, but see the section on custom unions* - you can write non-boxing unions/generators.

* https://devblogs.microsoft.com/dotnet/csharp-15-union-types/...


Yes, there's a compat-shim in the stdlib/runtime, but not in the language syntax. E.g. it by-definition won't do escape-analysis and optimize discriminated value-types with the first-class keyword.

For now

Yes, but that's just the default behavior. You can implement your own non-boxing version for performance critical applications.

Why on earth did they decide boxing by default was a sensible design decision...

We have been pushing toward higher performance for years and this is a performance pitfall for unions would are often thought of as being lighter weight than inheritance hierarchies.

F# just stores a field-per-case, with the optimization that cases with the same type are unified which is still type safe.


Hi there! One of the C# language designers here, working on unions. All the different options have tradeoffs. As an example, the non-boxing options tear, which can be problematic. And, we have a lot of experience implementing the simple, reference-type, approach for types that make a lot of sense to people, but then adding a lightweight, value-type version for people who care about that later. See tuples, as well as records.

I expect the same will old here. But given the former group is multiple orders of magnitude higher than the latter, we tend to design the language in that order accordingly.

Trust me, we're very intersted in the low-overhead space as well. But it will be for more advanced users that can accept the tradeoffs involved.

And, in the meantime, we're designing it in C#15 that you can always roll the perfect implementation for your use case, and still be thought of as a union from teh language.


From what I've read, this is for the first implementation of unions, to reduce amount of compiler work they need to do. They have designed them in a way they can implement enhancements like this in the future. Things like non-boxing unions and tagged unions / enhanced enums are still being considered, just not for this version.

This is the general pattern of how the C# team operates, IME.

    "Never let perfect be the enemy of good"
Very much what I've seen from them over the years as they iterate and improve features and propagate it through the platform. AOT as an example; they ship the feature first and then incrementally move first party packages over to support it. Runtime `async` is another example.

In the meantime I still haven't done any project with nullable references, because the ecosystem has yet to move along. Same applies to ValueTask for async code.

Which part of the ecosystem is blocking your projects from using nullable references? I find them very helpful, but the projects were all newer or migrated to new SDK.

What all projects?

It is relatively easy to find corporate libraries, or commercial products that still aren't using it, including Microsoft products still stuck in .NET Framework, or .NET standard 2.0.

If you want name shaming of commercial products with modern .NET, here is one, can provide more.

https://github.com/episerver/content-templates


You can use dependencies that aren't using nullable reference types in projects that use it. You can enable/disable nullable reference types per file, as it only influences static analysis. There's no runtime difference between a non-nullable reference type and a nullable reference type.

> with the optimization that cases with the same type are unified which is still type safe.

To be clear, this requires explicitly using the same field name as well.


Alternate title: iTunes charts still easy to game.

TIL 6+1 is not seven.

As the comment count in this thread increases, the ratio responding to the headline alone, and nothing in the article, is approaching 1.0.

"shortuct"


Apple had the same typo at WWDC 2018: https://devdude.me/blimg/wwdc18Keynote/shortcutsApp.png


Like Cixin Liu's "Dark Forest" which inspired the author, this is science fiction.

LLMs do not have and cannot obtain the capabilities the author is hand-wringing about, and the current much-hyped apparent-productivity will pop with the bubble & corps have to start paying full-price for chatbot access.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: