Olical / aniseed

Neovim configuration and plugins in Fennel (Lisp compiled to Lua)
https://discord.gg/wXAMr8F
The Unlicense
606 stars 28 forks source link

Rewrite module system as a compiler plugin #45

Closed Olical closed 3 years ago

Olical commented 3 years ago

I don't think compiler plugins were a thing when I first attempted the module system, so I think it's about time I rewrote it. A compiler plugin is far more suitable I think? Should be able to produce MUCH nicer code and actually be able to maintain it. So consider the current module macros EOL and in maintenance mode until I tackle a rewrite.

I don't think it'll change anything for the users other than their compiled Lua should be far simpler and I'll actually be able to work on the module system without losing my hair :D

Kethku commented 3 years ago

Just wanted to say this sounds amazing to me. Aniseed is a fantastic environment, only brought down by difficult to understand mapping from fennel to actual lua. If I understand what this issue represents, this would go a long way toward fixing that. Sounds awesome

Olical commented 3 years ago

There will still be some level of extra padding added to your Lua, but I think it'll look more idiomatic, right now it looks super hacky because of the nesting and scoping I've had to do to get the macros to work. Hopefully it'll be a LOT more readable and more like what you'd write.

On Mon, 31 May 2021 at 01:59, Keith Simmons @.***> wrote:

Just wanted to say this sounds amazing to me. Aniseed is a fantastic environment, only brought down by difficult to understand mapping from fennel to actual lua. If I understand what this issue represents, this would go a long way toward fixing that. Sounds awesome

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Olical/aniseed/issues/45#issuecomment-851100607, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACM6XICHSGPP35OGEDXAVDTQLNNHANCNFSM45WMCKNA .

Olical commented 3 years ago

Not going to do this since the result will be basically the same for a bunch of work, so the branch is now defunct.

However, I want to change how all Aniseed evals work so they all take place in stateful REPLs that are instantiated for each buffer. This means you won't need the Aniseed module macros at ALL to work with Conjure, they will become optional.

Within that eval environment almost all of the code that currently goes into the macros goes away, they can be FAR simpler if they can rely on state between evals. So my goal is to change the outside eval rules so the macros aren't required but are a thin sugar on top of Fennel instead, for those that want it.