[ANN] Fennel 0.8.0 released!

Message ID
DKIM signature
Download raw message
Hello Fennel friends!

I'm happy to announce the release of version 0.8.0 of Fennel.

The highlights for this version are the new "table comprehension"
macros `collect` and `icollect`, a completely new serializer in
`fennel.view`, and whole-table destructuring using `&as`.

For a long time we considered adding things like `map` and `filter`
into Fennel, but we decided against it because those are easily
brought in by 3rd-party libraries like Lume or Luafun. Fennel has no
runtime, so it can only include macros, and traditional map, filter,
etc are best done as functions. However, taking inspiration from other
languages list comprehensions, `collect` and `icollect` provide
similar benefits but in the form of macros which makes them a much
better fit for Fennel. No more needing to pull in a 3rd-party library
for basic table manipulations.

The new Fennelview is completely rewritten in a way that produces much
more sensible indentation. The previous logic for indentation was very
haphazard and driven by implementation details, now it follows lisp
conventions. But even better is that it allows you to override the
printing behavior with a `__fennelview` metamethod, and allows your
output to get indented in a way that fits nicely with the context.

And then the whole-table destructuring solves a long running problem
of wanting to destructure a table but keep a reference around to the
original. Previously you would have had to do this as two separate
bindings; one for the destructuring and one for all:

(let [{:a a :b b &as all} {:a 1 :b 2 :c 3 :d 4}]
  (+ a b all.c all.d)) ; => 10

The full list of user-visible changes:

* Allow the parser to optionally include comments in the parsed AST
* The fennelview module is now incorporated into the compiler as `fennel.view`
* Fully rewrite fennelview for better indentation handling; see fennelview
  docstring for detailed description of API changes
* Improve printing of destructured args in function arglist in `doc`
* Allow plugins to provide repl commands
* Fix a bug where decimal numbers would be emitted with commas in some locales
* Label auto-generated locals in Lua output for improved readability
* Fix the behavior of `...` inside `eval-compiler`
* Warn when using the `&` character in identifiers; will be disallowed later
* Add whole-table destructuring with `&as`
* Add list/table "comprehension" macros (`collect`/`icollect`)
* Numbers using underscores for readability **may not** begin with an underscore
* Provide `...` arguments consistently with Lua when requiring modules
* Fix a bug where `import-macros` would not respect certain compiler options
* fennelview: respect presence of `__fennelview` metamethod on userdata metatables
* Fix a bug where shebang caused incorrect sourcemapped row/col in stacktraces

Thanks to everyone who contributed to this release; in particular
Thomas Berryhill for the table comprehensions and Andrey Orst for the
new Fennelview.

You can download the latest version here:


I think now we are not far off from a 1.0.0 release!

Please let us know if you run into any issues with this version.

Happy hacking!

Reply to thread Export thread (mbox)