views:

74

answers:

3

I'm looking for references stating how to write a web scripting language and interface it with a web-server.

I'm not looking for "how to write the language" or "how to write an interpreter" references rather - I don't know how the basics of a web-script interpreter work? Is it a simply a CGI based interpreter that is passed the HTTP parameters through stdin then interprets the script and pushes the output back to stdout?

What about interfacing and registering with the web-server (IIS, Apache) how is that done? Again, through stdin/stdout?

Any basic examples, references or comments would be appreciated.

A: 

This is certainly going to be server-dependent. Apache is very modular and afaik uses own IPC protocol. In any case, the interpreter should be something that is started up once for the server, not once per request. As far as IPC, stdin is one option as you mentioned; others would be shared memory, pipes, or localhost TCP.

abc
A: 

Is it a simply a CGI based interpreter that is passed the HTTP parameters through stdin then interprets the script and pushes the output back to stdout?

It could be.

What about interfacing and registering with the web-server (IIS, Apache) how is that done?

If it is CGI, then you would use their built in CGI modules.

Otherwise, you might use FastCGI (again with built in modules), or the APIs provided by the server: Apache, IIS

David Dorward
@David - Those links are extremely helpful. Thank you.