Hasty Briefsbeta

Fennel Libraries as Single Files

11 days ago
  • #Macros
  • #Lua
  • #Fennel
  • Fennel libraries can now be shipped as single files, solving the issue of shipping macros and functions together.
  • Lua's module system is simple and flexible, allowing modules to be treated as plain tables.
  • Fennel's macro system requires macros to be defined in separate files, unlike Lua's functions.
  • A solution for combining macros and functions in a single file involves using `eval-compiler` and `macro-loaded`.
  • The `require-as-include` feature in Fennel allows embedding dependencies directly into the compiled Lua code.
  • Challenges remain with Fennel's macro system, such as macros not being able to use other macros or functions defined in the same file.
  • Proposed improvements to Fennel's macro system include ditching macro modules and allowing macros to use public definitions.