2018-12-03 Fennel

Fennel is a Lisp that translates straight to Lua. I’d like to learn more about it because @technomancy writes a spaceflight progamming game called Bussard using it.

So I’m doing Advent of Code using Fennel. I’m three days in and I like it so far.

Some weird things I’ve noticed:

  1. There are no breaks from loops! Thus, while you can write a loop with an explicit exit condition like (while (not done?) ...) you have no way to exit a loop like (each [key value (pairs table)] ...).
  2. I miss so many Lisp things, like ... lists! There seem to be no lists in this language. How the hell is this a Lisp? Oh well. Apparently you can use Lua tables as lists, but I keep using them as maps/hashes/dictionaries.
  3. If you use let to create a local binding, you can’t set it! That’s weird for somebody like me who’s used to Emacs Lisp.

If you want to look at my code, take a look at the 2018 folder in my advent repository.

Tags:

Comments


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. Note: in order to facilitate peer review and fight vandalism, we will store your IP number for a number of days. See Privacy Policy for more information. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.