3 ms·
Occasionally, simplicity comes in handy, for understanding what you're doing, and for moving fast. CGI can be simpler than FastCGI. Which can be simpler than
by neilv 3y ago
Occasionally, simplicity comes in handy, for understanding what you're doing, and for moving fast.
CGI can be simpler than FastCGI. Which can be simpler than some huge automatic deployment system atop CI and Docker and containerization and Kubernetes and someone else's server pool a thousand miles away.
When I implemented the SCGI protocol (which is similar to FastCGI) for Racket, I intentionally made it work as both SCGI and CGI. The application code is the same for both backends, and the `scgi` package auto-detects which it should use. https://docs.racket-lang.org/scgi/ https://docs.racket-lang.org/scgi/
Of course in production you'll probably add layers atop this, but you could usually drop down to just running the CGI script on your laptop in some ad hoc debugging setup.
- Ferret7446 3y agoYou can just run a Docker container on your laptop in some ad hoc debugging setup though. That's kind of the point, that it works the same on your laptop as in someone else's server pool a thousand miles away. CGI doesn't, since it is sensitive to web server, version, configuration, etc. In practice of course, Docker/containerization also has various issues, but that's just down to inherent complexity of the problem space. Thinking CGI solves all your problems is like thinking reverting to a caveman lifestyle solves all your modern first world problems.
- neilv 3y agoI said "Occasionally". If things aren't overly complicated, so you understand a lot about how things are working, you usually have a good idea when the debugging you need to do can be isolated from a huge mega-enterprise CI/deployment infrastructure, so you can do it much more rapidly and with low-level tools when that's helpful. The "works the same on your laptop" argument is important for some purposes (and that's one of the reasons I run Debian Stable on everything normally), but I think it gets misunderstood by many people who would have no idea how to run even a simple one-off application without big infrastructure. I don't recall CGI being sensitive to web server, version, or configuration, in practice. CGI should interface the same today as 30 years ago.