Re: Choosing a Programming Language
Posted: Fri Nov 12, 2010 1:36 pm
Life in 19x19. Go, Weiqi, Baduk... Thats the life.
https://lifein19x19.com/
This seems to be conventional wisdom, but I do not think it is true. Web pages can be generated in any language. For example, I use Common Lisp, Hunchentoot (a webserver in Common Lisp), and CL-WHO (HTML output library).Suji wrote:If at some point you want it to be web-based, PHP is really the way to go (or Perl).
What is it about Lisp that you like so much?Harleqin wrote:This seems to be conventional wisdom, but I do not think it is true. Web pages can be generated in any language. For example, I use Common Lisp, Hunchentoot (a webserver in Common Lisp), and CL-WHO (HTML output library).Suji wrote:If at some point you want it to be web-based, PHP is really the way to go (or Perl).
Lisp is very elegant and has powerful meta-programming features. But I don't think it is the right language for a beginner. I'd start with a more conventional language.nagano wrote:What is it about Lisp that you like so much?Harleqin wrote:This seems to be conventional wisdom, but I do not think it is true. Web pages can be generated in any language. For example, I use Common Lisp, Hunchentoot (a webserver in Common Lisp), and CL-WHO (HTML output library).Suji wrote:If at some point you want it to be web-based, PHP is really the way to go (or Perl).
You can use any language for anything, sure. However, certain languages make certain things easier. I'm not saying Lisp is bad, but PHP or Perl makes interfacing with databases easy. I'm also not going to write a web page in C++ even though it can be done. For me, that's like putting a square peg in a round hole. I'd rather use HTML and PHP (or Perl) for web pages because I like to make things easy.Harleqin wrote:This seems to be conventional wisdom, but I do not think it is true. Web pages can be generated in any language. For example, I use Common Lisp, Hunchentoot (a webserver in Common Lisp), and CL-WHO (HTML output library).Suji wrote:If at some point you want it to be web-based, PHP is really the way to go (or Perl).
Really? Then why do you not know Lisp?I also feel that programmers need to have a basic understanding of all major languages and know the advantages and disadvantages of each, so that, if needed, can program an application in the "correct" language.
In many cases being somewhat familiar with different languages is enough to judge what is suited for a given purpose (I'm somewhat familiar with Java, C, C++, Fortran, Cobol, Pascal, Ada, Algol68, Oberon, different dialects of Basic, Forth, Scheme, Lisp, Prolog, PHP etc, but nowadays I only really know Java, if any)Harleqin wrote:Really? Then why do you not know Lisp?I also feel that programmers need to have a basic understanding of all major languages and know the advantages and disadvantages of each, so that, if needed, can program an application in the "correct" language.![]()
Mike Novack wrote:Lots of Irritating Silly Parentheses (sorry, that's a LISP joke)
usagi wrote:Mike Novack wrote:Lots of Irritating Silly Parentheses (sorry, that's a LISP joke)
That's partly why I tend to avoid LISP (after doing a great deal of research into the language).
I have learned to think in terms of breaking up the idea itself, and translating that directly into code. So I have tended to avoid langauges which have a large amount of esoteric syntax. LISP in particular contains a large amount of such.
For example, the ",@" syntax for adding a list as an element of another list.
Code: Select all
(with-foo 3
(do-something))
Code: Select all
(let ((foo 3))
(do-something))
Code: Select all
(defmacro with-foo (value &body body)
`(let ((foo ,value))
,@body))
Code: Select all
(defmacro with-foo (value &rest body)
(append
(list (quote let)
(list
(list (quote foo) value)))
body))
I think you just had a bad introduction to the language, or none at all.Being familiar with many computer languages and how they are implemented I find the decision to include such syntax as part of the language incomprehensible.
Au contraire, in Lisp, you usually shape the language to your problem domain and then only think in that.Then again, it was groundbreaking in the days when LISP was released -- but that was over fifty years ago. LISP isn't revolutionary anymore, and we've made great strides in understanding since then. The main problem here is that you need to think in terms of LISP and not in terms of the actual problem you're trying to solve. I just don't like doing that.
Who said that Lisp had such a monopoly?I don't believe that LISP has a monopoly on good thinking, as fine a language as it really is.
Harleqin wrote:usagi wrote:Mike Novack wrote:Lots of Irritating Silly Parentheses (sorry, that's a LISP joke)
That's partly why I tend to avoid LISP (after doing a great deal of research into the language).
I do not think that your research can have been very thorough after reading what you wrote in the following. You have never written anything serious in Lisp. Also, it is spelt "Lisp" nowadays.
Harleqin wrote:I have learned to think in terms of breaking up the idea itself, and translating that directly into code. So I have tended to avoid langauges which have a large amount of esoteric syntax. LISP in particular contains a large amount of such.
No, it does not. In fact, it has almost no syntax at all. In other languages, you have three or four kinds of parentheses, a lot of keywords, precedence rules, perhaps even "structure by indentation" so that the amount of whitespace becomes part of the syntax.
You directly write the abstract syntax tree. This has several important advantages that set Lisp apart. For example, instead of writing "2 + 3 * 4", which has to be translated into an abstract syntax tree through the use of precedence rules and the shunting yard algorithm, you write "(+ 2 (* 3 4))", which directly represents the abstract syntax tree.
Again I find the examples very difficult to follow. It's something of a maxim that the smaller the syntax the more difficult it is to understand -- just look at perl. But with Lisp it seems that the longer the syntax the more difficult it is to understand, and I think that is very odd. I almost want to say that it is because really the nested parentheses cause everything to be one expression and not multiple lines like how you've formatted it. Really and in truth, your program is this:Harleqin wrote:For example, the ",@" syntax for adding a list as an element of another list.
No, that is not right. ",@" is just a part of the "backquote" syntactic sugar, which is mainly used for macros. Adding a list to another list is done with normal operators like list or append. To elaborate, you might want to define a macro "with-foo" that can be invoked like this:
which will be interpreted as:Code: Select all
(with-foo 3 (do-something))
This macro can be defined like this, closely resembling the intent through the use of the backquote syntax:Code: Select all
(let ((foo 3)) (do-something))
which is much more readable than the more elaborate form:Code: Select all
(defmacro with-foo (value &body body) `(let ((foo ,value)) ,@body))
which, however, works just as well. This is what ",@" is good for, not for generic list manipulation.Code: Select all
(defmacro with-foo (value &rest body) (append (list (quote let) (list (list (quote foo) value))) body))
Code: Select all
(defmacro with-foo (value &rest body) (append (list (quote let) (list (list (quote foo) value))) body))
Code: Select all
CustomerList.add(CustomerRecord); That may be true, but including hardware kludges in software is an abomination, and Lisp shows it's age well with it's irregular syntax. Lisp's syntax was really designed to aid computer understanding and required "thinking in Lisp". In a funny sort of way, this made sense at the time (think, what were computers like in the late 50s), and enabled people to understand computers better. So I do understand the charm -- I programmed in assembly language for a long time. You know, back in the day. But each time I look at Lisp I have to ask myself, do I really want to learn all of that syntax? For what purpose? What does Lisp have to offer that any other modern language -- any at all -- does not? And I keep coming back with "Lisp is esoteric, and limited".Harleqin wrote:I think you just had a bad introduction to the language, or none at all.Being familiar with many computer languages and how they are implemented I find the decision to include such syntax as part of the language incomprehensible.
Yeah I get what you're saying. But you can do that in any language.Harleqin wrote:Au contraire, in Lisp, you usually shape the language to your problem domain and then only think in that.Then again, it was groundbreaking in the days when LISP was released -- but that was over fifty years ago. LISP isn't revolutionary anymore, and we've made great strides in understanding since then. The main problem here is that you need to think in terms of LISP and not in terms of the actual problem you're trying to solve. I just don't like doing that.
Code: Select all
(list 1 '(2 3) 4)
;Output: (1 (2 3) 4)(from: http://www.faqs.org/faqs/lisp-faq/part2/section-13.html)John McCarthy developed the basics behind Lisp during the 1956 Dartmouth Summer Research Project on Artificial Intelligence. He intended it as an algebraic LISt Processing (hence the name) language for artificial intelligence work. Early implementations included the IBM 704, the IBM 7090, the DEC PDP-1, the DEC PDP-6 and the DEC PDP-10. The PDP-6 and PDP-10 had 18-bit addresses and 36-bit words, allowing a CONS cell to be stored in one word, with single instructions to extract the CAR and CDR parts. The early PDP machines had a small address space, which limited the size of Lisp programs.
Maybe no one said it. But I remain puzzled by people's attachment to a 50 year old language with hard to grasp, irregular syntax, that has no higher level list operators. As such I believe it is a poor introduction to programming. I'd never recommend it to a beginner. Again I think it is fine for specialist applications and I even think it should be learned by computer science students, maybe during a masters program.Harleqin wrote:Who said that Lisp had such a monopoly?I don't believe that LISP has a monopoly on good thinking, as fine a language as it really is.
I think the best introduction to Lisp for programmers is "Practical Common Lisp" by Peter Seibel. It is freely available on the net. Go read it.
There you have it, nagano. real men create their own language and use thatLet's say we are going to design a brand new computer language that will solve all of the world's software engineering problems.