~jaawerth


#137 with-open breaks when `debug` module unavailable 21 days ago

enhancement added by ~jaawerth on ~technomancy/fennel

#137 with-open breaks when `debug` module unavailable 21 days ago

newbie-friendly removed by ~jaawerth on ~technomancy/fennel

#137 with-open breaks when `debug` module unavailable 27 days ago

Comment by ~jaawerth on ~technomancy/fennel

Thinking about it more, I'm actually not immediately sure how much we can improve things when traceback is missing. Might just have to have an unfriendly error in the absence of debug, but if nobody else takes it on I'll mess with it when I'm more awake at some point. In the meantime, the identity fallback would at least allow the macro to work.

#137 with-open breaks when `debug` module unavailable 28 days ago

newbie-friendly added by ~jaawerth on ~technomancy/fennel

#137 with-open breaks when `debug` module unavailable 28 days ago

Comment by ~jaawerth on ~technomancy/fennel

This one should be pretty friendly for someone new to hacking on the compiler, since it's mostly just a matter of formulating a decent fallback value for traceback in the let binding here.

(let [; ...stuff
      traceback `(. (or package.loaded.fennel debug) :traceback)] ; ...etc
  )

We could just pass an identity function there to prevent an error and let it spit out the message as-is, which would be good for starters anyway, and only tweak if further if we think we think the incremental improvement is worth the extra complexity.

#137 with-open breaks when `debug` module unavailable 28 days ago

Ticket created by ~jaawerth on ~technomancy/fennel

I came across this somewhat accidentally: the mlua Rust bindings (which are used by, among others, WezTerm for its lua config) doesn't expose the debug module, at least by default.

Fennel still runs fine in it for the most part (especially doing AOT compilation), but with-open breaks due to the assumption that it's there.

I think "no debug" is worth supporting, since there are a number of usecases for sandboxing it out (in mlua's case, because it's not memory safe), and in the case of with-open it should be easy enough to add a check and fallback.

#side note: debug.getinfo & fennel.traceback

This also means fennel.traceback breaks; this may also be worth exploring fallback behaviors but I'm not sure that can be done as cleanly without looking into it. Might just be a case of having it give up and spit out lua stacktraces with a "welp, guess we'll have to enable correlate"

#131 assert-compile originating from macros prints duplicate friend.fnl lines a month ago

Comment by ~jaawerth on ~technomancy/fennel

EDITED: This was a red herring! See edited bug description.

#134 1.2.0 blocks macros from shadowing macros/specials a month ago

Comment by ~jaawerth on ~technomancy/fennel

jaawerth referenced this ticket in commit a0c4c39.

REPORTED RESOLVED FIXED

#134 1.2.0 blocks macros from shadowing macros/specials a month ago

Comment by ~jaawerth on ~technomancy/fennel

Submitted a fix in branch fix-todo-134-macro-shadowing. I'll leave it up for a bit for review before merging.

#134 1.2.0 blocks macros from shadowing macros/specials a month ago

Comment by ~jaawerth on ~technomancy/fennel

Poking at it a bit, it's quite difficult to shadow a special from a macro even when it is allowed, as macros don't have access to their parent AST, so I've opted to leave the anti-specials-shadowing in.