Live data from Hacker News

Fennel: A Practical Lisp

mattroelle.com

21–30 of 91 posts

Re: Fennel: A Practical Lisp

#21

So, I don't exactly see how one uses this in an already-embedded Lua. For example, my son knows Lisp, and a bit of Lua because he uses PowderToy, which (to your point) has built-in Lua. So if he wanted to program his Lua extensions to PowerToy in Lisp (Fennel) instead of Lua, how would he go about it, exactly? Compile outside of PT from Lisp to Lua and then load the Lua code into PT, or, run the Fennel Lua code on PT…

The primary maintainer of Fennel, Phil Hagelberg, has put together some brief instructions on how to get Fennel running inside of Powder Toy for you :) https://p.hagelb.org/hello-powdertoy.fnl.html

Re: Fennel: A Practical Lisp

#22
I've been considering rewriting a bunch of my stuff in Fennel since it has two other advantages the article doesn't point out: both Lua and Fennel are _very_ stable and unlikely to go through major changes over, say, the next five years or so.

That kind of thing also has a lot of value when you only want to write something once.

Re: Fennel: A Practical Lisp

#24
post #19

Fennel is really cool, and the fact that it builds on Lua—an already-popular language—is a huge win; Fennel gets access to the entire Lua ecosystem. Importantly, Lua is pretty easy to embed in native applications. I haven’t found a Lisp or Scheme as easily-embeddable as Lua(+Fennel). It’s also a good drop-in replacement for Lua. I write my Hammerspoon config in Fennel, and hopefully my Neovim config soon as well.

Chibi scheme is easily embeddable. Guile is a different beast to manage, but then you get a lot more power and speed. Not luaJIT speed, of course, but a lot faster than vanilla lua, and with proper threads as a bonus. The others I haven't tried embedding, but I hear racket is really no fun to embed,but things might have changed with the chez transition.

Chibi Scheme, interesting. Also beautiful. Thank you.

Racket CS is also quite fast, comparable to Lua or faster (for numeric ops). It also uses rational numbers which makes it useful for exact numeric operations.

Re: Fennel: A Practical Lisp

#26
Curious how this compares to Guile.

Guile is designed for embedding. But it is vanilla Scheme, which might not be as modern as the Fennel flavor.

Maybe, the Fennel all gets lowered to Lua at build time, so you don't need a (maybe more expensive) Guile runtime? Or, Lua has a more comprehensive library ecosystem?

Re: Fennel: A Practical Lisp

#27
I love Lua and the Lua community, but as a native Windows user, it's historically been a nightmare to use. To this day, I have never gotten LuaRocks to work reliably on Windows.

This is very different than Node + NPM, which you can get set up and going in <5 minutes.

Re: Fennel: A Practical Lisp

#28

I love Lua and the Lua community, but as a native Windows user, it's historically been a nightmare to use. To this day, I have never gotten LuaRocks to work reliably on Windows. This is very different than Node + NPM, which you can get set up and going in <5 minutes.

So, another advantage, then?

Re: Fennel: A Practical Lisp

#29
post #28

I love Lua and the Lua community, but as a native Windows user, it's historically been a nightmare to use. To this day, I have never gotten LuaRocks to work reliably on Windows. This is very different than Node + NPM, which you can get set up and going in <5 minutes.

So, another advantage, then?

I'm not sure I follow; it's an advantage that it doesn't work well on Windows?

Re: Fennel: A Practical Lisp

#30

Fennel is really cool, and the fact that it builds on Lua—an already-popular language—is a huge win; Fennel gets access to the entire Lua ecosystem. Importantly, Lua is pretty easy to embed in native applications. I haven’t found a Lisp or Scheme as easily-embeddable as Lua(+Fennel). It’s also a good drop-in replacement for Lua. I write my Hammerspoon config in Fennel, and hopefully my Neovim config soon as well.

As a fellow hammerspoon user who is not smitten with Lua’s syntax, I would really appreciate seeing your config :-)
Post reply on HN