Live data from Hacker News

Ray Tracing in Nim

nim-lang.org

11–20 of 68 posts

Re: Ray Tracing in Nim

#11

Anyone have thoughts on nim vs rust for data centric (Scala like) applications

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

#12
post #8

I keep seeing Nim and it looks really productive and very interesting! Does anyone know how it compares to Zig?

Zig is mainly focused on low level programming - every function that allocates takes an allocator argument, there are lot of builtin functions to do low level bit twiddling, doesn't hide any control flow, etc..

Nim is mainly a productivity language. You have GC by default, extensive stdlib, lot of syntax sugar and metaprogramming features. You can create untraced pointers and do manual memory management.

Thus, among the new crop of compiled programming languages

Productivity languages with GC: Crystal, Nim, Go, Swift (automatic refcounting, not GC)

Manually memory managed, low level: Zig, Rust, Odin. Nim can do manual memory management as well but doesn't seem to be primary use case.

Re: Ray Tracing in Nim

#14
post #3

This is pretty good. I was wondering about CUDA and it looks like Nim has support for writing CUDA kernels. Is there a repository of kernel implementations I can take a look at?

https://github.com/mratsim/Arraymancer probably has a lot of examples in it's implementation

Yup. That's what popped up when I searched. Thanks for the reference though.

Re: Ray Tracing in Nim

#15
post #9

Anyone have thoughts on nim vs rust for data centric (Scala like) applications

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.

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

#16
post #2

What I like about Nim is that you can always get C performance if you just spend a little time. You can always use a profiler you like (I use vTune) to get to the hot loops and fix them. See my post here: https://forum.nim-lang.org/t/5363#33576

Is that not true of almost any other systems language (depends if you count Go as a systems language)?

Re: Ray Tracing in Nim

#17

Anyone have thoughts on nim vs rust for data centric (Scala like) applications

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

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

#18

Anyone have thoughts on nim vs rust for data centric (Scala like) applications

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

#19
With all due respect, Nim is a great language performance wise however I fail to see how is it different from D. Many advertised features have been present in D for a long time.

Syntax wise Nim it is a step back. It's hard to read and understand while any C/C++ dev will have next to no effort reading through D code. And of course while D is C ABI compliant it interoperates with C++ well too.

I seriously doubt that Nim or any other language in this regard has better metaprogramming than D.

Nim might have a speed overhead in certain tasks but that depends on a benchmark. Besides, does Nim have anything similar to NumPy which is actually faster? D does.

Re: Ray Tracing in Nim

#20

With all due respect, Nim is a great language performance wise however I fail to see how is it different from D. Many advertised features have been present in D for a long time. Syntax wise Nim it is a step back. It's hard to read and understand while any C/C++ dev will have next to no effort reading through D code. And of course while D is C ABI compliant it interoperates with C++ well too. I seriously doubt that Ni…

I agree that it is strange that, in all of the discussions surrounding relatively modern languages, and new technologies, while nim and rust and many others frequently get mentioned, so rarely it seems that anyone talks about D. Wonder why that is? I’m genuinely curious.
Post reply on HN