News for hackers. Stuff that matters.
Re:Python for Lisp Programmers (2000) by jonathanstrange on Monday May 21, 2018 @04:57AM (#17117046)
Okay, I certainly don't want to start a language war, so let me be kind. There is one legitimate reason to switch from Lisp to Python: The number of packages and extensions. Python really has more than just batteries included, it's probably the language with the most available libraries after C++.

Still, switching from Lisp to Python is bound to be painful...

Re:Python for Lisp Programmers (2000) by sametmax on Monday May 21, 2018 @06:25AM (#17117318)
Some other reasons:

- you use softwares that are scriptable in Python (SIG, Blender, etc)

- you write a lot of glue code. That pretty much Python raison de vivre.

- you do a lot of data analysis manually. Pandas is the new excel, and jupyter the new matlab.

- you do a lot of sysadmin. Scripting is just easier in a dynamic language.

- you do a lot of CRUD websites. You just can't beat the frameworks from this language for this kind of things. They do most of the work for you, and do security better than you do.

- you want to integrate new members in your team faster. Python is easier to learn than lisp.

- you are coding a GUI. With kivy you can target desktop and mobile with one code base, and some skins are pretty (https://imgur.com/a/IjM0XGW). With QT you can do powerful things on the desktop. With wx you can do simple GUI simply.

- you have a lot of different kinds of task at hand, and don't want to have too many different languages in your stack. Python is never the best language at anything, but it's a damn good language for most things, so it makes it a versatile toolbox.

Re:Python for Lisp Programmers (2000) by giancarlostoro on Monday May 21, 2018 @07:10AM (#17117491)
> - you want to integrate new members in your team faster. Python is easier to learn than lisp.

Heh, I listed Python in my resume and got this as my first job (after working at my local college) and I learned it on the job (I had used Python before, but nothing major yet) and I gotta say, not only is it easy to pick up if you know other languages, it's fun to experiment with if you do know other languages!

I have only played with Clojure and Racket the most on the other hand, I appreciate them and would love to learn more but I get more done with Python in shorter spans of time.

Re:Python for Lisp Programmers (2000) by LyndsySimon on Monday May 21, 2018 @12:53PM (#17119800)
> - you want to integrate new members in your team faster. Python is easier to learn than lisp.

I'm not so sure on this point.

I've been writing Python for just over a decade now, with a year or so of Ruby thrown in for good measure. At a previous job I was asked to implement an authentication service in Clojure. It took me longer to understand the Clojure ecosystem than to learn to actually write the code. In ~3 weeks I went from having never seen Clojure to having a complete (if minimal) application that authenticated users against third parties via OAuth and issued JWTs.

I'd agree that it would be much easier to onboard junior-level developers to a project that's written in Python (or any similar language), but if you're targeting more senior-level people any modern language isn't really going to be a significant barrier.

That's especially true for lisps - there just isn't a lot of language structure to learn. Python is a "shallow" language in my opinion - there are only a few layers of complexity between a newbie and complete understanding of a language feature. Lisps are shallower still.

>

Re:Python for Lisp Programmers (2000) by pimeys on Monday May 21, 2018 @07:24AM (#17117541)
One thing I don't understand here why somebody needs to switch to Python and forget other languages? Sometimes I too hack something fast with Python, but still write lots of Rust and Clojure. Then if I need Python, it is very easy to just write some and get things done.
Re:Python for Lisp Programmers (2000) by sametmax on Monday May 21, 2018 @07:49AM (#17117667)
That's not how it happens. Unless it's impossible (ex, you target a credit card), you usually starts with Python because, if you know it, that's the easiest option for a POC. Then you look if for this project, it limited you in some way.

When it does, you use another tech. E.G, you needed something to consume less RAM, or you target the browser, or you want an small APK, you need multi-core AND cheap memory sharing, whatever...

But the thing is, short of some very specific constraints, Python is good enough for a lot of things and so we don't "forget" about other languages, we just end up not needing them more often than not.

Re:Python for Lisp Programmers (2000) by msl09 on Monday May 21, 2018 @07:38AM (#17117612)
What I don't understand is the necessity of having the video of the naked pirates of the caribbean guy in the corner.
Re:Python for Lisp Programmers (2000) by sametmax on Monday May 21, 2018 @07:43AM (#17117639)
That's a picture for my blog (well actually the related twitter account), which essentially deals with Python and porn. I was not going to make a new screen capture just for HN.
Re:Python for Lisp Programmers (2000) by uryga on Monday May 21, 2018 @09:28AM (#17118201)
Wow, kivy's material theme improved a LOT since I last saw it a few years ago.
Re:Python for Lisp Programmers (2000) by LyndsySimon on Monday May 21, 2018 @12:58PM (#17119836)
I agree - I hadn't looked at it in a couple of years; it looks much more native now. I'll have to spend some time to take a look again soon.

I also had BeeWare hit my radar again this year at PyCon. The last time I looked it was "just" an IDE, which I had no need for. It turns out they've basically written an entire cross-platform GUI framework since then, and based on my brief conversation with their representatives, it looks to be pretty damned handy. In particular, they mentioned that a minimal iOS or Android app ends up being ~5MB - Kivy's big problem when I last looked at it was that the resultant applications were huge.

Re:Python for Lisp Programmers (2000) by flavio81 on Monday May 21, 2018 @12:49PM (#17119766)
Somebody is underrating the Common Lisp ecosystem, me thinks. There are much fewer libs than in Python, of course, but, most likely, everything you need you would find in CL, and some of those libs are very high quality.

>There is one legitimate reason to switch from Lisp to Python: The number of packages and extensions. Python really has more than just batteries included

Which you can "steal" by using them from Common Lisp. By using the lisp library called "burgled-batteries".

But still, as pointed below, the Java ecosystem is even bigger, and you can easily leverage by running Common Lisp on the JVM (using Armed Bear Common Lisp).

And then there is Clojure, a lisp-like language that is weaved together with the JVM and thus with very easy ways to interoperate with the JVM.

Re:Python for Lisp Programmers (2000) by anaphylactic on Monday May 21, 2018 @12:56PM (#17119821)
I know this comment is rather inane, but rarely have I seen a library name so fitting yet so humorous as "burgled-batteries".
Re:Python for Lisp Programmers (2000) by xapata on Monday May 21, 2018 @05:06AM (#17117091)
What if you're the author of a famous textbook and you find that your pseudocode reads more like Python than Lisp and that students on average prefer Python? Is that a legitimate reason? If not, you should probably send a nasty email to Norvig explaining his illegitimacy.
Re:Python for Lisp Programmers (2000) by HelloNurse on Monday May 21, 2018 @06:30AM (#17117344)
No painful switching is intended; for Norvig's purposes there are Lisp programmers taking an AI course and Python programmers taking an AI course, and both groups should be able to follow examples in a language they know, without stumbling.

Only their teachers need to adjust to the updated code examples in Norvig's updated book, and this summary is a very nice introduction to the main differences between two basically similar languages.

When and whether students should learn Lisp, Python, neither, or both is an entirely different issue.

Re:Python for Lisp Programmers (2000) by divs1210 on Monday May 21, 2018 @05:28AM (#17117161)
I'm not so sure about that. Clojure is a lisp, and has full access to the Java ecosystem.
Re:Python for Lisp Programmers (2000) by flavio81 on Monday May 21, 2018 @12:46PM (#17119738)
Also ABCL lets you Common Lisp over the JVM and have full access to the Java ecosystem.
Re:Python for Lisp Programmers (2000) by judofyr on Monday May 21, 2018 @05:03AM (#17117075)
If you don't want to start a language war, maybe you shouldn't present subjective opinion as facts?
Re:Python for Lisp Programmers (2000) by posterboy on Monday May 21, 2018 @02:07PM (#17120396)
As with programming languages, natural languages aren't uniform. So you might interpret "one reason" to mean only one or, since "only" wasn't said, give some leeway, assume good faith, and take it as "at least one, and that maybe enough", "primary", or whatever. It's underspecified, as the linguists say.
Re:Python for Lisp Programmers (2000) by judofyr on Monday May 21, 2018 @05:30PM (#17122001)
The statement could have been made more neutral by stating that it was a preference:

> I prefer programming in Lisp, but the packages available for Python makes me a lot more productive. That alone is enough for me to choose Python. I still miss Lisp though.

Language wars are started because people talk about their preferences as an absolute truth (and other people disagree with the presented absolute truth), and you don’t avoid them by starting with “I don’t want to start a language war” while continuing talking in the same way.

If you look at the other replies you see what typically happens: someone mentioned that Lisp does also have libraries, someone mentioned that there are other reasons to choose Python, someone mentioned that the article has a different focus (teaching, not writing). Instead of a comment thread where people talk about their experiences we have a thread where people point back at the OP and loudly complain “no, but see, you are wrong, because of x”. We even have a case where the OP is getting annoyed because someone assumed he didn’t know about Norvig. Seriously, this is exactly what happens when you write in such a style.

This comment alone will make someone annoyed because there are plenty of people who have used both Lisp and Python and (guess what?) prefers Python:

> Still, switching from Lisp to Python is bound to be painful...

Re:Python for Lisp Programmers (2000) by pjmlp on Monday May 21, 2018 @08:28AM (#17117877)
Java followed by .NET, beats both reagarding available libraries, unless you mean only open source ones.

And JavaScript with their one liner packages probably beats all.

Python still misses having a proper mix of AOT/JIT compilers as standard toolchain, like Lisp does.

Re:Python for Lisp Programmers (2000) by AnimalMuppet on Monday May 21, 2018 @12:02PM (#17119339)
Java's library is like Barbie - it has everything. For a standard library, it is insanely complete.

I was going to say that C probably had more complete non-standard libraries than Java. But, on reflection, for the price of writing a JNI wrapper, Java can use all those C libraries, so Java gets the superset - its own plus C's libraries. In that environment, it is obviously impossible for C to win.

Re:Python for Lisp Programmers (2000) by xapata on Monday May 21, 2018 @12:17PM (#17119443)
There are some libraries I maintain in Python which provide services not available as open-source in Java (or any other free language, as far as my Google searching can tell).

They're related to an archaic file format that is surprisingly popular, though still esoteric.

Re:Python for Lisp Programmers (2000) by kennytilton on Monday May 21, 2018 @03:14PM (#17120947)
Lisp can talk to C/C++. And do not forget Clojure. That interops with Java.
Re:Python for Lisp Programmers (2000) by O_H_E on Monday May 21, 2018 @05:11AM (#17117114)
Just for your info. Norvig wrote the "Paradigms of AI Programming: Case Studies in Common Lisp" book, so I would say that he is pretty knowledgeable about his stuff.
Re:Python for Lisp Programmers (2000) by jonathanstrange on Monday May 21, 2018 @06:16AM (#17117298)
Jesus Christ, could there be more condescending commentaries than yours or that of some other replies? You can safely assume that I know who Peter Norvig is, so keep it civil.

His post illustrates how many programming tasks have gone from problem solving to lego-brick programming, where library is piled upon library and each of them is incomplete and contains piles of bugs. What could possibly be wrong with that approach?

Just like Norvig, I don't claim that Python is bad per se or anything like that. All I've said is that it's painful to go from CL to Python in terms of the general features of the languages (not their tooling). If you have never done this transition, have never programmed sufficiently large programs in CL and Python, please don't comment on it.

Re:Python for Lisp Programmers (2000) by coldtea on Monday May 21, 2018 @06:26AM (#17117329)
>His post illustrates how many programming tasks have gone from problem solving to lego-brick programming, where library is piled upon library and each of them is incomplete and contains piles of bugs. What could possibly be wrong with that approach?

Compared to problem solving which doesn't use "lego bricks" and re-makes the wheel?

Re:Python for Lisp Programmers (2000) by s_m_t on Monday May 21, 2018 @12:48PM (#17119757)
Someone must have been going against best practices and remaking the wheel because I see different types of wheels everywhere I look. Shopping carts have a certain type of wheel, skateboards have a certain type of wheel, longboards have a certain type of wheel, rollerblades have a certain type of wheel, bikes have a certain type of wheel, planes have a certain type of wheel, cars, trucks, RC vehicles, toys, etc, etc, etc, etc...
Re:Python for Lisp Programmers (2000) by coldtea on Monday May 21, 2018 @01:36PM (#17120149)
In programming, the wheel gets remade multiple times for the same category of vehicle (e.g. skateboard).

And instead of a factory making it to recognized standards across that class of vehicle, it's an ad-hoc design for a particular vehicle.

Often it's also square.

Re:Python for Lisp Programmers (2000) by phoe-krk on Monday May 21, 2018 @06:36AM (#17117359)
Brick-related xkcd: https://xkcd.com/1988/
Re:Python for Lisp Programmers (2000) by LandR on Monday May 21, 2018 @09:16AM (#17118124)
Haha! The modern developer, right there!
Re:Python for Lisp Programmers (2000) by flavio81 on Monday May 21, 2018 @12:47PM (#17119746)
> All I've said is that it's painful to go from CL to Python in terms of the general features of the languages (not their tooling).

As a programmer with full experience in both languages, I agree with this in 200%.

Re:Python for Lisp Programmers (2000) by nothrabannosir on Monday May 21, 2018 @06:20AM (#17117305)
Please don’t swear. Please. There are no victories down this spiral. Only barren soil.
Re:Python for Lisp Programmers (2000) by jonathanstrange on Monday May 21, 2018 @06:47AM (#17117402)
I'm sorry, I honestly didn't realize that this counts as an instance of swearing in certain language communities. My apologies!