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/mobile: example ivy demo on ios should not require a Go installation #48694

Open
robpike opened this issue Sep 30, 2021 · 7 comments
Open

x/mobile: example ivy demo on ios should not require a Go installation #48694

robpike opened this issue Sep 30, 2021 · 7 comments

Comments

@robpike
Copy link
Contributor

@robpike robpike commented Sep 30, 2021

The ")demo" special command runs an interactive demonstration of ivy's abilities, but only prints an error message about the lack of a Go compiler when on iOS.

Fix that. Might require a change to how the demo runs in ivy proper, but should be isolatable to mobile if that makes more sense.

@gopherbot gopherbot added this to the Unreleased milestone Sep 30, 2021
@mknyszek
Copy link
Contributor

@mknyszek mknyszek commented Oct 4, 2021

@robpike
Copy link
Contributor Author

@robpike robpike commented Oct 4, 2021

Actually it's probably my job to fix this.

@robpike robpike self-assigned this Oct 5, 2021
@ydnar
Copy link

@ydnar ydnar commented Oct 5, 2021

@robpike does it work on macOS?

@robpike
Copy link
Contributor Author

@robpike robpike commented Oct 5, 2021

Yes, provided there is a Go compiler installed.

robpike added a commit to robpike/ivy that referenced this issue Oct 12, 2021
Instead of making it a separate program, stitch it in to the binary itself,
meaning that the demo can be run without a Go compiler. The idea was
to make it easier for mobile users to see the demo, (see
golang/go#48694), but that may be a
false hope as I/O on mobile does everything possible to avoid the
Unix idea of stdin and stdout.

Still, it does clean up the way the demo works, and allows us to
remove the runner and explain about it.

Use embedding to interpolate the script into the code. We could use
go generate to avoid needign such a modern feature of Go, but
meh.
@robpike
Copy link
Contributor Author

@robpike robpike commented Oct 12, 2021

robpike/ivy@adacf8f

was done with the intent of helping here, but I naively assumed that the window on iOS had stdin and stdout. Silly me. Still the refactoring may help. The way the mobile connection works now is easy but inflexible.

I might just put in a mechanism so the )demo command can know we're on mobile and give other directions for the demo.

@robpike robpike changed the title x/mobile: example ivy demo should not require a Go installation x/mobile: example ivy demo on ios should not require a Go installation Oct 12, 2021
@robpike
Copy link
Contributor Author

@robpike robpike commented Oct 12, 2021

Important note: There is a Demo menu item on Android and it works fine, but on iOS there is only a Help button. The right thing to do is probably to find a way provide a similar Demo button or menu item on iOS. In either case, as mentioned earlier, the )demo special command could tell the user what to do on mobile.

@robpike
Copy link
Contributor Author

@robpike robpike commented Oct 12, 2021

I just pushed an update to ivy to clarify things a bit: robpike/ivy@670bccd

The solution I am committing to is to have the demo be run by the wrapper, as it is on Android. So we need a Demo button on iOS. I'll reach out to the community for help.

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

Successfully merging a pull request may close this issue.

None yet
4 participants