1993: CGI Scripts and Early Server-Side Web Programming
webdevelopmenthistory.com
webdevelopmenthistory.com
The whole web dev paradigm back then starting from basic HTML files, to client JS, to server-side Perl CGI scripts, was just really easy to wrap my head around, and actually create usable products out of. It maps well to a Windows OS file system -- you have these HTML files sitting in folders, you can write them locally and open them locally to see them. Upload to a server via FTP in the exact same structure, and see it work on the internet. If some files are CGI scripts, they run some code on server before output. Input from browser comes in as stdin in the script, and output to browser is just stdout. It was simple enough that as a high school kid, I was able to start one of those "webmaster services" (providing guestbooks, counters, etc.). I have nothing but fond memories building scrappy stuff back in those days.
On the backend, now you have this fragmentation in Node, Python, PHP, Ruby, Go, Elixir, etc. In the Matt's Script Archive days, CGI scripts were pretty much only Perl. There were other languages used by some, but they were rare. If you wanted to learn Perl CGI scripts, you pretty much downloaded MSA as well as tons of other free scripts and read them, tweak them, play with them and figured things out. (Not unlike how you simply View Source on frontend to learn HTML and JS)
Todays deployment pipeline however have gone completely off track with all of the "large team, big cluster" overhead enforced on even small agile part time projects that don't need even 1 full server.
It just happened to be intern season. In walks some fresh-faced kid and installs mod_perl. Like magic, the entire website stands up, dusts itself off and starts working again. CPU load drops by two thirds. I think the senior engineers were kind of pissed but couldn't really say anything. I think the kid got a beer or two out of the whole thing. (And of course got an offer to stay.)
While I haven't written any significant Perl in a long time, I will always appreciate how much it improved things for me back then.
After that, it was Java all the way.
There should be more simple ways for young people to write and share programs with each other. Maybe that’s what Roblox is, to an extent? I haven’t used it myself.
OK, looks like my memory isn't that good. panda came out in 1998. At the time I was working for a company that paid Y2K bonuses to dissuade us from quitting and moving to the Bay Area. I often wonder how different my life would be if I had done that.
Who am I kidding? I was having way too much fun writing motion control software to do any of that Web crap ;-)
I haven't written it up yet, but basically it's things which are supported by almost every browser and/or almost every web server.
Other things on the list are parts of HTML 3.2, like <p> tags, the standard format of access.log, HTTP/1.1, etc.
I try to not use anything outside of that list in my projects, some JS things being an exception (which I feature-check before using)
Basic CGI reloads the worker program for each request, which is secure but slow. FCGI is an orchestration system. Like Kubernetes, but with lower labor costs. If one of the workers crashes, a new one will be started.
You can run stuff like this on US$10/month shared hosting accounts. To scale up, put a load balancer in front and a replicated database on the back.
It does about 0.00001% of what Kubernetes can do.
Launching processes to handle web requests is pretty basic for any web server.
There's an entire industry, probably worth hundreds of billions of dollars, built around trying to detect insecure code and force it to be less insecure. Meanwhile, this one old language that nobody uses has a single option you enable to be [more] secure by default. And I'll bet you a billion dollars the reason other languages don't have it is "the design doesn't look very clean".
Perl -T helps ensure there’s no tainting of variables - you take the parameter that’s passed and regex pull out the matching pattern you need to use. If your variable is a match of ([\d]+) then it’s only going to have numbers in, and you can use it fairly safely
The problem was that the newbies writing cgi scripts in 1993 generally did not have much experience with input sanitation and had very few libraries to lean on to do it for them.
Modern Web Development are needlessly complicated. Both Front End and Back End. Oh... and deployment.
No mention of server-side includes, which were great -- you could include a nav bar on all your pages and just have one file to update, you could include a 'last updated' line at the bottom based on the file modification, you could include a visitor counter.
I did a website for a local art+book shop back in 1997, it was awful. Stopped updating it after 6 months, but it was kept online for some reason - even after the shop closed. archive.org shows the SSI counter was still incrementing in 2005. I assume the (copy-and-paste) code ran a script that opened a file, incremented the number, wrote it back to the file, then printed the number.
Sure, forking a process per request isn't fast... but I'd love to have enough traffic for that to matter.
There’s literally 20 people that have client certificates that can access my page. I don’t care if they fork a process each.
Sometimes you just need a single file that does a few things and mostly behaves like a webpage. It doesn't need to be deployed or managed or anything. I had this one that served approximately seven requests on average for over a decade. It's simple. It doesn't need any love. It's in the documentation for the overall site because I wrote the documentation, but it isn't "omg this needs an APP and a BACK END and we have to worry about SCALING."
I still have a book somewhere on CGI with Perl and C, from the 1990s. Probably due for a purge.
Or maybe not. I seem to have gotten out of the web business at the right time. It's gone in a direction that makes me grind my teeth.
IMO when programmer did not fight it, it was very good for sanitizing the input. Curious why this did not get more widely adopted?
You can try it out if you have a Gemini client: gemini://zork.club
For these types of things I recommend the diohsc client https://repo.or.cz/diohsc.git although you may need to build from source since he had an issue with Jetforce compatibility and not sure if it's fixed in cabal yet.
But any Gemini client will work such as av98 or Lagrange.
The guy who made diohsc set up something a little more sophisticated using SCGI and he has several interactive fiction on his Gemini server (if it's up). (You can search on gus.guru for gemrepl).
I felt so many times that I was _so close_ to being able to understand how to do this new, exciting CGI thing. Something about the form action? What should that be -- the filename I want to write? Do I put the counter + 1 value there? Oh, it's just GET or POST. Oops.
I bought a book, CGI How-TO, one day at Media Play[0] with some friends while on a brief break from our LAN party setup. (Coaxial networking was a huge PITA - as soon as someone came or left, our in-progress game was terminated.) It discussed C and Perl. That book sits on the bookshelf four feet away from me right now for the nostalgia and the love of learning. A few years later, I asked my parents for Learning Python Programming for a Christmas gift. I flipped through it trying to grok what a tuple was. That thick book sat on my shelf for a lot longer than it should have, but the joy of having such a tome of possibilities was unlike most others.
My first web application was developed in 1999 in IISAPI (VC++) running obviously on IIS. I had to write a rudimentary session storage (in plain txt file!), because it was not provided by the framework.
Kind of interesting that "serverless" (AWS Lambda, etc) seems to be going through the same evolution now. That is, initially liking the simplicity then hitting a wall with performance and making it more complicated.
There was a transition period where people were trying to still use CGI but make it scale so you had things like CGI mod_perl in Apache.
See also: https://news.ycombinator.com/item?id=24683304 ("FastCGI – The Forgotten Treasure (2002)")
"Open Market originally developed FastCGI in part as a competitive response to Netscape's proprietary, in-process application programming interfaces (APIs) (Netscape Server Application Programming Interface (NSAPI)) for developing Web applications"
Back in the mid 90s I worked on the Spinner/Roxen webserver that was built on an interpreted C-like language modelled after the LPC language being used for MUDs. Modules were were run in-process, but because of the interpretation a failure resulted in an exception/error, rather than a full crash. This software didn't get very popular - we sucked at marketing.
Tricky to follow where all the stuff ended up: https://en.wikipedia.org/wiki/IPlanet
"Before we had these nifty LED bulbs, we burned candles."
Also I think I tried to get the forum from Matt's Script Archive (which is still around by the way) working but couldn't.
Good riddance.
I did write an entire CMS in PERL, once.
I still wake up screaming...
Static site generators don’t generate “live,” like SSI did.