News for hackers. Stuff that matters.
Re:Ray Tracing in Nim by nautilus12 on Wednesday July 01, 2020 @08:08PM (#23708375)
Anyone have thoughts on nim vs rust for data centric (Scala like) applications
Re:Ray Tracing in Nim by untog on Wednesday July 01, 2020 @10:08PM (#23709216)
I can't speak to data centric but I was looking at both Rust and Nim for a project recently. I love the syntax of Nim and it feels incredibly easy to write in. The power of the macro system is amazing.

But the Rust community is so much bigger, pretty much every question I had was answered after a quick Google search.

Re:Ray Tracing in Nim by steve_adams_86 on Wednesday July 01, 2020 @11:17PM (#23709614)
I agree. I really struggled to get help with certain problems with Nim, but with Rust it has been fairly trivial to find help. The community is very active and helpful.

Nim does have a syntax I prefer more, but overall I find I’m quite a bit more productive with Rust.

Re:Ray Tracing in Nim by beagle3 on Thursday July 02, 2020 @03:35AM (#23710841)
The most effective venue for quick Nim answers is the Nim forum - almost everything gets a serious well thought out answer within a few hours to a day.

That said, nothing beats “already been answered” and the Rust community is much bigger.

Re:Ray Tracing in Nim by totalperspectiv on Thursday July 02, 2020 @01:04AM (#23710169)
That depends on why you use Scala?

Do you use Scala as a better Java? If so, Nim may be what you want.

Do you use Scala for its incredible type system? Rust may be what you want.

Do you use Scala for its functional tendencies? Rust may be what you want.

As an aside, I've found that once you get over the Rust learning curve, writing 'correct' programs is easier in Rust than any other language I've used. And for data centric applications, being 'correct' is extra important.

Re:Ray Tracing in Nim by nautilus12 on Monday July 06, 2020 @12:40AM (#23744757)
What about scalable data? Like spark applications? I am familiar with weld but seems like more mature distributed computing is still on the horizon
Re:Ray Tracing in Nim by ca_parody on Wednesday July 01, 2020 @10:26PM (#23709319)
its been a couple years - but mratsim (the same person who authored this ray tracing post) wrote this (which is at least tangential to your question) https://medium.com/@MARatsimbazafy/why-rust-fails-hard-at-sc....

Some of the rust problems mentioned (like clone for arrays) have been fixed. Others, like static generics, have not been (AFAIK).

Re:Ray Tracing in Nim by zamalek on Wednesday July 01, 2020 @08:59PM (#23708798)
Apart from Python, you could look at Julia.
Re:Ray Tracing in Nim by qeternity on Wednesday July 01, 2020 @08:31PM (#23708574)
If they’re data centric, would you not be better off with vanilla python? If you have numpy do the heavy lifting, it’ll be as fast plus all the syntactic/ecosystem benefits
Re:Ray Tracing in Nim by ca_parody on Wednesday July 01, 2020 @10:19PM (#23709275)
The main reasons I see for nim in scientific computing over python are:

(a) you need performance for applications outside of numpy / pandas & you want to avoid writing a C extension to do so (nim is also actually a good choice for python extensions via nimpy - if you are still using python as the main language of your project/system)

(a2) you want good concurrency (some would say python's async/await is good - but it feels too little too late to me) & you at least want the option of parallelism (like this article takes advantage of)

(b) you want / need the powerful macro system for dsls / custom (compile-type-checkable) language extensions.

There is a good future for nim in scientific computing (frankly, there is a good present) - but for it to be better, people need to be willing to forgo some of the ecosystem (when possible) and to help build that future.

https://github.com/nim-lang/needed-libraries/issues/77

Re:Ray Tracing in Nim by logicchains on Wednesday July 01, 2020 @11:48PM (#23709796)
The OP said Scala-like. A big advantage of Scala/Spark over Python is more compile-time checking: the code is much less likely to fail at runtime. Particulary helpful for production code (e.g. pipelines). For people coming from an engineering background (as opposed to data science), Python's lack of any static type checking for data processing code can be a big productivity killer. In that sense, Nim might be able to offer similar advantages to Scala.
Re:Ray Tracing in Nim by nimmer on Thursday July 02, 2020 @06:34AM (#23711805)
Numpy is nice but pure-Nim applications appear to outperform it easily:

https://narimiran.github.io/2018/05/10/python-numpy-nim.html

https://github.com/mratsim/Arraymancer

Re:Ray Tracing in Nim by qeternity on Saturday July 04, 2020 @06:48PM (#23735431)
Interesting but given the low total execution time, the majority of time in the numpy implementation is going to be spent initializing CPython.

I think if this were on the order of minutes/hours you would see numpy outperform.

Re:Ray Tracing in Nim by nkozyra on Wednesday July 01, 2020 @09:10PM (#23708870)
Yeah, I like nim but it isn't going to offer and advantage over python in this regard.