[1] https://www.oxinabox.net/2021/02/13/Julia-1.6-what-has-chang...
1,804 karma · joined October 22, 2018
[1] https://www.oxinabox.net/2021/02/13/Julia-1.6-what-has-chang...
See also: https://www.oxinabox.net/2021/02/13/Julia-1.6-what-has-chang...
However, as far as I understand it there is also an argument to be made that multiple dispatch is at least as close to Alan Kay’s original intent for OO (e.g. [1]) than is the currently-ubiquitous class-based version of OO that leads to things like `RequestProcessorFactoryFactory` s with `RequestProcessorFactoryFactory.getRequestProcessorFactory(Class)` methods.
[1] https://medium.com/javascript-scene/the-forgotten-history-of...
5 * A
does not require broadcasting because multiplication of a matrix by a scalar is mathematically well-defined, whereas 5 + A
(assuming you want element-wise addition) does require broadcasting, i.e., 5 .+ A
because addition of a vector and a matrix is not mathematically well-defined. A series of headlines:
2009 - NSA offering 'billions' for Skype eavesdrop solution [1]
2011 - Microsoft buys Skype for $8.5 billion. Why, exactly? [2]
2012 - Skype replaces P2P supernodes with Linux boxes hosted by Microsoft [3]
2013 - Microsoft handed the NSA access to encrypted messages. Subhead: Skype worked to enable Prism collection of video calls [4]
1. https://www.theregister.co.uk/2009/02/12/nsa_offers_billions_for_skype_pwnage/
2. https://www.wired.com/2011/05/microsoft-buys-skype-2/
3. https://arstechnica.com/information-technology/2012/05/skype-replaces-p2p-supernodes-with-linux-boxes-hosted-by-microsoft/
4. https://www.theguardian.com/world/2013/jul/11/microsoft-nsa-collaboration-user-dataThings are definitely stabilizing a bit post-1.0, but it's still a young language, so it'll take a while for documentation to fully catch up; in the meanwhile, the best option in my experience has been to lurk the various chat forums (slack/zulip/etc. [5]) and pick up best-practices from the folks on the cutting edge by osmosis.
[1] https://www.youtube.com/watch?v=kc9HwsxE1OY
[2] https://www.johnmyleswhite.com/notebook/2013/12/06/writing-t...
[3] https://docs.julialang.org/en/v1.5/manual/performance-tips/#...
[4] https://github.com/brenhinkeller/JuliaAdviceForMatlabProgram...
[1] https://stackoverflow.com/questions/31733766/in-what-sense-a...
[2] https://gist.github.com/brenhinkeller/44051118c2f9d18b26dc76...
There are quite a lot of different ways of mapping in Julia, including functions like `map`, `mapreduce`, `replace`, and various syntaxes for broadcasting and array comprehensions.
For maximum SIMD performance there are also things like `vmap` and `vmapreduce` from LoopVectorization.jl.
If you wanted to use Julia at petascale or above (like the Celeste folks), then you'd probably want to be doing that in a case where you see fundamental algorithmic improvements you could readily make over the current SOTA with a higher level, dispatch-oriented language - or else a case where you really need, say, certain types of AD or the DiffEq + ML capabilities of the SciML ecosystem (the latter of which very much depends on the level of composability that follows from the dispatch-oriented programming paradigm).
In general, my two cents on what it takes to get "good enough" performance from Julia for my sort of HPC are that you (1) embrace the dispatch-oriented paradigm and take type-stability seriously, and (2) either disable the GC and manage memory manually or else (my usual approach) allocate everything you need heap-allocated up-front, and subsequently restrict yourself to in-place methods and the stack.
MPI.jl pretty much "just works" in my usage so far (just have to point it towards your cluster's OpenMPI/MPICH) and things like LoopVectorization.jl are great for properly filling up your vector registers with minimal programmer effort.
I have not seen anyone use Nim or Zig yet. There are also some special-purpose languages like Fortress (apparently now defunct), Coarray-Fortran, and Chapel, though none seems to have achieved too much market-share.
Personally I have almost entirely switched to Julia (from mostly C), which lets me do my everyday plotting / analysis / interpretation and my HPC (via MPI.jl) in the same language. Fortran definitely still has some appeal as well though.
[1] https://doi.org/10.1145/2450153.2450158
[2] http://www-tapenade.inria.fr:8080/tapenade/index.jsp
[3] http://www-sop.inria.fr/ecuador/tapenade/distrib/README.html
[1] https://stackoverflow.com/questions/48562873/zero-indexed-ar...
So a language with multidimensional arrays is in a lose-lose position of having to choose to either satisfy the linear algebraists at the cost of alienating general-purpose programmers who want to do pointer arithmetic, or else satisfy the latter while alienating the core demographic for multidimensional numeric arrays.
Personally, I’m fine with (or even slightly prefer) one-based for my own scientific computing, despite starting with C, since it really is more elegant for linear algebra, and I have never found myself needing or wanting to do pointer arithmetic in a language that does have good multidimensional arrays — but clearly it is still a major turn-off to many others.
There are some other (i.e, “embarrassingly parallel”) scientific computing problems where a higher-latency distributed setup would be fine, but in climate models, as in any finite-element model, each grid cell needs to be able to “talk to” its neighbors at each timestep, leading to quite a lot of inter-process communication.
I mostly used C for my (small-scale) HPC work in grad school because it’s what I knew best, but at several points I wished I had learned Fortran instead.
Probably one of the only “higher level” languages that’s ever been used for serious petascale scientific computing is Julia (first with Celeste on the astro side, possibly soon with CliMA for climate modeling), which not coincidentally follows similar array indexing conventions as FORTRAN. And while that’s what I mostly use now, I don’t see Fortran going away any time soon.
If anything, with cool new projects like LFortran [1] making it possible to use Fortran more interactively, it’s probably quite a good time to learn modern Fortran!
For the strong force the situation is the same in a sense, if you had a kg each of quarks of different colors — except you literally can’t have that, because the energy involved in separating a pair of quarks is so large that it actually causes two new quarks to snap into existence and pair off with the two you were trying to separate before you can separate them on anything approaching macroscopic scales [3]. So the strong force is obligatorily screened (camouflaged) at long distances, but only because it is so strong.
The kg-of-protons experiment on the other hand you could do in principle, it would just probably be better if you didn’t.
[0] https://www.feynmanlectures.caltech.edu/II_01.html
[1] https://sieste.wordpress.com/2012/04/22/feynmans-electric-fo...
As far as your comment about “awkwardness”, the key point for me was when I actually started to understand/embrace multiple dispatch as a programming paradigm. If you try to write Julia like in a an imperative or oo or etc. style, it may work, but will be clunky and quite possibly full of type instabilities. But if you write Julia in a “dispatch-oriented” paradigm then it really is just as performant and elegant as advertised, IMO.