Preferences

what is this, why is 95% of the file useless comments: https://github.com/raaidrt/tacopy/blob/main/src/tacopy/unpar...

you're calling a built in function, why make obfuscate this in an "llm way"


It's very llm-y. But, kudos to them for preserving the commit history / being honest about it.
Haha this is my first attempt at making an open-source tool - I don't really know what kind of comment hygiene we want here.
I also don’t think it’s actually tail call optimization, but rather an “unrecurser”.

I’m also not convinced that this actually is worth the effort, considering it’s doing runtime rewriting of Python using Python.

It's a suboptimal implementation but it's interesting for the purpose of transpiling something like Scheme or ML or maybe Purescript to Python.

Historically, suggestions to make Python tail recursive were rejected on the theory that the added stack frames helped debugging, and that Python was supposed to be an imperative language. But it has been dragged into supporting some FP idioms over the years and that has seemed like a good thing.

Certain function calls that were unable to be run in Python can now be run. From that perspective, my thinking was that this was a net good since one can preserve the "clean syntax" from recursion while still being able to access the performance benefits of an iterative solution.

This item has no comments currently.