I'd Still Never Do That (But I Might Do This)
2025-06-30
JBanana stumbled on my post from May 4th about adding scripting to Gemini and wrote a gemlog exploring the idea. Rob S. followed up on his own gemlog.
Basically, I suggested a way to run scripts in a backwards compatible way using preformatted text blocks. Even though I stressed it was only a thought experiment, I've since received an anonymous comment asking that I not implement scripting in Gemini.
Don't worry.
Both JB and RS pointed out security and tracking issues. In my original gemlog, I posited a sandboxed script engine with no access to the network or file system (which would prevent tracking). What could be done in that environment? As JB discovered, not a whole lot. You could roll dice or offer Magic 8 Ball answers with each page refresh. You could display the date in a locale specific format or maybe construct randomized ascii art. How about showing sunrise and sunset times for the browser's locale? Things like that. Not entirely useless but nothing amazing either.
If I really wanted to implement scripting (I don't), I would keep things sandboxed but allow user input and a function call to refresh the text block while retaining state. This would allow client-side text games and other programs without the risk of tracking. For example, I could port my Zoe 3d Tic Tac Toe game to JavaScript. I could even perversely argue that playing Zoe on the client side would afford greater privacy than playing the networked version.
But let me reiterate: I HAVE NO INTENTION OF DOING THIS.
So what might be interesting? I like ascii art that uses Code Page 437 characters. You can use online websites to convert photographs to this format. If you add enough characters to the width of the image and set a very small font size in your Gemini client, you can get a decently detailed picture that's displayable in gemtext.
I think it would be neat if you could do this:
``` fontsize=5
<cool ascii art here>
```
Sure, you could set the monospaced font size to 5 manually (at least in Alhena) but that would affect all text blocks and you'd have to reset it before visiting other pages.
Here's an example link best viewed with a small monospaced font. Most graphical clients should be able to display this page but it's only when you reduce the font size that you can fully appreciate the image.
So no, I'm not seriously proposing scripting for Gemini. Just CSS.
Maniacal laughter.