9 ms·
PHP vs. Lisp?
- Retric 18y agoThe author compares using a language and web framework he knows to one he does not know and never tried. Feel free to guess how the rest of the article went. PS: Why do people feel the need to post about subjects they don't know?
- trezor 18y agoFeel free to guess how the rest of the article went. Free tip: It involves ignoring all the shortcomings of PHP and highlighting all the shortcomings of Lisp.
- deleted 18y ago[deleted]
- DougBTX 18y agoEh? PHP is overly verbose and terribly inconsistent and lacks powerful methods of abstraction and proper closures and easy-to-use meta-programming goodness and Lisp-macro syntactic wonders; in that sense it's not a very powerful language.
- jrockway 18y ago+1 I think I am going to have to write a sarcastic reply to this post. "PHP is much simpler! First, you have to setup Apache just to get 'Hello world' working with PHP. That's OK though, because installing and configuring a web server is fun and exciting. After that, you can start work. Of course, you have no libraries, so you get to write everything from scratch. While you're doing that, be sure not to use $i as your loop iterator, because there is no lexical scope! Do you need closures? They don't exist! You don't need that for web pages, though; web pages require you to write spaghetti because it's just plain easier! Anyway, eventually you will want an editor with decent syntax highlighting and perhaps a REPL for prototyping. Oh wait, PHP has neither. That's OK though, because PHP is clearly better!!11!" I could go on, but I'd rather summarize this with one word: "blub". Oh, let me add one other thing. He says MySQL is a single apt-get away, but installing SLIME and Emacs was "too hard"? On my Debian, emacs22, slime, and cl-swank are all an apt-get away. In fact: $ apt-cache search '^php5' | wc -l 51 $ apt-cache search '^cl-' | wc -l 168 That's OK, though. If you know PHP and have no ability to program or learn anything new, CL probably isn't for you.
- nuclear_eclipse 18y agoNot that I disagree with your point, but as a PHP developer myself: 1 - PHP does not require Apache. There is a command-line PHP interpreter: `apt-get install php5-cli` allows you to do `php <filename>` and such just fine. 2 - PHP has a lot more libraries available than just what you find in your Apt repositories, such as PEAR, which is PHP's equivalent of CPAN. 3 - Just about every editor I know of has excellent syntax highlighting for PHP; some even go so far as to contextually highlight HTML/CSS/SQL code as it appears in the middle of your PHP code. 4 - As for a REPL, check out [phpsh](http://www.phpsh.org http://www.phpsh.org). 5 - Your point of not using $i for an iterator is absurd, although your point of scoping is not. Using $i for iterators is perfectly fine and sane, assuming the obvious act of not using iterator variables outside hte scope of what they're iterating, which IMO should be standard proctice anyways just for the purpose of clarity...
- jrockway 18y ago1 - PHP does not require Apache. There is a command-line PHP interpreter: `apt-get install php5-cli` allows you to do `php <filename>` and such just fine. Sure, but there is no "./server" that I can run in a directory of PHP files to bring up a testing server. You can run tests from the command-line, which is good, but you can't see web pages without a web server. What a pain.
- nuclear_eclipse 18y agoI still don't see how that's any different than any other language. Something somewhere has have a web server implemented in order for you to test things in your browser. And if you don't like Apache, there's always Lighttpd and other web server options. Probably the best thing for PHP though is that once you set up your trivial testing server, you never have to touch it again. You just keep refreshing the page, or pointing the browser at new pages, no matter how much code you write or file structures you change. It just works.
- jrockway 18y ago
- mixmax 18y agoCan you point me to somewhere where I can download a single click install lisp stack that includes a webserver? Preferably for windows, which is what I use at work. Can you point me to a site where all lisp functions are well documented with user comments? Can you point me to a place where I can find a bunch of lisp libraries that are maintained and in use that I can use for my projects? No?
- skolos 18y agoTry this one: http://www.sergeykolos.com/cusp/intro/ http://www.sergeykolos.com/cusp/intro/ Not everything you want, but at least an effort to make it close to your requirements.
- tjr 18y agoThank you for including the part about building an executable, and the little backstory on it. When I first started in Lisp, one of my early questions too was, "how do you make an executable?" For a seasoned Lisper, that question might seem foreign, but it makes perfect sense to a C programmer. I asked the question on Usenet, trying to explain that not everyone I wanted to give programs to had Lisp on their computer. In response, someone tried to persuade me that you don't do such things with Lisp. Someone else turned out to be a Franz salesman asking, "which platforms are you talking about that don't have Lisp? we can supply Lisp on any platform!"
- gruseom 18y agosomeone tried to persuade me that you don't do such things with Lisp This always puzzled me too. Admittedly it's less of an issue now that we can deploy programs over the web. But it's still kind of weird. Here's my speculative answer. The classic Lisp programmer doesn't care that much about building software for end users. He's more interested in amusing himself and, occasionally, other Lisp programmers. I don't mean to slam Lisp (which I love) or Lisp programmers (I am one). But I believe I have observed evidence of the above.
- 18y ago
- yawn 18y ago"The author compares using a language and web framework he knows to one he does not know and never tried." What doesn't he know? He's written at least one website in Lisp using SBCL+Hunchentoot.
- brlewis 18y agoI use Scheme day and night for web apps, but this guy makes a valid point: An old rusty wobbly-headed crooked hammer is the best tool for the job if it's right next to you and you only need to pound in a couple of nails.
- jrockway 18y agoWhile true that an old rusty wobbly-headed crooked hammer is the best tool for the job if it's right next to you and you only need to pound in a couple of nails, we are talking about programming web applications here. In that case, I always use good tools because typing in a few lines of Perl or Lisp is just as easy as typing in a few lines of PHP. Easier, usually.
- etal 18y agoIsn't it always just a couple more nails, here and there, till the next feature's ready to go?
- lliiffee 18y agoSure, commonly when you have a big project, it seems like it is just a few remaining details. That doesn't mean- as you seem to suggest- that small little problems don't exist!
- tjr 18y agoIt seems the primary complaint here has to do with setting up Lisp web application infrastructure. Granted, it's not as out-of-the-box as getting started with PHP, but once you've done your first Lisp web application, successive applications will be much easier.
- jimbokun 18y agoThe other complaints are: - not much in terms of community to help answer questions or maintain your code, whether a guy down the hallway, documentation, or answers to questions you can Google for - much greater probability of a random library existing for PHP than for Lisp (which is perhaps another case of the first point) I keep coming back to Clojure as a way to do Lisp and still get many of the benefits of building on a popular platform (Java, in Clojure's case).
- brlewis 18y agoScheme implementations on the JVM have the added benefit that it's easy to find CS grads with Scheme on the resume. Not that it takes much time to pick up, but having it on resumes fits mainstream hiring practices better.
- rbanffy 18y agoWhen he says "not much in terms of community to help answer questions or maintain your code", he meant "I can´t google my way out of a tough programming problem" Lisp is not for sissies.
- LogicHoleFlaw 18y agoNo, Lisp is for weenies.
- Hexstream 18y agoThere are some highly idiosyncratic bugs/problems I'd rather find the solution to on Google because finding the solution myself wouldn't be very edifying.
- 18y ago
- strlen 18y agoThe real problem with PHP is that (despite the ability to run it from command line, etc...) a language centered around web application. That's also it's greatest strength: it's seamless and easy to integrate with Apache. I wonder why the author wouldn't consider Perl: powerful Apache integration (mod_perl), performance and great deal of expressive power. A PHP code monkey could be trained to modify Perl and the presence of powerful and mature testing tools (e.g. Test::More) and common libraries (DBI, myriad of XML libraries, template libraries, etc...) can minimize the amount of damage a junior coder will do. (And if you're unable to use mod_perl, using CGI::Fast suffices for most cases and is trivial with mod_fastcgi).
- davidw 18y agoI'd go with a compromise along the lines of Ruby or Python, myself.
- gonzopancho 18y agoI couldn't even think of opening this. Its like comparing pig shit with gold bars.
- deleted 18y ago[deleted]
- zandorg 18y agoDoes anyone know of Clisp web server hosting? I want to run my Clisp servents without any overhead.