-- Leo's gemini proxy

-- Connecting to gemini.thegonz.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

gredig

Recently I happened upon lang-8.com, "a language learning platform where native speakers correct what you write".

http://lang-8.com/

The idea sounded neat -- but this is a webby monstrosity with a business strategy, which isn't even accepting new signups. So I didn't get beyond that one-line description.


But this basic idea seems perfectly suited to gemini: you write a short piece of text, say a sentence, in a language you're trying to learn, then a native/expert comes along and rewrites it for you, fixing your errors. Gemini's single-line requests are fine for inputting a sentence. With UTF-8, we can handle any language. With client certificates, we easily have full pseudonymity with no awkward sign-up process.


So I went ahead and hacked together a gemini implementation:

gredig


Please play with it. You can use the "sandbox" pseudolanguage if you just want to see how it works.


Design

My first thought was to use this as an excuse to try out the "RREPL" approach I've mentioned here previously, with a stateful per-user line-based interactive interface. But then I realised that this is the equivalent of "one-page web applications", and has similar downsides -- in particular it makes linking to data impossible.


So instead I went with a dead-simple CGI approach with a collection of shell scripts, with all data stored in directory structures. This means we have globally accessible permanent links to each sentence and any revision. It also means it's all a bit janky, and I might want to rewrite everything if I want to expand the scope significantly. But it'll do for now. Another downside is that interacting with the filesystem means there are race conditions all over the place -- not a problem for now, since I'm using a single-threaded server (molly-brown, with a sed wrapper to redact IP addresses), but not great.

UPDATE: err... actually I just realised that molly-brown does handle concurrent requests, so these race conditions are really a problem! Oops. But after going through looking for possible problems, I didn't find anything which could cause real problems.


I tried to keep the interface pared down; in particular there are no links for upwards navigation, I think that's best left to the client.


Source; you don't want to look at it, still less emulate it, but general principles compel me to provide the source.


Why "gredig"? Well, 'g' for gemini, and 'redig' for rédiger. It doesn't make all that much sense, but this was the name which stuck to my brain.

-- Response ended

-- Page fetched on Sat Apr 20 07:27:58 2024