![]() ![]() Create restricted computation domains (eg numpy API, pandas API, tensorflow API)Ģ. This is why you have such a spectrum in Python.ġ. And if, like in Cython, the process of “rewriting” the algorithm is essentially instantaneous, easy, pleasant to work with, then the cost is even lower. This maximally avoids premature abstraction and premature extensibility. > “you should rewrite your algorithm in a lower level layer just to support complex numbers.” But Julia hasn’t given me the choice of this little piece that does benefit from it vs that little piece that, by virtue of being built on top of the same differentiability, is just bloat or premature optimization. Sometimes I’m way better off if not everything up the entire language stack is differentiable and carries baggage with it needed for that underlying architecture. One of my biggest complaints with Julia is that zealots for the language insist these permeating abstractions are costless, but they totally aren’t. It helps precisely so you don’t pay premature abstraction costs to over-generalize the performance patterns. > “But having a performance boundary between components, why would that help?” Will this really lead to a better design? So you should implement support for callback Z in a different layer but not for callback X,Y, and you should rewrite your algorithm in a lower level layer just to support complex numbers. Or: You can provide X,Y as callback function to our component, it will be blessed and fast, but providing your custom function Z it will be slow. This algorithm will be fast with floats but will be slow with complex numbers. )īut having a performance boundary between components, why would that help?Į.g. ![]() E.g I accept the argument that Haskell immutability often leads to good design, I also believe the same true for Rust ownership rules (it often forces a design where components have a well defined responsibility: this component only manages resource X starting from. I'am fully on the side that limitations may increase design quality. ![]() > Using extension modules is just a time-tested, highly organized, modular, robust design pattern. This goes beyond just multiple dispatch as well-imagine if tidyverse/non-tidyverse wasn't such a hard split. There's a reason MRAN, Conda and JuliaBinaryWrappers exist after all.įor whatever reason, Julia package maintainers also seem more receptive to making their work compatible with other libraries as well. Anecdotally, I've had a lot of issues with compiled dependencies and missing/out of date external assets on less well-trodden packages. > A real strength of R (in comparison not just to Julia but also to python) is that such a repository existsĬRAN is certainly a cut above many other package repos here, but I'm not sure "trust their tools" can apply to all packages on there. ![]() I don't mean to imply that there's no startup overhead, but how often are you restarting the REPL when doing EDA? Unless it's more than once every few minutes (which is a very odd workflow), then startup overhead is effectively amortized. > Julia is a growing alternative to Fortran/C/etc for long-running computations, it remains awkward and unpleasant for interactive analysisĭid you mean to write short-running scripts? If anything, the Julia dev workflow is biased towards interactive analysis in a REPL a la R or IPython/Jupyter. And that can be applied to virtually all Julia functions and combined with code from preexisting Julia libraries. For example, in the optimization course, we develop a mimimalistic implementation of Automatic Differentiation on a single slide. It allows for composition of ideas in ways I couldn't imagine before seeing it in action. Third, the type system and method dispatch of Julia is very powerful for scientific programming. And that counts for numerical algorithms. It can be just as concise / readable and on top the students immeditaly get the "real thing" they can plug into Jupyter notebooks for the exercises. Due to its conciseness, Julia has mostly replaced showing pseudo-code on my slides. Julia is just perfect for teaching numerical algorithms.įirst, it removes the typical numpy syntax boilerplate. I teach a graduate course in optimization methods for machine learning and engineering. ![]()
0 Comments
Leave a Reply. |