3 ms·
"It is also a HTTP 1.1 server" You may have mostly implemented one of the things on my list of "ridiculous things I would like to see": a forth-based web serve
by Someone 10y ago
"It is also a HTTP 1.1 server"
You may have mostly implemented one of the things on my list of "ridiculous things I would like to see": a forth-based web server that accepts code URLs. For example
GET foo.com/2/3/+/.
would return a text file containing the number '5', and
GET foo.com/:/square/dup/*/;
would define a new function (technically, that should be a PUT, but who cares, for a ridiculous idea?)
Of course, this should follow the forth philosophy, so URLs like
GET foo.com/forget/forget
would work 'fine'. Connecting such a contraption to the internet might not be the brightest idea, but I think it can be made (more or less) safe by executing every request from within a highly restricted vocabulary. I would guess that's how you implemented your http request handling, but likely only for one-word URLs.
If so, the rest is just a REPL that uses slashes as word separators, so it is easy to write.
- yellowapple 10y agoFaaS: Forth as a Service. I love it.