I moved my Neovim config to fennel and haven't look back. https://github.com/Grazfather/dotfiles/blob/master/nvim/fnl/...
https://github.com/kbd/setup/blob/master/HOME/.hammerspoon/i...
71–80 of 106 posts
I moved my Neovim config to fennel and haven't look back. https://github.com/Grazfather/dotfiles/blob/master/nvim/fnl/...
https://github.com/kbd/setup/blob/master/HOME/.hammerspoon/i...
> Another common criticism of Lua is that it lacks arity checks; that is, if you call a function without enough arguments, it will simply proceed instead of indicating an error. Fennel allows you to write functions that work this way (fn) when it's needed for speed, but it also lets you write functions which check for the arguments they expect using lambda. I don't understand this; why is this a speed consideration?
This Fennel:
(fn foo [x y ...]
(print x y ...))
(lambda bar [x ?y ...]
(print x ?y ...))
...transpiles to this Lua: local function foo(x, y, ...)
return print(x, y, ...)
end
local function bar(x, _3fy, ...)
_G.assert((nil ~= x), "Missing argument x on test.fnl:3")
return print(x, _3fy, ...)
end
[1] Fennel's alternative `& xs` vargs format does create a runtime check in functions declared with lambda, but it always evaluates to true because it simply nil-checks the table (here `xs`) that it dumps Lua `...` vargs into.In other words, there are serious drawbacks to using macros that are usually outweigh any benefits they might give you.
>This feature is intentionally listed last because while lisp programmers have historically made a big deal about how powerful it is, it is relatively rare to encounter situations where such a powerful construct is justified.
Earlier quoted context omitted.
Can nvim read it natively or do you need to transpile it?
You don't need to transpile it if you use https://github.com/Olical/nfnl
Earlier quoted context omitted.
What makes Fennel a bit different is that it is a Lisp inspired by Clojure. If for any reason neither of these ever interested you, then, yes, Fennel would not feel any different to you.
The referenced list seems to include a language for every taste; Fennel is also there as one of ~10 Lisp variants.
I moved my Neovim config to fennel and haven't look back. https://github.com/Grazfather/dotfiles/blob/master/nvim/fnl/...
I moved my Hammerspoon config to Fennel and haven't looked back either. The code becomes much more concise vs Lua. https://github.com/kbd/setup/blob/master/HOME/.hammerspoon/i...