8 ms·
For CGI you need a interpreted language that start up fast. Last I checked Perl5 is still the king. Writing CGI scripts with node.js is theoretically possible
by derekzhouzhen 4y ago
For CGI you need a interpreted language that start up fast. Last I checked Perl5 is still the king.
Writing CGI scripts with node.js is theoretically possible but you are in for a lot of pain.
- rascul 4y agoIt doesn't have to be an interpreted language. As long as you can read environment variables and write to stdout then it can be any language.
- dizhn 4y agoPHP's original creator was doing this with C when he decided to write a simpler alternative I believe.
- derekzhouzhen 4y agoYou can do CGI in C, but isn't it defeating the biggest advantage which is simplicity?
- rascul 4y agoI don't necessarily find that adding a compiler step defeats the simplicity, if simplicity is the goal. It might be easier to use a language with better string handling than C, though.
- int_19h 4y agoIt is, since C has horribly deficient string handling facilities in its stdlib. But a compiled language is not necessarily C. And, well, simplicity can be relative: if you already know language X, using it will likely be simpler for you than some other better language that you would have to learn first. The beauty of CGI is that its simplicity makes it a language-agnostic API, letting you pick the simplest language for yourself.
- ihateolives 4y agoWe had CGI program written in C in production in 1999 or thereabouts. Worked fine. The problem was, that there was only one person who could understand it and update it. It was ditched at some point in favour of PHP I think.