Xref: utzoo comp.lang.lisp:3658 comp.lang.scheme:1671 Path: utzoo!attcan!uunet!decwrl!apple!agate!stew.ssl.berkeley.edu!ericco From: ericco@stew.ssl.berkeley.edu (Eric C. Olson) Newsgroups: comp.lang.lisp,comp.lang.scheme Subject: Re: Virtues of Lisp syntax Summary: example, example, example Message-ID: <1990Sep17.165305.12538@agate.berkeley.edu> Date: 17 Sep 90 16:53:05 GMT References: <3368@skye.ed.ac.uk> <1350030@otter.hpl.hp.com> <3408@skye.ed.ac.uk> <15089@yunexus.YorkU.CA> Sender: usenet@agate.berkeley.edu (USENET Administrator) Organization: University of California, Berkeley Lines: 40 One way of evaluating the "virtues" of a language, is to compare their expressiveness. For example, someone already mentioned that an infix notation parser can be readily added to Lisp. I mentioned previously that for ruled based expert systems, a lhs/rhs parser is also a simple extention to Lisp. Making a similiar system in an Algol language is more complex. Inorder for the rules to be expressed in the native language the generated "meta" level code must be passed through the compiler. This may require system calls, or an inferior process, or that the compiler be imbedded into program. A good working example of this is C++, which (typically) converts instructions into C code. However there are significant limitations on what can be done in C++. For example, suppose you need to convolve an image as quickly as possible, and that the convolution kernel is not known at compile time. In Lisp, one can easily write code to make a function that applies a specific convolution kernal to an image. The generated code only contains a single loop and a bunch of conditional statements for boundaries, a sum, and a bunch of multiplications. Almost any modern Lisp compiler can generate efficient code for this. In addition, special case can be handled. In particular, kernals with zero values and ones can be optimized. My impression is that writing a similiar piece of code in Algol languages would be needlessly complicated (although doable). I've also seen Lisp implementations in C, and C implementations in Lisp. Although I've seen more Lisp implementations in C, I rather enjoyed using C in Lisp -- since it caught all my illegal pointers during program development and safely returned the Lisp debugger. Anyway, I've yet to find an application that can be easily implemented in an Algol language that cannot be readily implemented in Lisp. However, the above examples are easily implemented in Lisp, but, I think, are not readily implemented in Algol languages. But, hey, some one tell me I'm wrong. I'll listen. Eric Eric ericco@ssl.berkeley.edu