Why Fennel?

https://news.ycombinator.com/rss Hits: 23
Summary

Fennel is a programming language that runs on the Lua runtime. Why Lua? The Lua programming language is an excellent and very underrated tool. Is it remarkably powerful yet keeps a very small footprint both conceptually as a language and in terms of the size of its implementation. (The reference implementation consists of about nineteen thousand lines of C and compiles to 278kb.) Partly because it is so simple, Lua is also extremely fast. But the most important thing about Lua is that it's specifically designed to be put in other programs to make them reprogrammable by the end user. The conceptual simplicity of Lua stands in stark contrast to other "easy to learn" languages like JavaScript or Python--Lua contains very close to the minimum number of ideas needed to get the job done; only Forth and Scheme offer a comparable simplicity. When you combine this meticulous simplicity with the emphasis on making programs reprogrammable, the result is a powerful antidote to prevailing trends in technology of treating programs as black boxes out of the control of the user. And yet... So if Lua is so great, why not just use Lua? In many cases you should! But there are a handful of shortcomings in Lua which over time have shown to be error-prone or unclear. Fennel runs on Lua, and the runtime semantics of Fennel are a subset of Lua's, but you can think of Fennel as an alternate notation you can use to write Lua programs which helps you avoid common pitfalls. This allows Fennel to focus on doing one thing very well and not get dragged down with things like implementing a virtual machine, a standard library, or profilers and debuggers. Any library or tool that already works for Lua will work just as well for Fennel. The most obvious difference between Lua and Fennel is the parens-first syntax; Fennel belongs to the Lisp family of programming languages. You could say that this removes complexity from the grammar; the paren-based syntax is more regular and has fewer edge cases. Sim...

First seen: 2025-04-13 18:01

Last seen: 2025-04-14 16:05