3 ms·
If the tutorial uses Rust, why didn't they use a solver written in Rust? Z3 was written in C++.
by amelius 7mo ago
If the tutorial uses Rust, why didn't they use a solver written in Rust? Z3 was written in C++.
- suddenlybananas 7mo agoWhat solver would you have them use? Z3 is very mature and the Rust bindings are pretty good in my (limited) experience.
- amelius 7mo agoI would write the tutorial in C++, for a more direct experience.
- volemo 7mo agoI personally like to avoid the “writing in C++” experience. :/
- amelius 7mo agoThe authors of a powerful solver package thought differently.
- onair4you 7mo agoIt might have more to do with the first release of Z3 being in 2012, with the first stable Rust release being in 2015. Rather than the authors of Z3 passing some kind of judgment on Rust…
- amelius 7mo agoZ3 uses a sophisticated and fast garbage collection scheme internally that doesn't mesh well with Rust idioms.
- invl 7mo agoIt's reference-counted at the boundaries. See https://github.com/Z3Prover/z3/blob/daf2506b6002149d531cb6c9d8ba976a040cd647/src/api/c%2B%2B/z3%2B%2B.h#L626 https://github.com/Z3Prover/z3/blob/daf2506b6002149d531cb6c9...
- mcphage 7mo agoThe authors of a powerful solver package were solving a different problem than the users of a powerful solver package, and so different tools may be appropriate.
- suddenlybananas 7mo agoThe author might not know C++ and you don't need to use C++ to effectively use z3.
- Arainach 7mo agoThere's nothing "more direct" - the different APIs for different languages call into the same underlying library, and most of them are more accessible and easier to work with than C++. Z3 is presumably written in C++ for performance, but without data I am very confident the vast majority of programs that use Z3 consume it via one of the other APIs.
- deleted 7mo ago[deleted]
- invl 7mo agoI'm not sure I understand your argument. Z3's API is canonically C. There's a C++ wrapper that works pretty well. I don't have experience with the Rust wrapper, but I'd imagine that works pretty well too.