Domain: norvig.com
Stories and comments across the archive that link to norvig.com.
Comments · 215
-
Python info
Yeah, yeah, yeah... Here's some Python links for you:
The official site. Downloads & Tutorials
An article by ESR praising python
A couple small intros to Python
An interesting look at Python from a LISPers point of view
Zope, Python-based web application server platfrom
Pygame : A Python interface to the SDL game library -
Oh yes they do, behind you etc.
Most of the GOF patterns are specific to a class of languages, in fact they go further and embody implementation assumptions such as local vs. distributed, transient vs. persistent etc.
Take a look at how the estimable Peter Norvig achieves the aims of many of the patterns in LISP: Design Patterns in Dynamic Programming. Are these LISP implementations of the DP examples? -
Stop Complaining!
If you've really only been programming in Lisp for a week or so then you really haven't had time enough to appreciate what its strengths and weaknesses are. It sounds to me as though you have acquired a disease that is all too common amongst programmers - the desire to want to specialise in one language too early on.
I simply cannot emphasise enough how valuable it is to learn as many programming languages as possible. Even if you don't really like it at first, a language can grow on you in ways you would have never imagined. No language is perfect, so knowing a selection of different languages will give you the opportunity to choose a tool that is appropriate to the job in hand. If the only tool you have is a hammer, then every problem you come across starts to look like a nail.
By keeping your horizons broad, most especially by learning languages that might seem strange, counter-intuitive or even downright annoying at first, I can assure you othat you will become a much, much better programmer in the long run. The ways in which languages differ can often give you an insight into the ways that different programmers might solve the same problem.
FWIW, the presence of closures and eval are not the only things that make Lisp distinctive from other languages. The one truly unique (not to mention incredibly powerful) feature of Lisp is macros. You will not be able to find these in Perl. Also, in Perl the standard way to solve problems is with an iterative, procedural style, where Lisp more often employs recursion and an applicative programming style, both of which are techniques well worth the effort to learn about.
Whether Lisp is better than Perl for AI is debatable. I'd argue in favour of Lisp for the following reasons: one is the fact that Lisp is extremely good at knowledge representation (and the subsequent manipulation of that knowledge), but more important is Lisp's ability to generate code with macros, effectively meaning that you can write programs to write other programs. It's also probably worth noting that Lisp is quite a lot faster than Perl, given a decent enough compiler. See The Programming Language Shootout if you don't believe me. Lisp is also a very mature language, with an ANSI standard, so unlike Perl you can be certain that it won't be pulling any carpets out from underneath your feet any time soon.
If I haven't done a enough good job of convincing you that learning Lisp is worthwhile (and I probably haven't) then try checking out Paul Graham's Beating the Averages. Also, be sure to check out Richard Gabriel's Good News, Bad News and How to Win Big. And have a read of Paradigms of Artificial Intelligence Programming by Peter Norvig for some more specific examples of Lisp as an AI programming language. Particularly relevant might be the section in the preface entitled Why Lisp?.
And when you're done with Lisp, I'd recommend a look at Ocaml, SML, Ruby and Smalltalk (particularly the delightful Squeak)! -
Stop Complaining!
If you've really only been programming in Lisp for a week or so then you really haven't had time enough to appreciate what its strengths and weaknesses are. It sounds to me as though you have acquired a disease that is all too common amongst programmers - the desire to want to specialise in one language too early on.
I simply cannot emphasise enough how valuable it is to learn as many programming languages as possible. Even if you don't really like it at first, a language can grow on you in ways you would have never imagined. No language is perfect, so knowing a selection of different languages will give you the opportunity to choose a tool that is appropriate to the job in hand. If the only tool you have is a hammer, then every problem you come across starts to look like a nail.
By keeping your horizons broad, most especially by learning languages that might seem strange, counter-intuitive or even downright annoying at first, I can assure you othat you will become a much, much better programmer in the long run. The ways in which languages differ can often give you an insight into the ways that different programmers might solve the same problem.
FWIW, the presence of closures and eval are not the only things that make Lisp distinctive from other languages. The one truly unique (not to mention incredibly powerful) feature of Lisp is macros. You will not be able to find these in Perl. Also, in Perl the standard way to solve problems is with an iterative, procedural style, where Lisp more often employs recursion and an applicative programming style, both of which are techniques well worth the effort to learn about.
Whether Lisp is better than Perl for AI is debatable. I'd argue in favour of Lisp for the following reasons: one is the fact that Lisp is extremely good at knowledge representation (and the subsequent manipulation of that knowledge), but more important is Lisp's ability to generate code with macros, effectively meaning that you can write programs to write other programs. It's also probably worth noting that Lisp is quite a lot faster than Perl, given a decent enough compiler. See The Programming Language Shootout if you don't believe me. Lisp is also a very mature language, with an ANSI standard, so unlike Perl you can be certain that it won't be pulling any carpets out from underneath your feet any time soon.
If I haven't done a enough good job of convincing you that learning Lisp is worthwhile (and I probably haven't) then try checking out Paul Graham's Beating the Averages. Also, be sure to check out Richard Gabriel's Good News, Bad News and How to Win Big. And have a read of Paradigms of Artificial Intelligence Programming by Peter Norvig for some more specific examples of Lisp as an AI programming language. Particularly relevant might be the section in the preface entitled Why Lisp?.
And when you're done with Lisp, I'd recommend a look at Ocaml, SML, Ruby and Smalltalk (particularly the delightful Squeak)! -
Re:Learning Lisp?Peter Norvig, the writer of a very good on Lisp: PAIP, is also very supportive of Python: http://www.norvig.com/python-lisp.html
To the parent of previous poster, try http://ww.telent.net/cliki/ for a starting point or http://clisp.sourceforge.net/
The point about a decent editor is very true. I'm still suprised seeing people use Notepad or an old-skool vi (Vim, however, is very decent).
-
Re:Learning Lisp?Peter Norvig, the writer of a very good on Lisp: PAIP, is also very supportive of Python: http://www.norvig.com/python-lisp.html
To the parent of previous poster, try http://ww.telent.net/cliki/ for a starting point or http://clisp.sourceforge.net/
The point about a decent editor is very true. I'm still suprised seeing people use Notepad or an old-skool vi (Vim, however, is very decent).
-
an interesting take on pythonthe ai guru peter norvig has an interesting comparison between common lisp and python on his website.
it's quite favorable and puts things in a nice perspective. not all languages make it past a comparison with one of the coolest language on the planet.check it out at http://www.norvig.com/python-lisp.html
/largo -
Another bit of beautiful code -- for the lispersPeter Norvig's book Paradigms of Artificial Intelligence Programming is really quite good. It gives code and commentary on some really amazing programming.
As well as it might pay, most of the work done in Java and on the internet these days is a lot closer to COBOL programming (batch and transactional) than anything close to the complexity and ingenuity of an Eliza or GPS.
-
Another bit of beautiful code -- for the lispersPeter Norvig's book Paradigms of Artificial Intelligence Programming is really quite good. It gives code and commentary on some really amazing programming.
As well as it might pay, most of the work done in Java and on the internet these days is a lot closer to COBOL programming (batch and transactional) than anything close to the complexity and ingenuity of an Eliza or GPS.
-
use bigloo, scheme48, or javaI wouldn't suggest you put ANY data through the above-mentioned interface. It'll all come out smelling like shit.
Instead, use bigloo, scheme48, or some other Scheme with a decent FFI. Then you can use the native Scheme calls.
An even-better alternative is to use SILK or KAWA, which are scheme systems that can interface with Java, thus using JDBC.
There's a great paper called "Java reflects easily through Scheme" which discusses SILK and extending Scheme to allow access to Java code.
Good luck -- but with Scheme, you won't need it. What a great language!
~wog -
Re:Python
Peter Norvig (author of Paradigms of Artificial Intelligence Programming and Artificial Intelligence: A Modern Approach) wrote an interesting article comparing Python and Lisp.
Here's an excerpt from his conclusion:
"Python is an excellent language for my intended use. It is a good language for many of the applications that one would use Lisp as a rapid prototyping environment for. The three main drawbacks are (1) execution time is slow, (2) there is very little compile-time error analysis, even less than Lisp, and (3) Python isn't called "Java", which is a requirement in its own right for some of my audience. I need to determine if JPython is close enough for them."
"Python can be seen as either a practical (better libraries) version of Scheme, or as a cleaned-up (no $@&%) version of Perl. While Perl's philosophy is TIMTOWTDI (there's more than one way to do it), Python tries to provide a minimal subset that people will tend to use in the same way. One of Python's controversial features, using indentation level rather than begin/end or {/}, was driven by this philosophy: since there are no braces, there are no style wars over where to put the braces. Interestingly, Lisp has exactly the same philosphy on this point: everyone uses emacs to indent their code. If you deleted the parens on control structure special forms, Lisp and Python programs would look quite similar."
-
Re:We ALL KnowHere are some other comparative linguistics: Seriously,
-
Re:We ALL KnowHere are some other comparative linguistics: Seriously,
-
Re:Fundamental ReadingArtificial Intelligence: A Modern Approach, Russel & Norvig, Prentice Hall
You might also want to add to that list: Paradigms of Artificial Intelligence Programming / Case Studies in Common Lisp. Also by Peter Norvig. A very well written introductory book in both AI and Lisp. (Even if your a hard-core C coder, some experience with a wholly different language like Lisp will be very good for your overall programming skills.)
Object-Oriented Common Lisp, Stephen Slade, Prentice Hall
I started with this book too and while it is an excellent reference book I didn't like it much to learn Lisp from. I'd advise using the book by Norvig I mentioned above or ANSI Common Lisp by Paul Graham (the man who wrote store.yahoo.com in Lisp and then sold it to Yahoo for $48 million) if you're interested in learning Lisp. There's also a nice on-line book by David B. Lamkins: Succesful Lisp
(LISP is the language of symbolic programming, and though I'd rather do my stuff in C*, it does cater to AI programming.)
I'd prefer to do my stuff in Lisp
;-) Just to help a common myth out of the world: Lisp is not just an AI language. It is a general purpose language useful for pretty much anything. -
Not just GC languages...The reviewer was just using the GC issue as an example of how patterns in the book tended to be C++-centric. This is a problem in the pattern community in general - patterns are presented as language-independent chunks of OO design knowledge, but in reality most of them are just the standard ways of getting around limitations of popular OO languages (which tend towards the lowest common denominator, like most popular things).
Don't just take my word for it, go check out Design Patterns in Dynamic Programming in which Peter Norvig shows that 16 of 23 patterns in the canonical Design Patterns book are unnecessary or much simpler in Common Lisp due to the availability of multiple dispatch, first-class types, and real macros.