Re: Choosing a Programming Language
Posted: Fri Nov 12, 2010 1:36 pm
Life in 19x19. Go, Weiqi, Baduk... Thats the life.
https://www.lifein19x19.com/
Suji wrote:If at some point you want it to be web-based, PHP is really the way to go (or Perl).
Harleqin wrote:Suji wrote:If at some point you want it to be web-based, PHP is really the way to go (or Perl).
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).
nagano wrote:Harleqin wrote:Suji wrote:If at some point you want it to be web-based, PHP is really the way to go (or Perl).
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).
What is it about Lisp that you like so much?
Harleqin wrote:Suji wrote:If at some point you want it to be web-based, PHP is really the way to go (or Perl).
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).
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.
Harleqin wrote: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.
Really? Then why do you not know Lisp?![]()
Mike Novack wrote:Lots of [b]Irritating Silly Parentheses (sorry, that's a LISP joke)
usagi wrote:Mike Novack wrote:Lots of [b]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))
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.
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.
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 [b]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.
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:Code: Select all
(with-foo 3
(do-something))
which will be interpreted as:Code: Select all
(let ((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
(defmacro with-foo (value &body body)
`(let ((foo ,value))
,@body))
which is much more readable than the more elaborate form:Code: Select all
(defmacro with-foo (value &rest body)
(append
(list (quote let)
(list
(list (quote 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
CustomerList.add(CustomerRecord); Harleqin wrote: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.
I think you just had a bad introduction to the language, or none at all.
Harleqin wrote: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.
Au contraire, in Lisp, you usually shape the language to your problem domain and then only think in 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.
Harleqin wrote:I don't believe that LISP has a monopoly on good thinking, as fine a language as it really is.
Who said that Lisp had such a monopoly?
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.
Let's say we are going to design a brand new computer language that will solve all of the world's software engineering problems.