How is a new web programming language written ?

I'm wondering how programmers develop new web programming languages because I want to learn how everything begins from the start. Let's say I'm planning to write a new language for the Web. How do I do this? Is there anyone who knows about the way web programming languages first appear ? I'm asking these questions because I'm particularly interested in the World Wide Web.

I don't think there's much mysterious about it. Someone writes a language and people like it and its use begins to spread.

A web server can run programs from whatever programming language you desire through its CGI backend -- person retrieving webpage causes apache to execute the program /var/www/localhost/cgi-bin/my-fancy-program and send the program's stdout output to the person's web-browser raw. You can even write a web program as a plain Bourne shell script and it's a bit illuminating to do so -- you can see where all the data comes from, with server variables as environment variables and POST data fed into your program's standard input (if memory serves) and no commandline arguments whatsoever. Someone at the university was silly enough to write the school's web-based scheduling system in prolog of all things, and the server couldn't handle the strain...

The only thing that differentiates a web programming language from any other language, I think, is built-in features which make communicating with the CGI (Common Gateway Interface) easier. You can insert PHP code inside HTML for one thing -- it still has to be processed on the server-side, of course, but having your webpage and your web code in the same document is something that's awkward or impossible in many other languages.

PHP also slurps up all the POST output and relevant server variables into its own special variables for your convenience and comes with many more features besides for communicating with web servers and web clients. You can print all the text needed to set up a cookie with a few library calls and so forth. They've also improved its performance by integrating it more tightly with the web server so it doesn't need to run a fresh copy of PHP every time. They didn't have to do that, it was just advantageous to do so.

And even though it's a web programming language, PHP can still be used for other purposes, even on the commandline. Because of the way you can insert PHP inside other text documents inside <?php program_code(); ?> tags, I've occasionally found it useful for templates.