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

LLR-based interpreter #5468

Open
ogoffart opened this issue Jun 24, 2024 · 0 comments
Open

LLR-based interpreter #5468

ogoffart opened this issue Jun 24, 2024 · 0 comments
Labels
a:language-interpreted Interpreter implementation and Rust API for it (slint-interpreter crate) (mO,bT) enhancement New feature or request

Comments

@ogoffart
Copy link
Member

The current interpreter is trying to interpret the data structures from the compiler's object_tree.
It doesn't use the LLR that was written to reduce duplication between Rust and C++ generator.
But it could try to interpret the LLR instead.

(The LLR stands for low level representation, and is a representation of the Slint file suitable for compilation. It's datastructures are in the i-slint-compiler::llr module)

Advantages:

  • reduce code duplication between the interpreter and the LLR lowering phase.
  • The LLR could be made Send and serializable, and we could do the compilation in another thread or process than the visualization. (So the LSP's preview could show a spinner indicator when the preview is being re-compiled)
  • The LLR could be even sent to another device for the preview on device.

(If we re-write the interpreter like so, it might also be worth considering not using the dynamic_type approach that uses lots of unsafe, but use another approach that put each Item and property on the heap. This would remove lots of complex unsafe code which is currently in the interpreter)

@ogoffart ogoffart added enhancement New feature or request a:language-interpreted Interpreter implementation and Rust API for it (slint-interpreter crate) (mO,bT) labels Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:language-interpreted Interpreter implementation and Rust API for it (slint-interpreter crate) (mO,bT) enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant