News for hackers. Stuff that matters.
Re:Candle: Torch Replacement in Rust by coldtea on Tuesday August 08, 2023 @01:12PM (#37052344)
>Because any programming language can be a pain in production environments.

Except one with memory safety and static builds. Like Rust can offer.

Re:Candle: Torch Replacement in Rust by oivey on Tuesday August 08, 2023 @02:55PM (#37053784)
I wish my bugs were mostly preventable via static typing and memory safety checks. For most ML and data work algorithm design and logic errors are the primary source of bugs. Type errors are usually the trivial things you fix in minutes.
Re:Candle: Torch Replacement in Rust by coldtea on Tuesday August 08, 2023 @04:41PM (#37055164)
The topic wasn't bugs though - and nobody mentioned static typing.

The grandparent said "Python is a pain in the ass in production environments".

And the parent said: "any programming language can be a pain in production environments".

My point was how Rust is better for backend services in production, as it wont have memory bugs (which have long plagued backend services and have resulted in many exploits), and it also offers static builds (so deployment can be dead easy, and wont be having the kind of environment issues some languages have).

In the aspect of "design and logic errors", Rust would be like most other languages people actually use for backends, so that's not a factor pro or against.

Re:Candle: Torch Replacement in Rust by oivey on Tuesday August 08, 2023 @10:27PM (#37058045)
You’re right, I misread static builds as typing. Python’s dependency management system sure does suck, although I think the problem could be solved without static builds. Overall they are a nice feature, though.

I think the memory management element is a little dubious, though. Torch’s memory management, for example, is fairly safe, and it internally has its own allocator. A Rust version (I think) that implemented the same would have to rely on unsafe blocks, and would likely have many of the same potential pitfalls as Torch. Time spent satisfying Rust’s borrow checker is likely lost productivity compared to just relying on Python’s reference counting and garbage collection. That productivity could be better spent on making the product better with new features and fixes of algorithmic mistakes.