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…
Fennel: A Practical Lisp
21–30 of 91 posts
Re: Fennel: A Practical Lisp
#22That kind of thing also has a lot of value when you only want to write something once.
Re: Fennel: A Practical Lisp
#23Re: Fennel: A Practical Lisp
#24Fennel 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.
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
#25Re: Fennel: A Practical Lisp
#26Guile 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
#27This is very different than Node + NPM, which you can get set up and going in <5 minutes.
Re: Fennel: A Practical Lisp
#28I 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
#29I 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
#30Fennel 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.