Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to a language with a better standalone story #2

Open
danieldk opened this issue Nov 10, 2019 · 6 comments
Open

Port to a language with a better standalone story #2

danieldk opened this issue Nov 10, 2019 · 6 comments
Assignees

Comments

@danieldk
Copy link
Member

danieldk commented Nov 10, 2019

What is in the repository now is a quick mockup in Python. But Python makes it a bit harder to distribute a standalone application, plus to do (good) async processing. Consider rewriting in a native language for easy redistributability. Logical choices:

  • Rust + Gtk2 (Qt bindings are nowhere yet)
  • C++ + Qt (GUI could be ported easily, but far less safe)
@danieldk danieldk self-assigned this Nov 10, 2019
@danieldk
Copy link
Member Author

Rust + Gtk is happening in the rust branch:

https://github.com/finalfusion/finalfusion-inspector/tree/rust

@danieldk
Copy link
Member Author

The version in the Rust branch has now surpassed the functionality of the Python version. I guess that this should be the point to make a decision what to put further effort into.

Rust pros:

  • Single, redistributable binary.
  • GUI programming is much nicer than Python. If it's not correct, it typically does not compile, whereas in Python you have to start the application and click through the interface to hit the code path to check whether it is valid.
  • Will make it much easier to use threading in the future.

Python pros:

  • We could leverage Python data science libraries for things like MDS, T-SNE.
  • We could leverage matplotlib for visualizations.

I think the number of visualizations is quite small, since you quickly get in the territory of specific, tailored visualizations. But at least a 2D/3D plot of nearest neighbors would be nice.

@sebpuetz since this is becoming a semi-official finalfusion project, I wondered if you had any strong opinions on the matter.

BTW. the combinations that I used were Python + Qt and Rust + Gtk (Qt for Rust is nowhere yet).

@sebpuetz
Copy link
Member

Considering my other post, I'd probably prefer Rust.

As for the Python pros, these visualizations might look impressive but I'm unsure how meaningful a 2/3D plot of 300-dimensional vectors is. The ecosystem for plotting in Rust might also improve in the future to add those visualizations anyways?

@danieldk
Copy link
Member Author

Considering my other post, I'd probably prefer Rust.

👍 Let's go for Rust then, I'll leave the current Python version around in a branch.

As for the Python pros, these visualizations might look impressive but I'm unsure how meaningful a 2/3D plot of 300-dimensional vectors is.

I guess it can help to understand distances better than a single scalar to see if there are any clusters. Though I played a bit with multidimensional scaling and T-SNE a few years ago and found that with just a few data points (say 50 embeddings), MDS/PCA works pretty well and does not have the instability of T-SNE. And in contrast to T-SNE, it would not be much work to implement.

The ecosystem for plotting in Rust might also improve in the future to add those visualizations anyways?

https://github.com/milliams/plotlib

looks promising.

@danieldk
Copy link
Member Author

danieldk commented Nov 15, 2019

This looks even more complete:
https://github.com/38/plotters

It even has a Cairo backend :D

@danieldk
Copy link
Member Author

danieldk commented Nov 17, 2019

I did encounter a problem: Gtk+ 3 support on macOS is not very good. I knew that it would not render natively-looking widgets (but would just render as on Linux, following some Gtk+ theme). But the rendering is also quite slow (noticable when e.g. resizing windows). There are also some integration issues, e.g.: shortcurts are not translated to macOS cmd shortcuts, the title bar is always <untitled> (despite explicitly setting a title), and the menu bar is not replaced by a native macOS menu bar but uses an in-application menu bar as in Linux.

I'll see how many of these issues can be solved (improving render speed/latency will probably be hard).

(This quite different from Qt, which works very well for a non-native toolkit on macOS.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants