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 to accept a program using URL #78

Open
certik opened this issue Apr 1, 2023 · 5 comments
Open

Allow to accept a program using URL #78

certik opened this issue Apr 1, 2023 · 5 comments

Comments

@certik
Copy link
Contributor

certik commented Apr 1, 2023

Something like this:

https://dev.lfortran.org/input?i=sin%283.5%29

And the website would execute the equivalent of (this work in interactive LFortran):

>>> sin(0.5)                                                             1,9   ]
0.47942555

And we should then use this mechanism to allow people to use our website to execute Fortran snippets interactively on their website.

@suhanigarg29
Copy link
Contributor

@certik sir, the link provided by you is not opening

@Shaikh-Ubaid
Copy link
Member

Shaikh-Ubaid commented Apr 2, 2023

@certik sir, the link provided by you is not opening

It would not work. It is a feature suggestion. We do not yet have that feature.

@certik
Copy link
Contributor Author

certik commented Apr 5, 2023

Here is an example from another domain: I found this link on Hacker News:

This expands into quite a long URL and goes into page that loads the data, in this case a circuit to simulate, all fully locally (just static site hosting needed, just like we do).

How much data can one store in the URL? According to this answer https://stackoverflow.com/a/417184/479532, one can safely use 2000 characters, which in base64 encoding can store about 1.4KB of data. I managed to modify the Mandelbrot example (https://gist.github.com/certik/b6d162bee7fdd7711722221a90729a2a) to fit into this limit (1.4KB).

So that's one option. The other option is to allow to supply a GitHub Gist URL and/or GitHub url that points to a Fortran file, then we can store much larger programs. I like this idea more, so I created an issue for it: #81.

@Shaikh-Ubaid
Copy link
Member

I too had this idea of using a url shortener :)

Yes, the second option seems better as it allows sharing programs of arbitrary sizes. We need to see how we can create GitHub gists from a static web page.

(Also, is it possible to create gists from a static webpage? I guess it might require some authorization token to be used while creating the gist.

If there is any authorization token required, how do we handle it? Will we be using our own authorization token or do we request the user to generate and share his github gist authorization token?)

@certik
Copy link
Contributor Author

certik commented Apr 5, 2023

(The user would need to create the gist. It should be possible to create it ourselves, I think you can access any page from javascript; however it would require a user's github token, which makes this not friction free anymore.)

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

3 participants