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

Allow user input #49

Open
ulysses4ever opened this issue Jul 10, 2024 · 2 comments
Open

Allow user input #49

ulysses4ever opened this issue Jul 10, 2024 · 2 comments

Comments

@ulysses4ever
Copy link

Hey! This surely has come up before somewhere: how hard would it be to add the ability to read user's input? I guess the most annoying part is how to structure the UI?

There's a post on Discourse from someone learning Haskell and trying to get a LYAH example with input working... https://discourse.haskell.org/t/9859

@tomsmeding
Copy link
Collaborator

tomsmeding commented Jul 10, 2024

The primary issue is that the current execution model is completely batch-based: the program is sent to the server, which assigns a worker to compile and run it; the worker then sends back the output, which gets routed back to your browser. If the user input functionality is supposed to be interactive (just an additional field for an input blob which is sent to stdin as-is is not very useful, I think), this overturns this whole model. And if we are to support such an interactive session anyway, it would be even better if we could also have an interactive ghci session on the playground.

But all that takes a surprising amount of engineering, and raises questions around time allocation and spam control. That's why none of this has been implemented yet.

Unless you think an extra <textarea> for input to be made available on stdin is more useful than I thought?

@ulysses4ever
Copy link
Author

just an additional field for an input blob which is sent to stdin as-is is not very useful

Agreed.

If the user input functionality is supposed to be interactive... this overturns this whole model.

Oh my, I keep forgetting about this model although I learned it at some point. Yeah, this sounds like a big undertaking.

I won't hold my breath then. But this ticket may be useful for future reference. Thanks!

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