6 ms·
I debated whether to start learning Rust vs Nim... Rust does seem to have more libraries to get stuff done.
by manishsharan 6y ago
I debated whether to start learning Rust vs Nim... Rust does seem to have more libraries to get stuff done.
- Waterluvian 6y agoI find that with JavaScript, Rust, and Python, my tool belt is pretty well equipped these days.
- adamnemecek 6y agoAlso consider julia.
- collyw 6y agoI would say that you need to present a case where Julia would be needed. I do Python and Javascript it covers most stuff that isn't low level. Rust does that, so what is the need for Julia?
- adamnemecek 6y agoNumerics and ml.
- Majestic121 6y agoPython handles that pretty well. Maybe Julia does it marginally better, but I don't think it's worth learning a whole new language for this unless your day job is only 'Numerics and ml'
- snazz 6y agoFrom this perspective, I totally agree. If you enjoy learning new languages (at a surface level understanding) for the increase in perspective, you might find Julia worth learning.
- sesuximo 6y agoThis is only true because other people wrote the hot parts in other languages and exposed a python library. That’s fine but isn’t really fair in a battle of languages
- klyrs 6y agoGood c interoperability is a benefit that Julia and Python share, and exploit for performance gains. They're on even footing here. Rust does it too, calling external unsafe code so they don't need to rewrite the world all in one go. I'd say that the extendability of a language isn't just fair, but a crucial aspect in comparing languages because that's what people do in the real world.
- adamnemecek 6y agoNo, interop is so much simpler in julia. Not to mention cpp interop.
- klyrs 6y agoYeah, won't argue there; I was responding to the notion that python is somehow cheating by using numpy. Python has at least 3 paths to cpp interoperability now, but they've all got their warts.
- adamnemecek 6y agoAnd they are require you to write wrappers. Peep the julia interop https://github.com/JuliaInterop/Cxx.jl https://github.com/JuliaInterop/Cxx.jl you just import your cpp code and it works.
- newswasboring 6y agoThis has been broken since v1.4 at least. You might want to peep CxxWrap
- UMetaGOMS 6y ago
- adamnemecek 6y agoIt's not marginal, not even close.
- orf 6y agoI disagree, and judging by relative popularity so do most people. I guess the onus is on you to prove that it's not even close.
- adamnemecek 6y agoI don't care about proving anything. You are looking at absolute numbers as opposed to things like growth or experience of people who switched. Even something like inverting a random 4x4 matrix is just so much simpler. In julia it's just "inv(rand(4,4))". In python, you'll have to install numpy first and then writing it out is like 4 times as many characters.
- orf 6y agoIn Python it's also literally "inv(rand(4,4))". And yeah, you need to install numpy first. But if you're doing this work you of course already got it installed.
- adamnemecek 6y agoNo, it's import numpy as np np.linalg.inv(np.random.rand(4,4)) And you have to write it like this, because of lack of dynamic dispatch.
- orf 6y ago> import numpy as np > np.linalg.inv(np.random.rand(4,4)) Which of course is nothing to do with python, and is trivially reduced to the aformentioned `inv(rand(4, 4))` with imports. > And you have to write it like this, because of lack of dynamic dispatch. Not at all.
- dunefox 6y agoIt doesn't just do it 'marginally better' but you don't seem to have a need for it just now.
- adamnemecek 6y agoHow much julia have you written?
- laichzeit0 6y agoIf Nim had sklearn, pandas I would probably choose it over Julia. I would love a statically typed Python. Have no interest whatsoever in learning a brand new ecosystem and syntax at this point.
- adamnemecek 6y agoJulia has crazy interop so you can call python libraries if you want. You are missing out though.
- pier25 6y agoAfaik with Nim you have access to the C and C++ libraries.
- untog 6y agoI had the exact same debate. One potential strength for my use case (cross platform mobile stuff) is that Nim actually transpiles to Objective C, which can then be compiled with Xcode. That’s a big deal because you need to provide bitcode with your binaries on AppleTV and Watch. Rust can do it in a hacky way but there’s no guarantee it’ll keep working. I still went with Rust in the end, though. Nim’s documentation was rough going and I hit a lot of walls. The initial learning curve for Rust was way higher (borrow checker and all that) but once I got up to speed it was a great experience.