Skip to content
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

Library support and import #261

Open
Emnolope opened this issue Aug 18, 2019 · 1 comment
Open

Library support and import #261

Emnolope opened this issue Aug 18, 2019 · 1 comment

Comments

@Emnolope
Copy link

This is a feature request. It'd be cool if Pyth supported importing libraries, albeit abbreviated ones. This would allow for some ridiculously complicated code at very low character lengths. There are already standard abbreviations such as numpy = np, module=mdl, pandas=pd .

@jakobkogler
Copy link
Contributor

jakobkogler commented Aug 19, 2019

I think it would be quite difficult to integrate such libraries.

First of, all the abbreviations are already valid Pyth codes. E.g. np prints a value and then negates it.
So you would need some different tokens already.
And then you need all kinds of other syntax. How do you create a numpy array? Certainly not with np.array(), since Pyth uses Prefix notation. How do you manipulate with these objects. You would need to overload all kinds of operators, like +, and others, and introduce new ones for the actual useful new functions that the libraries provide.

I agree, it would be cool, however not very realistic. Also I'm not sure if designing and implementing such a system would bring much improvements to this language.

But if you have some concrete plans, I would like to hear them.

Btw, @isaacg1 hasn't responded to any messages since April/Mai (?). So I doubt that anything will happen, unless you (or somebody else) makes a complete fork of Pyth.

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