Comments (2)
(each [k _ (pairs fennel.macro-loaded)]
(tset fennel.macro-loaded k nil))
in compiler.compile-string
fixes issue, but means every compile call will fetch and compile macro modules.
- Will give slower compile performance:
- make (manually) -- probably not a huge deal, the act of typing is probably slower than the build,
- auto-make (on save) -- noticeable,
- diagnostics (during editing) -- will extend delay when leaving text buffer ,
- require (when compile needed).
- Will give better UX when:
- Editing files that have had macros change (eg: adding
x
tom1
wont show "m1 does not have x function
" when importing it without restart. - auto-make (actually functional), this is probably the bigger issue as it can "say" building was all ok but the macros have not changed, so the code has not changed.
- Editing files that have had macros change (eg: adding
In some respects I think the performance isn't a huge deal. Compiling is already "slow" compared to anything else, so it being a bit slower (probably not to a noticeable degree unless the given files use lots of complex macros) might be a reasonable trade off for the better diagnostics and clearer-functioning auto-make.
Potentially the compile could be run in its own thread, which gets its own state. Either a fresh thread could be built per-compile-entry (probably not "per compile call"), which would incur some start up time and "config" time where hotpot is loaded again, etc (this is ~7-8ms), or a persistent thread could exist that compiles when needed, and nukes the macros-loaded table each time but the performance hit wont be as "felt".
The off-thread compile has been considered before (#92, was blocked waiting on nvim 0.8) when working on ruin.fnl which has very complex macros, and is particularly slow when editing large test files that generate 10x lua code.
Next:
- See viability of only nuking when
make
is running. Passing an extra flag to the compiler? The check requires fennel in memory, but that could be checked "in make"? If fennel exists, nuke the table, otherwise there is no need, fennel will load in the compiler fresh anyway. Least impact on performance, adds another "quirk" to that branch. - Otherwise include the above
each
loop.
Then,
- See viability of off-thread compilation.
- adds dragons, might still be worth it.
from hotpot.nvim.
Mitigation in 9297ab3
from hotpot.nvim.
Related Issues (20)
- `vim.loader` support HOT 1
- Diagnostics includes path before message
- Problems installing... hotpot.searcher.module not found when using lazy.nvim HOT 2
- Bump to fennel 1.3.1
- Problems for using api.make to build ~/.config/nvim/init.fnl HOT 5
- Broken on Windows because `vim.fs.normalize` converts all path separators to forward slash (`\` -> `/`) HOT 4
- lazy.nvim conflicts with fnl ftplugins HOT 5
- Diagnostics autocommand cant be deleted when a buffer is renamed
- Windows RUNNER~1 paths HOT 2
- Automatically load `plugin/*.fnl` files HOT 1
- attempt to call local 'glob_search' (a nil value) HOT 3
- "The hotpot.api.make usage has changed" on v0.9.7 HOT 4
- How to reduce startup time besides using `vim.loader.enable()`? HOT 2
- Diagnosing slow api.make.build() performance HOT 3
- `(include mod)` depends on CWD / fennel.path value HOT 1
- Error loading `init.fnl` looking in `.config/fnlm/fnl` instead of `.config/nvim/fnl` HOT 4
- Compiler environment for plugins HOT 2
- Using `folke/lazy.nvim` with module-name/string plugin definitions HOT 27
- `include` path behavior should match `require` behavior HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hotpot.nvim.