Loading and saving programs from the playground
There's currently no way to share links to programs in the Zig playground. But there should be a way to save a link to a program in a query string, like this:
https://zig-play.dev/?source_code_goes_here
I would use encodeURIComponent to convert the source code to a query string, and then use decodeURIcomponent to convert it back to source code.
Thanks for opening this issue. I wanted to do this eventually but thought about resorting to using auxiliary storage to do so. This seems like a much simpler way since it would eliminate the need for that. I'd be happy to review a patch if you're willing to write one.
I thought it would be simpler to load and save the programs in a query string or fragment identifier, since it would only require client-side JavaScript without "auxiliary storage" on the server side.
But the query string has a very short size limit, so auxiliary storage might still be better.
Ah yeah, I forgot to think about the query string length limit. I'll try and sketch out a plan for this though. Something using an S3 like storage system and some internal caching should perform well.