News for hackers. Stuff that matters.
Re:Rust and QML: a timely example by petecox on Thursday January 18, 2018 @07:20PM (#16182949)
There's a distinction between a Qt project calling Rust code via a C ABI versus a Rust program bootstrapping Qt.

The author hand-edits a C++ file, autogenerated by CMake. In that sense it still needs a C++ compiler as part of a build step.

A binding relying only on Rust and QML might replace the C++ boilerplate with a Rust equivalent.

Re:Rust and QML: a timely example by oever on Thursday January 18, 2018 @07:41PM (#16183088)
The binding generator generates a binding from a JSON file. That gives C++ and Rust code. Additionally, a default Rust implementation is generated for convenience where the programmer fills in the application logic.

At no point is there a need to edit a generated C++ file. Any other build tool with C++ support could be used instead of CMake. What it should do is call rust_qt_binding_generator when the binding description changes.

The table in this blog shows what files are generated: https://www.vandenoever.info/blog/2017/09/04/rust_qt_binding...

Re:Rust and QML: a timely example by petecox on Thursday January 18, 2018 @08:43PM (#16183413)
> At no point is there a need to edit a generated C++ file

Well then maybe your example should reflect that, where a change is made in the C++ file replacing 'Simple' with 'Time'

Re:Rust and QML: a timely example by codys on Thursday January 18, 2018 @09:15PM (#16183595)
`src/main.cpp` is not a _generated_ C++ file.

It can be seen inside the template project here:

https://phabricator.kde.org/source/rust-qt-binding-generator...