News for hackers. Stuff that matters.
Re:Type Stability in Julia: Avoiding Performance Pathologies... by ulysses4ever on Wednesday December 08, 2021 @04:05PM (#29490490)
Author here. AMA!
Re:Type Stability in Julia: Avoiding Performance Pathologies... by StefanKarpinski on Wednesday December 08, 2021 @04:40PM (#29490876)
I'm still working through the paper—reading your group's Julia papers is always a great treat—thank you for this one and all of them. Looking at the definition of "type groundedness" it seemed to me that perhaps the definition should require that "every expression’s type depends only on the argument types" rather than only variables. I haven't gotten to the proof parts, but this was just a thing that struck me early on.
Re:Type Stability in Julia: Avoiding Performance Pathologies... by ulysses4ever on Wednesday December 08, 2021 @04:52PM (#29491018)
Your intuition is right but _every_ expression is bound by a variable in this representation.
Re:Type Stability in Julia: Avoiding Performance Pathologies... by StefanKarpinski on Wednesday December 08, 2021 @04:56PM (#29491064)
Ah, ok. I hadn't gotten to that part yet. Would it make sense to change the general definition to "expressions" since that would be the correct definition for Julia code as well as the Jules IR format?
Re:Type Stability in Julia: Avoiding Performance Pathologies... by ulysses4ever on Wednesday December 08, 2021 @05:08PM (#29491196)
This may require more thinking on our end but the way we design Jules is the usual SSA form. The idea being it's easier to reason about it (and prove things) when every expression has a name. It's a bit of cheating of course but makes our life easier. We don't discuss how surface Julia (or subset of it), which is more expression-oriented, can be translated to Jules, because we have only so many pages, and also it's not all that interesting, I think.
Re:Type Stability in Julia: Avoiding Performance Pathologies... by one-punch on Wednesday December 08, 2021 @07:55PM (#29492577)
(disclosure: not a PL person, so my question could be really dumb.)

> Informally, a function is type stable if the type of the output depends only on the types of the inputs, not their values.

This line reminds me of (the opposite of) dependent-type. But I think that intuition may not be useful or relevant for understanding here?

Re:Type Stability in Julia: Avoiding Performance Pathologies... by ulysses4ever on Thursday December 09, 2021 @11:32PM (#29506417)
It does have similar formulation but the setting is completely different. Types in Julia are not the same thing as types in statically typed languages with dependent types. In those languages you can elegantly declare the connection between inputs and outputs, and moreover the connection will be checked. In Julia type stability is a property of a code that Julia compiler will discover on its own during runtime. The programmer can't declare it nor have it checked.
Re:Type Stability in Julia: Avoiding Performance Pathologies... by Sukera on Wednesday December 08, 2021 @04:31PM (#29490793)
Hi, thank you! The paper mentions that the dynamic analysis code is written in julia and could be used by package developers to study instabilities in their code, but I couldn't find a link to the code in the references. Did I just miss it or is it contained in the zip containing the visualization data?

--

EDIT: Nevermind, found it in the zip!

Re:Type Stability in Julia: Avoiding Performance Pathologies... by ulysses4ever on Wednesday December 08, 2021 @04:36PM (#29490837)
I think the link's supposed to be in the text but the repo is here: https://github.com/prl-julia/julia-type-stability There's a PDF there explaining how to get started with it and repro the graphs but it shouldn't be too hard to utilize it for the purpose you mention. We never got around to writing that kind of docs (for package developers) properly unfortunately. Feel free to open issues against the repo if you have troubles using it!
Re:Type Stability in Julia: Avoiding Performance Pathologies... by Sukera on Wednesday December 08, 2021 @04:47PM (#29490963)
Ah, that link doeesn't seem to be in the paper (at least my searching for `github` didn't turn up anything), thank you! I did however find the same code as part of the visualization, so I got what I was looking for.
Re:Type Stability in Julia: Avoiding Performance Pathologies... by ulysses4ever on Wednesday December 08, 2021 @05:21PM (#29491320)
That's my bad then. I think I might have thought Zenodo link would be enough. But now I think it's a bad idea. Probably will add the GH link in an update.
Re:Type Stability in Julia: Avoiding Performance Pathologies... by dklend122 on Wednesday December 08, 2021 @05:09PM (#29491205)
Hi, cool paper! semi related questions:

What do you think of JET.jl?

Tension between Method ambiguities and desire for traits or multiple inheritance is something discussed in the community. Has your group given any thought to this?

Thanks !

Re:Type Stability in Julia: Avoiding Performance Pathologies... by ulysses4ever on Wednesday December 08, 2021 @05:20PM (#29491305)
Hey! we're tracking JET.jl and think that it's great already and may become even better. We hope to base some of our future stuf off it. Some of us (not me) actually work on a trait design. Multiple inheritance -- not so much: we think it would preclude some important optimizations and that way defeat the whole purpose of Julia (performance + dynamism).
Re:Type Stability in Julia: Avoiding Performance Pathologies... by dklend122 on Wednesday December 08, 2021 @07:27PM (#29492420)
Cool! Looking forward to seeing some of the trait work