5 ms·
I would argue that default element-wise operations and 0 based indexing can lead to a lot of cognitive overhead vs the "more math-y" notation of MATLAB or Julia
by patagurbon 2y ago
I would argue that default element-wise operations and 0 based indexing can lead to a lot of cognitive overhead vs the "more math-y" notation of MATLAB or Julia. And overloaded operators like block matrix notation or linear solves are much closer.
The type system in Julia is perhaps even better than MATLAB for some linear algebra operations (a Vector is always a Vector, a scalar is always a scalar). But the Python ecosystem is often far superior to both, and MATLAB has toolboxes which don't have equivalents in either other language. Julia has some uniquely strong package ecosystems (autodiff to some extent, differential equations, optimization), but far fewer.
- hughesjj 2y ago> 0 based indexing I mean, zero based indexing isn't exclusive to computing. Plenty of times in physics or math we do x_0 for the start of a sequence vs x_1. Although, fair, our textbook had the definition of a sequence being a mapping of elements to z+, which is zero exclusive
- DNF2 2y agoBoth zero-based and one-based indexing is common in mathematics, for example polynomials, exponential series, transforms, etc. are often zero-based. But in most of the literature that I've seen, vectors and matrices tend to number elements starting with 1.
- staunton 2y ago> the Python ecosystem is often far superior to both What would you say does the Python ecosystem have that the others are missing? The obvious thing is pytorch/tensorflow/.... I can't think of much else though.
- constantcrying 2y ago>The obvious thing is pytorch/tensorflow/.... I can't think of much else though. Julia has Flux, which is great. To create a neural network with Flux, you write the forward operation however you want and just auto differentiate the whole thing automatically and get a trainable net. It is extremely flexible and intuitive. What Julia lacks is everything which isn't numerical analysis though.
- staunton 2y agoI agree that Flux.jl is very cool but you can't use it to train a SOTA LLM, can you? The Julia ecosystem does not have the resources to even attempt building a viable alternative to Pytorch. I'm still curious what concrete things you mean that Julia is missing. Maybe I'm so stuck doing numerical analysis, can't think of anything else...
- constantcrying 2y ago>I'm still curious what concrete things you mean that Julia is missing. Basically everything not related to numerical analysis. The problem isn't that there isn't an option which does work, but that those options aren't fully developed and mature to actually use for a commercial project. E.g. look at GUI libraries, the native ones are just wrappers around other libraries and poorly documented. There is a single web framework, but is that supported enough that you would bet your entire company on it being continually supported? If you are doing anything which isn't related to numerical analysis, Julia isn't your first choice, it also isn't your second or third choice. And I think that is fine, clearly Julia wants to be a good at a particular thing and has achieved that.
- richrichie 2y ago> and just auto differentiate the whole thing automatically Not so simple as it sounds. A lot of speed advantages of Julia comes from doing in place ops on arrays and Zygote does not work with in place updates. So you end up copying and then at that point Python + PyTorch becomes a superior choice as Python is the de facto the universal language.
- vegesm 2y agoPytorch and tensorflow is pretty big. It implies all state of the art research code is not written in Julia, so it is a non-starter for any neural network based project.
- constantcrying 2y agoThat is just total nonsense. You can of course do neural network research without pytorch and tensorflow. Julia is especially good, with Flux being the most flexible Neural Network library which exists. Pytorch and tensorflow are important and a very good reason to use python or C++, but those two being unavailable is more impactful for the industry, of course your research might need them, but it might very well not.
- daynthelife 2y agoI disagree on the zero-based indexing complaint. Indeed, the fact that Julia indexed from 1 is the sole reason I will never use an otherwise great language. I can’t comprehend how people came to the conclusion this was a good idea.
- dmz73 2y agoIt seems that a lot of programmers have trouble distinguishing between indexing and offsets. This is probably due to legacy of C language which conflates those two, possibly for performance and simplicity reasons. Same goes for case sensitivity in programming languages, again a legacy of C...are Print, print and PRINT really different functions, is that really what you intended??? Anyway, indexing is enumerating elements and it naturally starts at 1 for the first element and goes to Count for the last. Offsets are pointer arithmetic artifact where first element is at offset of 0 for most but not all data structures. Then you get "modern" languages like Python where they adopt indexing from 0 (no offsets since there are no pointers) and range where start is inclusive and end is exclusive...very natural behavior there. Oh, and lets make it case sensitive so you never know if it's Print, print, PRINT...or count, Count and COUNT until you run for 20 min and then crash.
- gugagore 2y agoI'm confused that you're bringing in case sensitivity into the discussion. For simplicity, early systems could not be case sensitive because they didn't have a large enough character set. The comment about crashing due to spelling error really should be addressed by some form of static analysis, not by making name lookups more relaxed, in my opinion.
- FabHK 2y agoYou think mathematicians had it all wrong for centuries? Incidentally, I find it amusing that in Europe, the ground floor is zero, while in the US, it's one. (A friend of mine arrived at college in the US and was told that her room was on the first floor. She asked whether there was a lift as her suitcase was quite heavy...)