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

Incremental compilation / linking? #936

Open
Boscop opened this issue Oct 24, 2022 · 1 comment
Open

Incremental compilation / linking? #936

Boscop opened this issue Oct 24, 2022 · 1 comment

Comments

@Boscop
Copy link

Boscop commented Oct 24, 2022

Thanks for all your work on Gluon, it seems like the most well-designed embeddable scripting language for Rust hosts :)
My use case (procedural music composition / live scripting) requires a fast edit->compile->run cycle (low latency) (which is why I abandoned my previous approach of using Rust for scripting via auto-recompilation & DLL auto-reloading).
I'm interested in using Gluon for this use case, so I'm wondering how I can reduce the latency of the edit->compile->run cycle to be as low as possible.
Most scripts consists of a few imports from std plus a few imports of user-written modules. E.g. the main module imports std and foo (where foo imports bar). If the user only edits the main file and saves that, it should not recompile std nor foo nor bar, only main. The other modules should only be linked. If the user then edits bar, it would only recompile bar and foo and main but not std.

How can this be done? :)

And what kind of latency can be expected as modules grow large (many symbols)?


(Another alternative I considered was using Haskell instead of Gluon because most of potential users already know Haskell, but with Haskell/curryrs the latency of the edit->compile->run cycle would probably be higher?)

@Marwes
Copy link
Member

Marwes commented Oct 25, 2022

Salsa is used internally which will ensure that only modules that are changed (and any modules that depend on changed modules, recursively) will recompile between each run. Assuming you keep the salsa database alive that is (it is stored in the gluon thread, and shared to all child threads).

Word of warning though, I have not worked on gluon for a long time and I have no plans to pick it up again. There are still things I'd like to do with it, I just have other interests now.

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

No branches or pull requests

2 participants