Skip to content

Beautiful! #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
youssefavx opened this issue Jan 10, 2021 · 2 comments
Open

Beautiful! #17

youssefavx opened this issue Jan 10, 2021 · 2 comments

Comments

@youssefavx
Copy link

Just wanted to say that this is one of the most beautiful python libraries I've ever come across. Not only does it simplify a whole lot, reducing a lot of steps, it also brings python that much close to English.

If only this could actually become syntax in Python! I wish this came as a default of the language. Do you know how this might be implemented into Python such that I don't even need to do:

from metafunctions import node

@node

before functions?

@ForeverWintr
Copy link
Owner

Thanks for checking it out, and for the kind words!

If you're interested in a language modification that includes functionality like this, you might be interested in coconut. It adds similar syntax, and compiles to python.

In general though, I would be hesitant to add this to python itself. I think metafunction behaviour could be quite surprising if you're not expecting it, and the @node decorator helps document that decorated functions are different. As the Zen of Python says, "Explicit is better than implicit".

@youssefavx
Copy link
Author

youssefavx commented Jan 13, 2021

Looks neat thank you!

I take your word for it since you know much more about it than I do but still would be nice! Could still be explicit while not being repetitive I feel. For instance, something like "make all functions in this script have an @node on them automatically" at the top of the script would make it less tedious than writing it for every function for a very long file. Also, I think explicit vs. implicit is subject to interpretation, meaning, to a complete beginner def is really not that explicit, doesn't really reveal a whole lot about what that means whereas function is a bit more descriptive but still may not tell the whole story to a beginner. I think the closer it is to English the better, but you mention the important caveat that one wants to avoid unexpected behavior / code that is really difficult to debug since you dont know where it comes from, and I definitely agree on that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants