Shape and Material - Refined type inference

That seems a pretty logical way, to improve type inference, type stability and code clearity in the compiler.

Ross Tate presents a new class of type algorithm, that seems to solve some of the issues that the Julia compiler has (especially around inference and type stability)

Does @jeff.bezanson already know about this?

The embed Youtube link starts at the fundamental concept, you can go back to the start to see their incentive to implement it.

The actual algorithm is described at 15:33

1 Like

Please consider summarizing and explaining what “this” is before proposing it, especially before pinging people. Not everyone has time for a 50 minute video.

4 Likes

I updated the link, to skip the section where he describes the problem that he is trying to solve.

I also thought well about it before tagging, as I consider it to be a major breakthrough in compiler design, and I am sure the responsible people are interested in it.

A summary is still useful even with a link to the section.

1 Like

Just curios when he was talking about categories of types and their unions. Isn’t the same thing already been part of Julia with abstract type hierarchy and absence of multiple inheritance? Or there is more to it…

Looks to be an interesting talk though!

1 Like

Watched a big chunk of the video. It’s mildly interesting, but does not appear to be applicable or useful in julia.

The thing he expresses as the problem he wants to solve doesn’t really exist in julia since we don’t have operator overloading, but instead have real dynamic dispatch, so it doesn’t actually matter for the semantics of the program in his example if x got inferred to Comparable{*} or to Any. Same thing for the thing he calls “overprecise initialization”, that’s just a non-problem in a language like julia.

Furthermore, our traits aren’t supertypes, so you wouldn’t even end up in the situation in the first place where x gets inferred to be an instance of Comparable{*}.

I guess in some sense, the way we handle traits is already an instance of this separation he’s discussing.

The “conservativity checking” he discusses is interesting, but I’m also rather skeptical if that can work for us since in almost all circumstances, you need to know concrete types to know what any given function will do.

His stuff about categorized unions isn’t applicable because we already have real unions.

3 Likes

Yeah, the problems arent the same. I understood, that some of the solutions can still be applicable.

As an example:

And real unions are not decidable, and we want decidable stuff, since it reduces compile time.

FTR the author of the talk (Ross Tate) is a coauthor on some of the papers on Julia.

Anyway, I don’t think any of this is interesting in the context of Julia.

2 Likes

What does FTR stand for?

“For the record”

1 Like