7 ms·
"When I design software, I really try hard to make it simple."
- hackermom 15y agoI'm a great fan of his software design philosophies, as well as his software - SQLite in particular.
- faizanaziz 15y agoTo make something simple for the user it means that it needs to be well thought... Surprisingly even though humans have had brains for a really long time its hard to think :)
- tszming 15y agoI was not aware of the fact that Fossil SCM & SQLite are from the same guy..
- treo 15y agoJust in case that anybody cares: There are more or less simple ways to use cgi with nginx. Just see here: http://wiki.nginx.org/Fcgiwrap http://wiki.nginx.org/Fcgiwrap or http://wiki.nginx.org/SimpleCGI http://wiki.nginx.org/SimpleCGI
- dchest 15y agoSpecifically for Fossil, you can use "server" command http://www.mail-archive.com/fossil-users@lists.fossil-scm.org/msg06149.html http://www.mail-archive.com/fossil-users@lists.fossil-scm.or...
- _delirium 15y agoIt's kind of interesting that his approach, using essentially 1980s-era scaling technology (inetd forking a server per request, plus old-style CGI for dynamic content) has no trouble at all running these high-traffic websites on a tiny VPS. edit: Though come to think of it it shouldn't be that surprising. If that architecture managed to work at all on 80s hardware, it should scream on anything from 2011, even a VPS.
- SwellJoe 15y agoThere's the really weird aversion to fork among people who don't understand just how fast and efficient fork is on Linux (and BSD) systems. It's an extremely common misconception, that occasionally leads to people over-complicating their solutions to problems. I see it with databases, too...people often want to interject MySQL or another heavyweight database into situations where a flat text file would be vastly faster and vastly more efficient. It's a problem of thinking that solving problems in the large is the same as solving small problems.
- rubashov 15y agoFork goes out the window if you're connecting to a database, need to keep any structures in memory, or can envision a need to work on Windows. This covers a heck of a lot of situations. And fork is still kind of expensive. Say a CGI just prints out a few K; the forking time will be relatively substantial. If you can afford it, who cares, but it is an issue.
- SwellJoe 15y agoIt also does not apply in a heck of a lot of situations.
- jmillikin 15y agoPersistent server processes are an artifact of the shift towards Python, Ruby, and other languages which optimize programming time over execution efficiency. When just starting up the binary takes over a second (to load frameworks and libraries and plugins and so on), the process-per-connection model is completely unworkable. That's why FastCGI, SCGI, WSGI, and other similar protocols all became popular at the same time as Rails and Django. If you're willing to use pre-compiled binaries, with few or no large dependencies, then CGI becomes practical once more. From the link, it sounds like the Fossil website is run entirely on such binaries (not surprising, considering the author).
- pestaa 15y ago
- rednaught 15y agoFor those who do use inetd, you might be interested in xinetd which has some access controls. I've been using this for years as well for very simple apps and it "just works." http://www.xinetd.org/ http://www.xinetd.org/
- sneak 15y agoI do believe Apple's launchd also implements this sort of functionality. IMHO it is better than xinetd. It's open source and POSIX, so you can use it even if you aren't on a Mac. It's pretty cool, from a design standpoint. http://en.wikipedia.org/wiki/Launchd http://en.wikipedia.org/wiki/Launchd
- bluetech 15y agoI think linux users, if they would go for such a thing, will be better served by systemd. See for example http://0pointer.de/blog/projects/instances.html http://0pointer.de/blog/projects/instances.html http://lists.freedesktop.org/archives/systemd-devel/2011-September/003399.html http://lists.freedesktop.org/archives/systemd-devel/2011-Sep...
- IvarTJ 15y agoReading around about the two it could seem as if xinetd’s complexity, including many configuration files, would undermine simplicity. I’d appreciate a more informed comparison.
- arethuza 15y agoOne of my favourite quotes from C.A.R. Hoare seems relevant: "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. It demands the same skill, devotion, insight, and even inspiration as the discovery of the simple physical laws which underlie the complex phenomena of nature."
- ot 15y agoPeople really mean different things when they say "simple". For someone it may be "the abstraction is so clean, small and self-contained that I don't have to look at the implementation", for others "the implementation is so clean, small and self-contained that I don't need any abstraction". The author of this post clearly subscribes to the latter philosophy. I guess many flamewars on mailing lists ultimately boil down to this culture clash.
- epistasis 15y agoThis is also called the Worse is Better philosophy, and is something that grows more and more attractive to me over the years. http://en.wikipedia.org/wiki/Worse_is_better http://en.wikipedia.org/wiki/Worse_is_better
- r0s 15y agoIs the dichotomy better described as popular vs. useful?
- epistasis 15y agoNo, I don't think that captures the ideas in Richard Gabriel's essays. Simple vs. The Right Thing are the two sides, where the right thing is a complete and polished piece of software full of features, what a typical young engineer would create if given lots of time and resources to do things "the right way". I think he calls it "worse" as a way of emphasizing that e better course of action may not feel fully responsible, as in the PC-losering example.
- derleth 15y ago> PC-losering Has any OS other than ITS ever fully addressed this?
- vilhelm_s 15y agoIt's mentioned in the paper "EROS: a fast capability system" (http://www.eros-os.org/papers/sosp99-eros-preprint.ps http://www.eros-os.org/papers/sosp99-eros-preprint.ps): they write "This design is similar to that adopted in Fluke and MIT’s ITS system" and cite the ITS reference manual for the latter. (I remembered reading that paragraph since before that I had only ever seen the technique mentioned in Gabriel's essay :) ).
- pestaa 15y agoThis is the exact page I was trying to find for days! I thought Mr. Hipp posted this somewhere on sqlite.org... Thank you dchest so much!
- Luyt 15y agoFLOSS Weekly interview with Richard Hipp: http://twit.cachefly.net/FLOSS-026.mp3 http://twit.cachefly.net/FLOSS-026.mp3 "SQLite, an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine."
- chubot 15y agoThis is awesome -- a wise man. However he is only able to do this because he writes in C. Python and Ruby are not slow, but they have terrible startup time, which causes a huge amount of overhead for CGI. They probably do 1,000,000x the work of a C program before getting to main(). I bet he statically links his binaries (or at least has few dependencies on share objects) because that has a pretty big cost too. I wonder if he writing the CGIs in Lua would have the same efficiency. In Lua you would pretty much have to fork because it doesn't have threads and the interpreter is not thread-safe (no global interpreter lock). Or maybe v8 would work too.
- william42 15y agoDoes Lua not have the startup time issues of Python/Ruby? If it does, then to counteract the lack of threads you'd probably use a coroutine-based system like gevent and Python's greenlets.
- MattJ100 15y agomatthew@rusticanum:~$ time python2.6 -c 'print("hello world")' hello world real 0m0.027s user 0m0.024s sys 0m0.004s matthew@rusticanum:~$ time lua -e 'print("hello world")' hello world real 0m0.005s user 0m0.000s sys 0m0.000s Nevertheless, what you describe is practically how Tir works: http://tir.mongrel2.org/ http://tir.mongrel2.org/
- chubot 15y agoThat's a good comparison to make, but once you have a Python program or Ruby program importing 20 packages, each with several modules, then it gets really slow. Like 100-500ms, which is more work than the "real" work of a handling many HTTP requests. Bad packages can do arbitrary computation at import time. To be fair, I haven't run any Lua programs with 20 packages... AFAIK Lua didn't have a module system until Lua 5, and it's not as capable as Python or Ruby's.
- silentbicycle 15y agoNo, it doesn't. It also has vastly more efficient coroutines.
- malux85 15y agoMy mentor once said to me "Don't show me how clever you are by writing complex software. Show me how clever you are by making complex software simple" Those words echo in my head daily
- acqq 15y agoIn case somebody doesn't know D. Richard Hipp not only wrote SQLite, the SQL engine used in iPhone, Chrome browser and who knows where else, he also put that in public domain. Moreover, SQLite increases the executable only around 260 KB. That was one of the design goals!
- wrs 15y agoI love small and simple, I love self-contained. But then I got to GetMimeType, where he wrote his own binary search code instead of calling the C library to do it. Though it sounds simple, binary search is a minefield of edge cases and I've seen textbooks that do it wrong. So when I read the GetMimeType function, I didn't think "how nice and simple"...I thought "Hmm, I bet that doesn't work."
- dchest 15y agoThose 11 lines of reimplemented bsearch are correct.
- wrs 15y agoOh, I'm sure they are, purely based on who wrote them...but in any ordinary codebase I'd toss this code out in a second and replace it with a library call. It's just not worth the effort to decide whether it's correct -- like not bothering to bend over to pick up a lost penny.
- knodi 15y agoI think in general thats what engineers try to do, make it simple so its fun to make and easy to maintain but I have found that complexity is almost always added by the business need where its by business necessity or some idiot sales guy adding what he thinks is cool and not really forward thinking it.
- catch404 15y agoThe on request sever design is an interesting approach. It seems like it would provide a good framework for a small personal site. I wonder where this fits between using a site generator and pushing to github (or similar push based cloud provider) vs running a full webstack. I guess it comes down to preference and requirements. Good way to provide server stats via http though.
- pknerd 15y agoThe secret recipe of Apple is what Jobs and Co believe in above statement.
- devraj 15y agoAbstraction gets its power by using indirection: generalizations that stand in for specific cases. Making abstractions concrete involves a flattening of all these indirections. But there's a limit on our ability to automate the manipulation of symbols - we don't have Strong AI that is able to make the leaps of insight across abstraction levels necessary to do the dirty hackish work of low-level optimization