Live data from Hacker News

Fennel: A Practical Lisp

mattroelle.com

41–50 of 91 posts

Re: Fennel: A Practical Lisp

#41
post #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.

That's a very good point. To add: stability and simplicity are choices. Compare Lua to JS for example which started out similarly but Lua was kept simple and stable, while JS introduced massive churn and tooling complexity, much of it being unnecessary in my eyes.

I don't use Lua anymore but it has a special place in my heart. I started learning it to use Love2d and then got my first job as a developer out of sheer luck (someone I knew saw a demo of the game I was working on).

Back then, I didn't understand why it is important that Lua is how it is. I just thought it was to make it more accessible, and while that is certainly a consideration, I think the bigger value proposition is trust and the ability to keep the whole language in one's head with very minimal effort.

Other languages that optimize for stability and simplicity are Clojure and Go. Their respective ideas of simplicity are different but have some overlap. Both languages are very attractive and deeply relaxing.

Re: Fennel: A Practical Lisp

#42
post #41
post #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.

That's a very good point. To add: stability and simplicity are choices. Compare Lua to JS for example which started out similarly but Lua was kept simple and stable, while JS introduced massive churn and tooling complexity, much of it being unnecessary in my eyes. I don't use Lua anymore but it has a special place in my heart. I started learning it to use Love2d and then got my first job as a developer out of sheer l…

> Compare Lua to JS for example which started out similarly but Lua was kept simple and stable, while JS introduced massive churn and tooling complexity, much of it being unnecessary in my eyes.

Anything you wrote in JS twenty years ago probably still works. Tooling has changed, but none of that's an official part of the JS language. The language has only some added features that you can opt to not use.

If you're comparing the whole JS ecosystem to the Lua and Fennel languages, well that's not really a fair comparison.

Re: Fennel: A Practical Lisp

#43
I tried Moonscript (another lang that compiles to Lua). Unlike JS, it didn't seem like the Lua VM supported source-mapping, so if there was a runtime error in my code, it appeared as a gibberish Lua error and not a MoonScript error. Is the same true for Fennel?

Re: Fennel: A Practical Lisp

#44
post #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.

Agreed, stability is a big plus. I recently decided to take the plunge and start learning Common Lisp, and now it's my favorite language despite some warts.

Being an ANSI standard with multiple cooperative implementations, it's unlikely to change any time soon.

Re: Fennel: A Practical Lisp

#45
I'm concerned about the bus factor of LuaJIT. If the advanced cyborg known as Mike Pall decides to quit (as has happened once already) then what happens? Vanilla Lua performance isn't *bad* by any means, but hardly remarkable compared to LuaJIT.

Fennel looks like a gorgeous lisp. I will probably play with it at some point.

Re: Fennel: A Practical Lisp

#46

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.

Chicken Scheme is embedded in C programs with one line.

https://wiki.call-cc.org/embedding

I've even embedded it in Objective-C programs running in iOS (could make OpenGLES calls in the repl and everything).

Full API spec:

https://wiki.call-cc.org/man/5/Embedding

FFI example:

https://wiki.call-cc.org/An%20extended%20FFI%20example

https://www.more-magic.net/posts/scheme-c-integration.html

Re: Fennel: A Practical Lisp

#47

I'm concerned about the bus factor of LuaJIT. If the advanced cyborg known as Mike Pall decides to quit (as has happened once already) then what happens? Vanilla Lua performance isn't *bad* by any means, but hardly remarkable compared to LuaJIT. Fennel looks like a gorgeous lisp. I will probably play with it at some point.

You can continue to use the LuaJIT that has been released? The Lua language has been very stable and has little need to develop for developments sake.

There are a few things that might be nice to have, but few of them are worth more platform churn.

Re: Fennel: A Practical Lisp

#48

Earlier quoted context omitted.

Not sure when you used Lua but there is a package manager called LuaRocks now which has some pretty nice packages in it for many purposes. I don't think it'd be too hard to get Lua running inside of a Python env either :) https://luarocks.org/

It's really pretty rough compared to everything else I've used. I really don't feel like luarocks solves very many of my problems. A lot of gaps in there, or libraries that only target 5.1, or only luajit. Or are completely unmaintained, or have poorly documented dependencies on C libraries. etc etc. I use lua a lot and like it fine but the build/dependency/tooling situation is a fucking mess. It exposes you to a lot…

Furthermore, you are likely to encounter three different libraries that partially implement your desired feature set.

Re: Fennel: A Practical Lisp

#49

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.

Chicken Scheme is embedded in C programs with one line. https://wiki.call-cc.org/embedding I've even embedded it in Objective-C programs running in iOS (could make OpenGLES calls in the repl and everything). Full API spec: https://wiki.call-cc.org/man/5/Embedding FFI example: https://wiki.call-cc.org/An%20extended%20FFI%20example https://www.more-magic.net/posts/scheme-c-integration.html

Thanks for sharing this, I've bookmarked it to check out more later, but from the links you provided, it looks like Chicken Scheme is pretty friendly to use.

Re: Fennel: A Practical Lisp

#50
What might be a good toy project to try with this? I've had a vague interest in lisp for a while, and fennel seems like a good entry point, I just need some direction on a small project that would be a good fit for the language.
Post reply on HN