Paul, this would be a great opportunity for you to plug Arc, an increasingly active Anarki ( http://github.com/nex3/arc ), and the growing Arc community ( http://arclanguage.org/forum ).
Ask PG: Lisp vs Python (2010)
121–130 of 200 posts
Re: Ask PG: Lisp vs Python (2010)
#122I've used Python for about 4 years and am just starting to use Clojure, so I'll just add a few comments that others haven't mentioned. I'm not trying to offer a definitive comparison. Clojure's data structures seem a lot like Python's but are a bit more elegant and avoid many of the little python headaches that come up often like d['k'] vs d.k vs d('k'). In clojure it would be (d :k) or (:k d) and both work. If you n…
> and avoid many of the little python headaches that come up often like d['k'] vs d.k vs d('k'). When does that come up? d['k'] is a key access (to a collection), d.k is an attribute access (to an object) and d('k') is a method call. I'm not sure where the headache/confusion would be here, unless you're trying to do very weird things with Python (which you should not)
class months(object):
def __init__(self):
m='jan feb mar apr may jun jul aug sep oct nov dec'.split(' ')
n=range(1,13)
self.__dict__.update(dict(zip(m,n)))
def __getitem__(self, key):
return self.__dict__[key]
def __call__(self, key):
return self.__dict__[key]
d=months()
print d['jan'] # 1
print d('jan') # 1
print d.jan # 1Re: Ask PG: Lisp vs Python (2010)
#123Earlier quoted context omitted.
In terms of programming-in-the-large, at Google and elsewhere, I think that language choice is not as important as all the other choices: if you have the right overall architecture, the right team of programmers, the right development process that allows for rapid development with continuous improvement, then many languages will work for you; if you don't have those things you're in trouble regardless of your languag…
OTOH, it's not completely irrelevant. If you can launch 10% faster, that's a big advantage.
Re: Ask PG: Lisp vs Python (2010)
#124Earlier quoted context omitted.
The problem with the Blub paradox is that there's no total ordering. I do Common Lisp and C++ at my day job (ITA), and I do much of my personal hacking in Python. In Python and C++ I miss macros; in Lisp and Python I miss RAII and strong typing; in Lisp and C++ I miss dictionary literals. And, in all of them, I miss algebraic datatypes.
What about Qi? What about Typed Racket?
There has to be another friendlier syntax for typing, no?
Re: Ask PG: Lisp vs Python (2010)
#125Earlier quoted context omitted.
While Guido is not keen on reduce, I don't think he has any desire to eliminate list comprehensions (which are equivalent to map/filter).
In other words, list comprehensions are the Pythonic version of same.
Re: Ask PG: Lisp vs Python (2010)
#126This question sounds like it's from 2005 rather than 2010. Lisp seems to have become fashionable again now, thanks to Clojure. I'm sure Python has very good libraries, but I would find it constraining to program in a language without proper macros.
Macros can be used in python. There are a few libraries that help make it easier(so you do not need to manipulate the ast yourself). For example: @macro def macroname(arg1, arg2): ... macro contents ... There's some current information for you old time lispers, so next time you don't sound so dated in your Battles with Trolls in the great never ending language war flames ;)
Re: Ask PG: Lisp vs Python (2010)
#127Peter Norvig here. I came to Python not because I thought it was a better/acceptable/pragmatic Lisp, but because it was better pseudocode. Several students claimed that they had a hard time mapping from the pseudocode in my AI textbook to the Lisp code that Russell and I had online. So I looked for the language that was most like our pseudocode, and found that Python was the best match. Then I had to teach myself eno…
Re: Ask PG: Lisp vs Python (2010)
#128Earlier quoted context omitted.
In other words, list comprehensions are the Pythonic version of same.
and Generator Expressions[1], a lazy version of list comprehensions [1]: http://www.python.org/dev/peps/pep-0289/
Re: Ask PG: Lisp vs Python (2010)
#129Earlier quoted context omitted.
In terms of programming-in-the-large, at Google and elsewhere, I think that language choice is not as important as all the other choices: if you have the right overall architecture, the right team of programmers, the right development process that allows for rapid development with continuous improvement, then many languages will work for you; if you don't have those things you're in trouble regardless of your languag…
OTOH, it's not completely irrelevant. If you can launch 10% faster, that's a big advantage.
Now with the first question, familiarity with the language, lets discuss Python. Python is my language of choice. I know it, I use it, I pay attention to what is happening with the language, the community, etc. I organize a Python User Group. If I were to work on a new project, I would choose Python. I believe I could launch 10% if not 50% faster with Python than with Ruby. Does that make Python a better language? No. Just that I don't know Ruby, Rails, Sinatra, etc.
I think the second question about how dynamic the language is plays into this as well. Java is not very dynamic. Some tasks in Java are downright ugly to work with. If you want to prototype fast and spit out a product fast, you might not want to use Java. At that point, there are several great languages to choose from like Python, Ruby, Groovy, Scala, Lisp, Smalltalk, Javascript, Closure, etc. The list just goes on. You could also argue that .net is more dynamic. But Java has some good points to it as well. You have less risk of bugs due to it being statically and strictly typed. You can build off some great libraries. You get the benefit of the JVM and JIT, which are amazing. Maybe you can't launch faster with Java, but maybe you can launch with a more robust stable product. First doesn't mean best; remember the article about Wasabi and Mint?
The way I read Peter's comment was you don't want to spend you time finding the best language. Instead you want to just grab the most convenient language and spend your time creating the best product. Think through your architecture, work on your design, test the hell product, study the market, your competitors, work on your marketing, and on and on. The list of things to do never end, and if you were still debating about which language to choose, you won't launch.
Re: Ask PG: Lisp vs Python (2010)
#130This question sounds like it's from 2005 rather than 2010. Lisp seems to have become fashionable again now, thanks to Clojure. I'm sure Python has very good libraries, but I would find it constraining to program in a language without proper macros.
Macros can be used in python. There are a few libraries that help make it easier(so you do not need to manipulate the ast yourself). For example: @macro def macroname(arg1, arg2): ... macro contents ... There's some current information for you old time lispers, so next time you don't sound so dated in your Battles with Trolls in the great never ending language war flames ;)