News for hackers. Stuff that matters.
Re:Python 3 can revive Python by neumann on Monday May 26, 2014 @10:32PM (#7802579)
My perspective is as a researcher in academia. From here Python is far from needing to be revived, it is gaining ground. Also, Python 2 is still king and I suspect will remain popular - researchers rarely have the luxury/incentive to go back and improve it to comply with a language update.

A few reasons Python is gaining ground in academia. Firstly, Python is _great_ for teaching undergraduate programming (see [0] for a good perspective), and many institutions are only now catching on and migrating from Matlab. Secondly it is a charitable language allowing scientists to concentrate on their research and not the CS implementation they are using. It is easy to learn, flexible, has lots of scientific libraries, interfaces to fortran/C libs. Julia is supposedly the future with speed being cited as the primary advantage[1], but it far from taking over. From a preliminary investigation into Julia it had less lib support, but most importantly, less inertia. The popularity and relative 'newness' of Python (compared to fortran/C) has meant that docs, blogs, forums, stackoverflow allow anyone to get involved and quickly overcome beginner hurdles and learn best practices. Finding which module interface for a C lib is easy. Comparatively, finding information on Julia's library support is much harder. As to why not use Fortran/C - well, if I need to suddenly share part of my data in JSON, make a plot in matplotlib, or generate a PDF/website for my data all the tools are easily accessible.

Python often gets a bad rap for speed, but this is rarely the problem it is made out to be. Python is best when used as a high level manager sitting on top of low level routines written in C/Cython. Following best practices means I do not a deep understanding of how compilers work to speed up my code, I just need to know how to pass off my data to an existing routine interfacing with LAPACK/BLAS or what have you where some really really smart CS people have already done all the optimisation.

Finally, it has a massive advantage over many other languages: Great documentation and a large community. This gives Python an inertia that the Go and Julia can't achieve yet. Julia, Go, and Closure all have dedicated communities (based on the number of mentions on HN), but the size of the community and their distribution biasing developer interests mean the barrier of entry is higher.

As these languages and their communities mature and grow, Python's advantage might diminish, but then we will just have more tools to choose from, and that would be great.

[0] http://lorenabarba.com/blog/why-i-push-for-python/ [1] http://julialang.org/benchmarks/

Re:Python 3 can revive Python by skriticos2 on Tuesday May 27, 2014 @03:10AM (#7803282)
I add that Python is excellent at data representation and transformation. You can easily write some test data and just include it in python, then transform it any way you feel you like to get intelligence out of it. With the standard library you can easily load a CSV file you exported form a data-set and then aggregate and evaluate it with only a few lines of code without much language overhead. Schema-less mixed containers, array operations, dictionaries and sets are incredibly powerful and you can nest them anyway you like. Additionally you can also forget about type limits. Work with numbers as big as you like. That's useful for a lot of things.

Go is good at concurrency and speed. It has some very neat features but it's targeted at a different audience. Data transformations in Go are trickier. You have to do a lot of explicit transformation and that's just not as slick as Python. It really shines with concurrent programming, so I you are writing a server backend for your application and have to decide between C++ or Go, you might very well be compelled to go with Go. (C++ also has it's strength and is healthy as ever with the new standards, just more heavyweight).

Re:Python 3 can revive Python by sergiosgc on Tuesday May 27, 2014 @07:03AM (#7803827)
I don't get why is Go defined as a competitor to Python. Go documentation itself places Go in the systems programming language class. The same class as C or Rust. The language advantages are defined by comparison to C. Heck, it starts by stating it compiles quickly.

I know Go is the language of the moment. Fashionable. I assume I take a cautious stance approaching fads, so I may tend to dismiss new stuff rather than all-in adopt every new tool. Having said that, my quick survey of the language features a couple of years ago produced nothing eye catching.

The concept of channels is nice, it lends itself easily to data pipelines and to SIMD parallel programming. It is not a breakthrough, though. SIMD is easily done in many many languages. Other than that, it's pretty down to earth. There's a myriad nice things (first class functions, closures, garbage collection, strong(ish) typing), but nothing ground breaking. There are also some choices that smell, namely the lack of inheritance due to the flat type hierarchy (and the obvious need for a fix), or the inability to overload methods and operators.

All in all, there's not enough in Go to warrant the level of attention the language gets. It's a nice language, it's not groundbreaking.

On the same class, Rust is looking rather nice. The memory management model alone is enough for me to keep an eye on how its ecosystem develops.

Re:Python 3 can revive Python by acqq on Tuesday May 27, 2014 @11:01AM (#7804818)
Go was never a class of C and Rust. Maybe it becomes once, but at the moment I observe it as a kind of server-side Java replacement: by the current design it simply can't be as low level as C and Rust. The main difference with Java is that it compiles to he native code and not bytecode. Still it is dependent on its own special conventions, GC and libraries.

The confusion comes from the announcements of the Go team where they claimed a "systems programming language" where they, it seems, didn't mean "operating systems" but more "some user-space programs on our servers," that is, their in-house user-space "systems." They of course discovered that the only group who saw possible benefits were programmers that would otherwise use languages like Python but liked extra speed and convenience of a compiled language. The other group were those that liked Go's concurrency primitives.

Re:Python 3 can revive Python by pekk on Tuesday May 27, 2014 @02:04PM (#7805871)
> the only group who saw possible benefits were programmers that would otherwise use languages like Python but liked extra speed and convenience of a compiled language.

To say "the only group" is far from true. Go has a lot of uptake among people who would otherwise use C++ or Java, for example. And yes, actually there is overlap in the audience of Go and the audiences for C or Rust. Go has its own advantages but really lacks the advantages of a very high-level interpreted language.

Re:Python 3 can revive Python by acqq on Tuesday May 27, 2014 @02:39PM (#7806074)
I agree, "the only" is wrong wording. Luckily there are more sentences in my reply. And actually there are elements of Go that I like. However my impression of the responses of the compiled-language groups were: C: "oh, it's GC, runtime-lib and its calling conventions dependent," C++ "oh it can't make universal containers" and Java "oh it lacks exceptions." Only the Python people were "oh it's much faster than Python and not much harder." And no, I don't think Go needs exceptions.
Re:Python 3 can revive Python by stormbrew on Tuesday May 27, 2014 @02:36PM (#7806052)
> I don't get why is Go defined as a competitor to Python.

To me the area where Go excels the most, and where I feel most strongly compelled to use it, is in tooling apps that you expect your users to install on their machines and run from a command line. This has been an area where python and ruby have been pretty common, but they're both a complete pain in the ass to use that way (setting up virtualenv, setting up rvm, pip problems, gem/bundler problems, etc).

For eg. we use vagrant and fabric at my work for server management (vagrant+fabric for dev environments, fabric alone for production servers). One's written in ruby and the other is written in python, and we have to spend a non-trivial amount of time managing their dependencies so they continue to install correctly. If they were go apps we'd just build and install binaries.

This is the area where I think Go is taking up python users, personally.

Re:Python 3 can revive Python by oshepherd on Tuesday May 27, 2014 @09:43AM (#7804367)
The people who call Go a systems programming language are fundamentally misguided. It is an applications programming language under any reasonable definition.
Re:Python 3 can revive Python by sergiosgc on Tuesday May 27, 2014 @11:26AM (#7804936)
You know that "the people who call Go a systems programming language" are its authors, do you not?
Re:Python 3 can revive Python by haberman on Tuesday May 27, 2014 @12:05PM (#7805145)
Yes, but they are also the ones being surprised that Go is cannibalizing Python, not C or C++.

They are smart guys, so I can only conclude that "systems programming" means something different to them than it does to many other systems programmers.

To me, "no imposed GC" is a non-negotiable element of being a systems programming language. So I am far more drawn to Rust than Go.

Re:Python 3 can revive Python by coolsunglasses on Wednesday May 28, 2014 @02:30AM (#7808665)
They actually dropped the "systems" bit on the home page because people told them it wasn't a systems language.

"Systems" in Rob/Ken's time was services/servers - what we call applications these days.

Re:Python 3 can revive Python by coldtea on Tuesday May 27, 2014 @12:01PM (#7805125)
You know that they retracted that line from the Go introduction text on the webpage, don't you?

And of course, them being Go's authors and them being wrong on characterizing it, is in no way contradictory.

Re:Python 3 can revive Python by sergiosgc on Tuesday May 27, 2014 @12:41PM (#7805340)
http://golang.org/doc/faq#What_is_the_purpose_of_the_project

« No major systems language has emerged in over a decade, but over that time the computing landscape has changed tremendously.

(...)

We believe it's worth trying again with a new language, a concurrent, garbage-collected language with fast compilation. Regarding the points above [cut on edit]:

* It is possible to compile a large Go program in a few seconds on a single computer.

* Go provides a model for software construction that makes dependency analysis easy and avoids much of the overhead of C-style include files and libraries.

* Go's type system has no hierarchy, so no time is spent defining the relationships between types. Also, although Go has static types the language attempts to make types feel lighter weight than in typical OO languages.

* Go is fully garbage-collected and provides fundamental support for concurrent execution and communication.

* By its design, Go proposes an approach for the construction of system software on multicore machines. »

It is still at the forefront of the language presentation.

Re:Python 3 can revive Python by yid on Tuesday May 27, 2014 @12:22PM (#7805241)
> I add that Python is excellent at data representation and transformation

Indeed! It's a very practical extraction and reporting language.

Re:Python 3 can revive Python by arjn on Tuesday May 27, 2014 @12:56PM (#7805428)
I see what you did there :-)
Re:Python 3 can revive Python by pekk on Tuesday May 27, 2014 @02:09PM (#7805900)
When it comes to Unix glue jobs, it's certainly no Perl.
Re:Python 3 can revive Python by collyw on Tuesday May 27, 2014 @03:24PM (#7806308)
Shame it doesn't have regex syntax built in...
Re:Python 3 can revive Python by 0xdeadbeefbabe on Tuesday May 27, 2014 @01:19PM (#7805587)
Go has pretty neat semantics for channels and goroutines, but it presumes you want threads and blocking IO. Or in other words, "hey kid here's some rope"

Your approach to concurrency matters even more than the tool you use, and python is a great tool for network services. It's my preferred tool actually.

Maybe it's time to start porting twisted to go.

Re:Python 3 can revive Python by Shorel on Tuesday May 27, 2014 @12:08PM (#7805166)
I think D will grow in that server space.
Re:Python 3 can revive Python by reledi on Tuesday May 27, 2014 @03:51PM (#7806454)
> it has a massive advantage over many other languages: Great documentation and a large community

I want to iterate how important these two factors are.

Python is a joy to get started with because the documentation is very easy to understand, very well organized (search results are almost always relevant), and it includes lots of examples.

The large community takes care of what the documentation lacks. Stack Overflow is loaded with Python knowledge, something I realized I took for granted now that I'm learning Ruby.

Re:Python 3 can revive Python by eloisant on Tuesday May 27, 2014 @05:26AM (#7803617)
The question is: is the Python community OK with it becoming a niche language for scientific computing, or do we want to to keep being used as a general purpose language?
Re:Python 3 can revive Python by sergiosgc on Tuesday May 27, 2014 @07:09AM (#7803836)
Python is also the modern sysadmin's Perl. This is a huge niche, to the point of not being a niche at all. Just take a look at the number of system tools used in a Redhat install that use python.

Coincidentally, Redhat's python tools are one of the major reasons for continuing support of Python 2.

Re:Python 3 can revive Python by illumen on Tuesday May 27, 2014 @09:33AM (#7804324)
The next RHEL is going python 3 though I think? Fedora has done nicely over the last couple of years packaging everything for python 3 as well. A dozen or so packages left to do, but they are going well. Ubuntu, Debian, and Gnome have also been pushing to get to a python 3 use by the base system in the last releases... and are almost there as well. This of course has meant a lot more packages have been ported upstream in the last few months.

If the next Mac OS X release has python 3... then we things will change really quickly.

Re:Python 3 can revive Python by octopus on Tuesday May 27, 2014 @11:49AM (#7805054)
No major Linux distribution uses Python 3 as the default Python today. All of them use Python 2. Yes, they have a half backed Python 3 alternative for "almost" all packages ... We can discuss more in 4 years when the next Ubuntu LTS will be released.

Apple has no interest to migrate their Python configuration scripts to Python 3. I use Python 3 for my side projects, so I compile it myself or install it with Brew on OS X, but I suspect most users will use what comes with the OS (which is 2.7.x). One can hope ...

In conclusion, on the Linux land we'll see in about 4 years, for OS X ... maybe this summer or sometime in the future. In any case, I see no massive Python 3 adoption in the near future.

Re:Python 3 can revive Python by dangayle on Tuesday May 27, 2014 @12:55PM (#7805427)
This is not correct. Arch Linux now uses Python 3 by default. (https://wiki.archlinux.org/index.php/python)
Re:Python 3 can revive Python by octopus on Tuesday May 27, 2014 @12:59PM (#7805458)
I was talking about major Linux distributions like in the first 3 or 4 (I don't want to dismiss Arch, but this more of an expert distribution than a major/popular one). Obviously, there are a lot of Linux distributions today, however most people will use some flavour of Debian, Ubuntu or RedHat.
Re:Python 3 can revive Python by dragonwriter on Tuesday May 27, 2014 @01:00PM (#7805465)
I think a number of distros include python3 by default, but -- per python's own standards (adopted as a result of disruption caused by Arch having python3 as /usr/bin/python -- it isn't linked to /usr/bin/python but to /usr/bin/python3; /usr/bin/python is (except on Arch) always python2. That's not a matter of which is "default python" (e.g., even if, as Ubuntu plans to, python3 is the only python installed (not merely "the default python"), it will only be /usr/bin/python3, not /usr/bin/python.)

This is about consistency given that major versions aren't intended to be backward compatible so scripts either fail or find a compatible python when using a shebang, not about what is "default".

Re:Python 3 can revive Python by sergiosgc on Tuesday May 27, 2014 @12:53PM (#7805409)
I use Debian, and python 3 is one "apt-get install python3" away. Ubuntu probably includes the same packages in its repos. SuSE and Fedora are in the same boat (python3 in repos). Arch and Gentoo obviously package python 3. Redhat really is the black sheep here. There is no reason for the assertion that no major distro has more than a half baked python 3 alternative.

It is not really important if it is the default python or not. Python 3 is no less available than ruby or nodejs or any of the other contenders presented in this thread.

Re:Python 3 can revive Python by dragonwriter on Tuesday May 27, 2014 @12:55PM (#7805423)
> Ubuntu probably includes the same packages in its repos.

Ubuntu not only includes python3 in the base repos, I'm pretty sure its on the CD and used by some core packages now -- the conversion project that is ongoing but not yet complete is to completely eliminate python2 from the base install, which is not yet complete.

Re:Python 3 can revive Python by octopus on Tuesday May 27, 2014 @01:06PM (#7805510)
Do you really think Ubuntu will destabilize their current LTS release by switching to Python3 and removing Python2 ? I don't know what Canonical will do for the next LTS release, but for the near future (read like 4 years) Python3 will not be a first class citizen in the Ubuntu world.
Re:Python 3 can revive Python by dragonwriter on Tuesday May 27, 2014 @01:47PM (#7805763)
> Do you really think Ubuntu will destabilize their current LTS release by switching to Python3 and removing Python2 ?

I think you are confusing several different things:

1) "switching to Python 3" -- if by this you mean making /usr/bin/python point to python 3, that will never happen on Ubuntu (and probably most other distros that aren't Arch.) They've stated that even when everything that relies on python is moved to python 3, they will follow PEP-349 and keep python 3 at /usr/bin/python3. /usr/bin/python will only exist when python2 is installed and will always be python 2.

2) "removing Python 2" -- obviously, they won't retroactively do this to an existing LTS release. It'll probably be first done in a regular release between now and the next LTS release (it was targetted for this LTS release, but not everything was ported, so currently both python 2 and python 3 are used.)

3) Making Python 3 a "first class citizen in the Ubuntu world" -- it already is.

Re:Python 3 can revive Python by octopus on Tuesday May 27, 2014 @01:03PM (#7805480)
Actually it is important which one is the default, most users will use what comes with the base install and this will slow the Python3 adoption at least for a few years.
Re:Python 3 can revive Python by collyw on Tuesday May 27, 2014 @03:27PM (#7806327)
Is it?

I was looking at making a restore from backup script today (tomorrow I will likely implement it). I have been using Python and Django for the last three years almost exclusively. Perl just felt like would more natural fit for the job (with the exception of messing about with dates part).

Re:Python 3 can revive Python by clebio on Tuesday May 27, 2014 @12:30PM (#7805280)
Also, Ansible: https://github.com/ansible/ansible

edit: markdown... oh, nevermind.