Live data from Hacker News

Why Fennel?

fennel-lang.org

71–80 of 106 posts

Re: Why Fennel?

#71

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...

Re: Why Fennel?

#72

> 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?

Declaring a function with `lambda` prepends runtime nil checks for each argument to the function body (excluding optional args-- specified with a question mark, eg. `?x`-- and variable arguments, eg. `...`[1]).

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.

Re: Why Fennel?

#74

I moved my Neovim config to fennel and haven't look back. https://github.com/Grazfather/dotfiles/blob/master/nvim/fnl/...

So basically Emacs with Elisp replaced with Fennel and a more responsive UI...

What if I don’t want to run a daemon for my text editor?

Re: Why Fennel?

#75
> Finally Fennel includes a macro system so that you can easily extend the language to include new syntactic forms. 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.

In other words, there are serious drawbacks to using macros that are usually outweigh any benefits they might give you.

Re: Why Fennel?

#76
Refreshing pragmatism re: macros

>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.

Re: Why Fennel?

#79
post #50

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.

Like I said, if one likes Clojure but has to write for a Lua-enabled platform, Fennel is the best choice today, since there's no Clojure dialect for Lua, like ClojureScript or ClojureDart. Fennel although inspired by Clojure, still a very different language. Phil Hagelberg, AKA @technomancy, is the maintainer, a well-known and highly respected Clojurista.

Re: Why Fennel?

#80
post #71

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...

Me too, actually. Maybe that would have been a more notable thing for me to mention. I use and contribute to Spacehammer.

https://github.com/agzam/spacehammer

Post reply on HN