Comment by nostradumbasp
5 months ago
I see. I don't know almost anything about symbolicregression.jl but it sounds like a good use case for Rust if it's intended to be used for important/mission critical applications. Sounds like there is a lot of opportunity for use-after-free, race conditions, and the like. Also looks like the code base is becoming increasingly complex probably to the point where maintenance is becoming hazardous for an open source project.
I'd heavily consider abstracting out whatever logic was possible into Rust and FFI'ing into Julia. Seems like some Python, and otherwise projects have started going in this direction and I haven't heard any complaints. Usually performance benefits and cleaner code.
I don't do much of science compute, but I would imagine correctness and stability really matters for end users. Unless its kind of a nichey write a paper and run sort of thing. Then whatever.
> While Rust doesn’t fill the same niche as Julia with respect to scientific computing, I really like the safety guarantees around ownership and borrow checker.
From the same discourse thread.
Interoperability across languages with FFI is an option, but it comes at a cost. Even if the two languages have polymorphism, e.g. with parametric types, the interfaces are almost always monomorphic.
I agree Rust's scientific computing is still in it's early phases. Which is super exciting but can leave a bit of wanting for more. Also agree on the bothers of FFI across programming paradigms. I've felt them.
I do still wonder if there is some boundary where it would be reasonable to split the responsibilities of the code up. In this case to avoid FFI which strips language features away, the author decided to try to add language features.
I did a quick crates.io search and it looks like there are already some symbolic regression projects available. Maybe it would even make sense to say "the cost of maintenance is worth a mostly major re-write in a language with lower long-term costs". The author was willing to write another package to try to scaffold language features to make debugging issues with the project/language easier. That's a lot of work with 2x the maintenance costs and adds what looks to me like sincere cognitive over-head.
Every design decision has a trade off. I don't know much about the project that required this one, but when I see things like this they make me scratch my head a bit and wonder if it's a stretch in the responsibilities in the tool being used. Sometimes that is good and forwards a broader picture in a community. Sometimes its a sign that the wrong tool is being used for the job or something like that.
Either way I'm sure it was a lot of fun to do this, it just raises questions for me in general.