News for hackers. Stuff that matters.
Re:Practicality: PHP vs Lisp by jacquesm on Friday July 02, 2010 @01:55PM (#1481784)

  sql_apply("select id,somefield from sometable","applicator_function");
PHP is a programming language, it was not designed for 'simple web/database apps' any more than any other language, you can use the building blocks provided to create access at the level you require. But you can customize it so that it does become usable for 'simple web/database apps'.

The above is a short sample of how I'd do the thing you describe and I don't have to remember to fetch the next row from the table and I don't have to check that I'm at the end of the result set, grouping is as easy as SQL will make it and all cleanup is automatic.

Re:Practicality: PHP vs Lisp by btilly on Friday July 02, 2010 @08:26PM (#1482842)
PHP is a programming language, it was not designed for 'simple web/database apps' any more than any other language...

Um, yes it was. See http://en.wikipedia.org/wiki/PHP#History to verify that PHP started as a bunch of CGI binaries to serve some simple dynamic web pages. The database bit came later, but at the start it was explicitly designed for quick and dirty web pages.

Re:Practicality: PHP vs Lisp by jacquesm on Saturday July 03, 2010 @04:11AM (#1483500)
You can't seriously compare the state of PHP today with the first released version.

You could make such statements about every other mainstream language.

Re:Practicality: PHP vs Lisp by eru on Saturday July 03, 2010 @05:49AM (#1483592)
At least the Lisp guys have figured out how to write parsers and lexers by now. (They even grok lexical scoping.)

I guess we can't blame PHP for preserving the $ in front of variable-names with all the legacy code lying around. But the following should parse in a sane language:

  $width = getimagesize($filename)[0];
Adding support for this would not break legacy code. Nobody can tell me that naming all intermediate results like

  $sizes = getimagesize($img);
  $width = $sizes[0];
is such a preferable style, that the parser should enforce it.

By the way, this is how PHP pretends to support higher order functions:

  function cube($n) {return($n * $n * $n);}
  $a = array(1, 2, 3, 4, 5);
  $b = array_map("cube", $a);
Re:Practicality: PHP vs Lisp by btilly on Sunday July 04, 2010 @01:36PM (#1485998)
I never compared the state of PHP today with the first released version. I merely used the origins of PHP to argue that PHP was, indeed, more designed for simple web applications than most other general purpose programming languages.

And yes, you can make such statements about every other mainstream language. For instance Perl was more designed for text manipulation than most other general purpose programming languages. Java was more designed for multi-threading than most other general purpose languages. C was more designed for close to the machine programming than most other general purpose languages.

All of these things are true. All of these things still show in various ways. Yet every one of those is a general purpose language that can be used for anything you want.

Re:Practicality: PHP vs Lisp by brlewis on Friday July 02, 2010 @02:28PM (#1481882)
I want to abstract away the ways my app is like every other web app. I don't want to abstract away what's unique about it. If you abstract away everything, all languages are the same.