3 ms·
Julia uses 1-based indexing. It's competes with R and Matlab for the same set of users. Both R and Julia have their core functions written in C++. Absolutely no
by muragekibicho 28d ago
Julia uses 1-based indexing. It's competes with R and Matlab for the same set of users. Both R and Julia have their core functions written in C++. Absolutely nothing new.
From my experience, grad students use Julia when their PI thinks a new programming language will help differentiate their next NSF proposal among vast funding requests.
- adgjlsfhk1 28d ago> Both R and Julia have their core functions written in C++. Absolutely nothing new. imo this isn't really a good summary. Julia is one of the 3 languages to have done an exascale HPC run https://arxiv.org/pdf/2309.10292v1 https://arxiv.org/pdf/2309.10292v1 (Fortran and C are the other 2). Some parts of the compiler are written in c++ (the llvm interface), but doing codegen with llvm is much more similar to C/Rust/Fortran than R/Matlab
- skew-aberration 28d agoIt kinda feels like Julia competes for the people who write the libraries for R and Matlab. Writing fast and elegant ODE solvers, etc in Julia seems to be easier than the others and they've attracted a lot of academics for that reason.
- tonyarkles 28d agoI'm currently split between Python and Julia, having used R happily in the past for data analysis and Matlab for this and that in my EE program. For me, Julia crushes one niche that the rest of them are not good at: making the math look like the math. https://docs.sciml.ai/ModelingToolkit/stable/tutorials/nonlinear/ https://docs.sciml.ai/ModelingToolkit/stable/tutorials/nonli... If you've used something like SciPy or symbolic Matlab or Maxima or whatever, it always feels like I'm very carefully converting the equations I've scribbled down on paper into code and always a little nervous that I've accidentally split one variable into two names or used the wrong equality operator and am going to end up hating life, or accidentally assigned x = sp.Symbol("y") somewhere. The Julia version is just plain beautiful. There's no ceremony other than the three @parameters, @variables, @mtkcompile macros. It lives in its own little world where you don't have to constantly watch your back to make sure you haven't duplicated a symbol somewhere.
- hasley 28d agoGetting linear algebra in a programming language close to math formulas was, for a long time, my reason to use Octave. When I first read about Julia, I was really amazed - especially the type system with its multiple dispatching and not automatically converting between types (e.g., between integers and floats). Though, I do not know, how Julia is today. Today, I use Python instead of Octave (or Julia) - just because it has a large ecosystem and is widely adopted. An additional advantage is that Python has much better OOP features than Octave had back then. However, I wished Julia had the status that Python has today.
- skew-aberration 28d agoI definitely agree. And the common performance optimization metaprogramming (like 'do it this way for this type of input') works so much better with multiple dispatch, tag structs. Way ahead of C++ expression templates and much more pleasant than macros, concepts, etc. Some of the lower-level APIs like those for concurrency were quite poorly thought out though, at least when I last used Julia. Condition variables don't have equivalent of pthread_timed_wait. Condition variables and channels APIs are not well integrated, design wise. I found so many such issues that it convinced me Julia wasn't general purpose enough. It felt like the features were a bit half-baked and had been hacked together by someone who knew their value but lacked the deep experience/knowledge to pull them all together into a single cohesive vision. Same issues as python, POSIX, etc.
- tonyarkles 28d agoYeah, the nifty part is instead of trying to write your whole multi-threaded high performance tool in Julia, there is excellent support for taking the math work you’ve done and codegen C out of it. Am very happily using that in prod today for a thing and it works awesome.
- Joel_Mckay 28d agoJulia is fun, but is still mostly an academic language. Very few shops will use it in the private sector. Python is also more common as a prototype integration language, and rarely seen in industrial areas. If you are an EE that wants to remain employed... than make sure you have documented hours with C/C++, Verilog on Zynq, and ladder logic for Rockwell automation products. Best of luck =3
- jhoechtl 28d ago> Julia uses 1-based indexing. That rules it out to become a successor to Python. It sounds reasonable until you start interacting with other libraries. I do know the attemp to justify it for Lua and I don't buy it.
- kvchiu 28d ago[dead]
- jhbadger 28d agoNearly all languages designed for mathematics are 1-based - R, Matlab, Mathematica, etc. because that's the mathematical convention and allows using formulas directly. The fact that Python isn't is a drawback in the domain.
- ModernMech 28d agoNearly all languages for non coders are this way including Excel and SQL and Scratch.
- ModernMech 28d agoThis is why AI is better at writing code than humans. They just write code and don’t complain about things that don’t matter, like indexing; or another classic, spaces vs tabs. Humans must learn to get past these things.
- 12jahsg 27d agoAI does not complain because it has no agency and cannot do anything without a prompt. It is better than your code, which is probably a low bar.
- postflopclarity 27d ago> It is better than your code, which is probably a low bar. why so rude and adversarial, especially when so misinformed? AI code is better than 95% of engineers at this point.
- deleted 28d ago[deleted]
- eigenspace 27d agoThis argument over indexing conventions is so tired. I have yet to hear a good argument for why the answer to "How do I get the third element of this array?" should be `arr[2]` > Both R and Julia have their core functions written in C++. Absolutely nothing new. What on earth are you talking about? This is at least a novel claim. Some deep parts of julia's compiler are written in C++ but that's about it. Nearly everything in the language is written in julia itself. The only significant foreign codebases in the language are * LLVM * OpenBLAS * LibUV all of which are extremely reasonable foreign things for a language to use (though we are gradually moving more and more of these things to the julia side)
- defrost 27d ago> "How do I get the third element of this array" should be `arr[2]` Ask a carpenter. To get to the third pigeonhole in a racked series of one foot per pigeonhole unit you literally offset two feet from the origin. In C (of course), arr[2] works as well as does 2[arr] as both are literally just syntactic sugar for arr+2 ie. The third pigeon hole begins after passing two whole pigeonholes.
- eigenspace 27d agoOkay, but why are you trying to think about *elements* of a list in terms of offsets from the origin? I mean, that's an important low-level detail to know when you're working with assembly or doing pointer math, but it is not something that necessarily needs to be polluting the semantics of a high level language. I find it much easier to think in terms of v[i] is the i-th element of my vector. These sorts of things just feel like mental gymnastics people perform to post-hoc justify language quirks.
- defrost 27d agoYou asked for a good argument - I provided one. > but why are you trying to think about a list of elements in terms of offsets from the origin I don't try to think about them in this way - I do and have always thought about them in this way - in software terms for 50 years, in real world cut, saw, and hammer ways for over 60. > I find it much easier to think in terms of ... Which is the crux of the issue really, that's how you think. > v[i] is the i-th element of my vector. I think of V as the start of a row of elements. V+0 is equivalent to V and naturally the start of the first element. V+1 is the start of the row, plus one - the literal start of the second element. I've always thought of V[i] as offsets, "jump overs" if you will. It comes naturally for many that have worked with their hands on physical objects and worked with tape measures. > but it is not something that necessarily needs to be polluting the semantics of a high level language. Either way of thinking works - I spent decades going back and forth from Fortran to C, and people are free to make their high level languages however they wish - it's trivial to move from one to the other. There are even some funky (or eyeball gouging) tricks done to preamble a data run with meta data, leading to V[-1] indexing being commonplace (in some domains)