4 ms·
> And when I want Julia’s promise of fast loops, I use Numba. This only works (easily) as long as you don't have user-defined types > If all the effort gone i
by chappi42 8y ago
> And when I want Julia’s promise of fast loops, I use Numba.
This only works (easily) as long as you don't have user-defined types
> If all the effort gone into Julia had instead been spent on fixing remaining warts in Python workflow for science, we wouldn’t even havee this conversation.
Python is too dynamic, you cannot just fix remaining warts. From Julia documentation I know that Julia language has been designed for speed and e.g. some dynamic possibilities have been omitted in order to be able to generate fast code. For a general idea about Julia speed see e.g. this 7 hours old excellent Juliacon video: https://www.youtube.com/watch?v=XWIZ_dCO6X8 https://www.youtube.com/watch?v=XWIZ_dCO6X8
Python certainly works. But already for syntax alone, if you have written Julia, it's hard to - in my case - go back to R.
- marmaduke 8y agoNumba has user defined types, https://numba.pydata.org/numba-doc/dev/user/jitclass.html https://numba.pydata.org/numba-doc/dev/user/jitclass.html No one intends to fix Python but it’s straightforward to do things like Numba: use a decorator to read out the AST for a function, reimplement it however you like and pass back the compiled function, and document the semantics.
- chappi42 8y agothank you
- ChrisRackauckas 8y agoBut you have to define the types for them to work. That's exactly the problem and that's what Julia has already solved.
- marmaduke 8y agoWhat are user defined types that don’t require being defined?
- ChrisRackauckas 8y agoGeneric functions in Julia can use types which have no reference to their definition using dependent compilation. http://www.stochasticlifestyle.com/why-numba-and-cython-are-not-substitutes-for-julia/ http://www.stochasticlifestyle.com/why-numba-and-cython-are-... So you can work with types even when you've never seen their definition given how the compilation will occur with all of the pieces together instead of separately.
- marmaduke 8y agoI usually profit from type definitions during debugging and memory layout work, so perhaps i don’t see this is a feature.
- ChrisRackauckas 8y agoIt's probably us that are using types in a weird way so it's my lack of explanation that's the issue. Types in Julia undergo multiple dispatch, so by passing a type into a generic function you can make the same generic algorithm run in different ways. So I use types to parallelize my code, calculate derivatives, propagate parameter uncertainties, and things like that. This talk from JuliaCon discusses a lot of the things for free that were developed by taking a type from one package and putting it into another: https://www.youtube.com/watch?v=dmWQtI3DFFo https://www.youtube.com/watch?v=dmWQtI3DFFo