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

x/playground: support reading from os.Stdin #16667

Closed
nathany opened this issue Aug 11, 2016 · 9 comments
Milestone

Comments

@nathany
Copy link
Contributor

@nathany nathany commented Aug 11, 2016

It would be great if newcomers could write interactive programs in The Go Playground by reading from os.Stdin.

E.g. https://play.golang.org/p/vYsHq3MUiO

Google Cloud Shell, nitrous.io, and c9.io have shell environments that support this, but they have associated fees and may be more complex than necessary for someone just starting out.

@cznic

This comment has been minimized.

Copy link
Contributor

@cznic cznic commented Aug 11, 2016

There's no way to cache the results of an interactive program.

@as

This comment has been minimized.

Copy link
Contributor

@as as commented Aug 11, 2016

Even thought it doesn't allow interactivity, you can read from os.Stdin on the playground if you assign it to another file.

https://play.golang.org/p/Y_6O1stTh1

@nathany

This comment has been minimized.

Copy link
Contributor Author

@nathany nathany commented Aug 11, 2016

Yah, I expected that it would prevent caching, which certainly complicates matters.

@minux

This comment has been minimized.

Copy link
Member

@minux minux commented Aug 14, 2016

@nathany

This comment has been minimized.

Copy link
Contributor Author

@nathany nathany commented Aug 15, 2016

Thanks for the input -- definitely some things I hadn't considered.

I will continue writing Learn Go to use the Go playground without an expectation of this happening anytime soon. The section on branching with if would be more realistic if the conditions for branching weren't hardcoded values or cached random numbers -- but it's not the end of the world.

@quentinmit quentinmit added this to the Unreleased milestone Aug 26, 2016
@ysmolsky

This comment has been minimized.

Copy link
Member

@ysmolsky ysmolsky commented Mar 13, 2018

Playground is not supposed to be interactive platform. I would say implementing this feature requires another different beast than what we have. Don't want to be a party pooper but does it make sense to leave such bugs open when we cannot solve them, @andybons ?

@andybons

This comment has been minimized.

Copy link
Member

@andybons andybons commented Mar 13, 2018

Yeah I think this is outside the (admittedly non-codified) scope of playground. Closing.

@andybons andybons closed this Mar 13, 2018
@bastianccm

This comment has been minimized.

Copy link

@bastianccm bastianccm commented Aug 2, 2018

Hi,

#3806 (comment) suggests that using an input field / textarea might be simpler way of implementing this, and would actually allow to cache (and share) the program.
Essentially it's just a static buffer this way, which is attached to the NaCL sandbox's stdin.

If you guys think it makes sense to give it a try, I'd be happy to take over.

@andybons

This comment has been minimized.

Copy link
Member

@andybons andybons commented Aug 2, 2018

@thebod thanks for the offer. We're not going to be adding this functionality any time in the near future.

Perhaps if it was integrated into a playground alternative (e.g. https://goplay.space/) and became super popular we can reconsider, but for now we're going to go without it.

@golang golang locked and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
9 participants
You can’t perform that action at this time.