Olical / aniseed

Neovim configuration and plugins in Fennel (Lisp compiled to Lua)
https://discord.gg/wXAMr8F
The Unlicense
606 stars 28 forks source link

Files don't get recompiled if require-macro file changes #41

Closed elkowar closed 3 years ago

elkowar commented 3 years ago

If i change my macros file, included via require-macros, the file does not properly get reapplied. For it to apply the changes, I currently need to make a minor change in the file I want to have recompiled.

Expected behaviour

Changing a macro causes all files that require-macro it to be recompiled

Olical commented 3 years ago

I think I've run into this before... I don't think I can solve it in a general sense without performing static analysis. I honestly can't think of a way that doesn't involve a huge amount of work. I currently rm -r ~/.config/nvim/lua when I perform my package updating / dotfile syncing which solves any of these inconsistency problems. I'll give it a little more thought.

Maybe I could make it so if you change a file ending in macros.fnl (which I already kinda treat as a special file) everything gets recompiled.

I should probably simplify things so if a file has changed I recompile everything, if nothing changed I do nothing 🤔 I think that's a better approach and fits the use case just fine tbh.

Olical commented 3 years ago

Hmm yeah, I think I'm doing a really dumb optimization that I don't need to do. By only compiling changed files I save maybe 2ms but incur weirdness like this. I think I'll check for any *.fnl changes in the dir, if there are any I'll recompile everything.

elkowar commented 3 years ago

Yea, I'd argue just checking for any fennel files to change is more than enough. When I'm actively working on config it's reasonable to say "hey I'll tolerate the 2ms increase in startup time" :P And conditional partial recompilation is always a finnicky, difficult subject that's prone to breaking!

I agree with recompiling everything on change 👍🏻

Olical commented 3 years ago

It would only be 2ms if something has changed, is what I mean. So it's really silly that I'm only compiling what changed when all the cost is in loading the compiler. I'm completely guessing at times, but I want to optimise the "nothing changed" case, the "something changed" branch can afford to be a tiiiiny bit slower imo.

On Sun, 9 May 2021, 11:58 ElKowar, @.***> wrote:

Yea, I'd argue just checking for any fennel files to change is more than enough. When I'm actively working on config it's reasonable to say "hey I'll tolerate the 2ms increase in startup time" :P And conditional partial recompilation is always a finnicky, difficult subject that's prone to breaking!

I agree with recompiling everything on change 👍🏻

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Olical/aniseed/issues/41#issuecomment-835781313, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACM6XKG7GYXA26PBWWGKT3TMZTFFANCNFSM44N644UQ .

elkowar commented 3 years ago

yea exactly "something has changed" is only gonna happen while I'm actively working on my config - where it really doesn't matter. Fully agree here!

Olical commented 3 years ago

Should be fixed on develop 😄