v3.22.0
So many commits! A bunch of fixes, optimisations and improvements! I'll try to list them here but I may miss some things. It's been a lot of work to carefully change so much behind the scenes, I took my time with it because I didn't want to break everyone's config and plugins.
Also I've just had a lot less time and energy recently so it's been difficult to get this large refactor across the line but I'm glad it's finally here. Now I can settle in for some regular smaller fixes and improvements over time. Enjoy! ❤️
Fennel updates
Updated Fennel past 0.10.0+ and dealt with any breaking changes. I've tried my best to insulate you from the Fennel env changes, let me know if something goes wrong in your config though! You may notice some symbols not being allowed by the compiler any more.
This is a good thing to handle now since Fennel is gearing up for a v1 release, so they're releasing more breaking changes than ever before right now which is to be expected. That should stabilise soon and I hope I've completely protected you from any compiler API changes.
Replaced simple legacy Fennel eval with REPL based eval
So now every Fennel buffer gets it's own REPL state which you can reset with the new <prefix>rr
and <prefix>ra
bindings if you get into a pickle with unmatched parens or something.
This means the module macros are now optional, yep, optional! I'll still use them, but you don't need to for your evaluated locals and functions to stick around. You'll still get some bonuses with the module macros like convenient private/public module values without messing with a table, I still highly recommend them personally.
You can actually use this REPL in your own code if you want to, check out the aniseed.eval
module and the repl
function for more information. I wrapped up the Fennel REPL code in a coroutine based container, it's pretty neat!
Module macros completely rewritten
They now produce FAR FAR FAR less Lua, it's basically down to the absolute bare minimum which should mean faster load times and easier debugging. Let me know the before and after of your startup times, I'd love to know if there's a difference!
I've tried to produce idiomatic Lua through some macro sourcery and source file post processing. It actually works really well but took me a while to get it just right.
I had to rewrite the module macros while using my config + conjure + aniseed to actually do the work, which meant I couldn't really restart Neovim until I had everything correct otherwise everything would recompile with bad macros and explode. Fun times! It works brilliantly now though 😄 further improvements via PR are still appreciated, just open an issue or something and chat to me about it first.
As a contrived example, the aniseed.view
module went from this:
Click to expand!
local _2afile_2a = "fnl/aniseed/view.fnl"
local _1_
do
local name_4_auto = "aniseed.view"
local module_5_auto
do
local x_6_auto = _G.package.loaded[name_4_auto]
if ("table" == type(x_6_auto)) then
module_5_auto = x_6_auto
else
module_5_auto = {}
end
end
module_5_auto["aniseed/module"] = name_4_auto
module_5_auto["aniseed/locals"] = ((module_5_auto)["aniseed/locals"] or {})
do end (module_5_auto)["aniseed/local-fns"] = ((module_5_auto)["aniseed/local-fns"] or {})
do end (_G.package.loaded)[name_4_auto] = module_5_auto
_1_ = module_5_auto
end
local autoload
local function _3_(...)
return (require("aniseed.autoload")).autoload(...)
end
autoload = _3_
local function _6_(...)
local ok_3f_21_auto, val_22_auto = nil, nil
local function _5_()
return {}
end
ok_3f_21_auto, val_22_auto = pcall(_5_)
if ok_3f_21_auto then
_1_["aniseed/local-fns"] = {}
return val_22_auto
else
return print(val_22_auto)
end
end
local _local_4_ = _6_(...)
local _2amodule_2a = _1_
local _2amodule_name_2a = "aniseed.view"
do local _ = ({nil, _1_, nil, {{}, nil, nil, nil}})[2] end
local serialise
do
local v_23_auto
do
local v_25_auto
local function _8_(...)
return require("aniseed.deps.fennelview")(...)
end
v_25_auto = _8_
_1_["serialise"] = v_25_auto
v_23_auto = v_25_auto
end
local t_24_auto = (_1_)["aniseed/locals"]
t_24_auto["serialise"] = v_23_auto
serialise = v_23_auto
end
return nil
To this!
Click to expand!
local _2afile_2a = "fnl/aniseed/view.fnl"
local _2amodule_name_2a = "aniseed.view"
local _2amodule_2a
do
package.loaded[_2amodule_name_2a] = {}
_2amodule_2a = package.loaded[_2amodule_name_2a]
end
local _2amodule_locals_2a
do
_2amodule_2a["aniseed/locals"] = {}
_2amodule_locals_2a = (_2amodule_2a)["aniseed/locals"]
end
local function serialise(...)
return require("aniseed.deps.fennelview")(...)
end
_2amodule_2a["serialise"] = serialise
Update runtimepath usage to support Neovim 0.5.1+
Neovim made some breaking changes in their latest release / nightlies around runtimepaths. I think I've addressed that all but do let me know if you spot something playing up on the nightly builds. I use stable but from unstable NixOS, so I update fairly quickly.
I also took this time to modernise my Fennel compiler path setup, I'm now mangling and setting less path strings which is nice.
Bumped the minimum required Neovim version
Be careful! Conjure and Aniseed now require Neovim 0.5.0+! That's because I'm beginning to rely on some pretty essential features introduced in 0.5 that allow me to pass functions across the VimL -> Lua boundary.
That's all the big ones!
There's a bunch of other smaller commits and fixes but that covers everything major I think. I hope you enjoy and your new smaller config loads a little faster for you.
Let me know if you hit any issues and have a great rest of your week!
Now to go and release the Conjure update...