Live data from Hacker News

Python 3 can revive Python

medium.com

141–150 of 242 posts

Re: Python 3 can revive Python

#141

Python 3 isn't really good. It's not really bad, either. There's really not that many magic bullets (other than proper functional programming, maybe, which isn't about to happen in Python). People are leaving Python for Go because people have always left Python for fast compiled languages. Google ditched Python for C++ and Java. Java! I've seen a lot of projects get re-written in Java from Python, but no-one worried…

other than proper functional programming, maybe, which isn't about to happen in Python If we could just have tail call optimization, I think we could make the rest work (well, maybe better lambdas, too).

> If we could just have tail call optimization, I think we could make the rest work

Manually thunk/trampoline it?

    class trampoline(object):
        def __init__(self, fn):
            self.fn = fn

        def __call__(self, *args, **kwargs):
            ret = self.fn(*args, **kwargs)
            while isinstance(ret, thunk):
                ret = ret()
            return ret


    class thunk(object):
        def __init__(self, fn, *args, **kwargs):
            self.__dict__.update(fn=fn, args=args, kwargs=kwargs)

        def __call__(self):
            if isinstance(self.fn, trampoline):
                return self.fn.fn(*self.args, **self.kwargs)
            else:
                return self.fn(*self.args, **self.kwargs)


    @trampoline
    def fact(n, accum=1):
        if n 
You only have to write thunk/trampoline utility once, and it is similar to how we do it in clojure.

Re: Python 3 can revive Python

#142

One pain point I've really felt recently with Python is in the deploy step. pip installing dependencies with a requirements.txt file seems to be the recommended way, but it's far from easy. Many dependencies (such as PyTables) don't install their own dependencies automatically, so you are left with a fragile one-by-one process for getting library code in place. It was all fine once I got it worked out but it would so…

There's nothing like a good old deb (or rpm) package. Learn fpm[1] and bundle your dependencies instead of hoping that they get there.

[1] https://github.com/jordansissel/fpm

Re: Python 3 can revive Python

#143

Earlier quoted context omitted.

I can tell that proper Unicode support is a reason to discounting a language/library if you're not a native English speaker and/or writing programs that have to be localized.

Python was created by a non-native English speaker.

Well, he's Dutch, his language uses an alphabet meaning that even with all the accents it's still a one byte language.

Having to work with 2 bytes languages (CJK typically) without proper Unicode support is much more of a hassle.

Re: Python 3 can revive Python

#144
post #127
post #107

Earlier quoted context omitted.

ECMAScript 6 has generators, and they are already available in Node.js.

Javascript seems to go the opposite way of python: instead of ironing the warts out, it adds them. The DOM-API is nonsensical and ugly? Why not add language features so we can implement it in pure JS? Sounds like a great idea.

While I agree mostly with your point, I think the DOM example isn't going to work. The DOM is a spec and doesn't really have anything to do with JavaScript.

Re: Python 3 can revive Python

#145
post #76

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] fo…

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

#146

One pain point I've really felt recently with Python is in the deploy step. pip installing dependencies with a requirements.txt file seems to be the recommended way, but it's far from easy. Many dependencies (such as PyTables) don't install their own dependencies automatically, so you are left with a fragile one-by-one process for getting library code in place. It was all fine once I got it worked out but it would so…

At my company we build with Jenkins, tarball it and deploy from that. I haven't had experience another way but I think it ends up being more efficient and less error-prone than doing actual pip installs during deployment.

That's basically what the company I used to work for did as well with our large python application. Build using a build script, pulling in dependencies from local build server, test, package up the result and deploy. Pip was used for pulling in libraries to the build machine and never used during deployment.

Re: Python 3 can revive Python

#147

Earlier quoted context omitted.

I can tell that proper Unicode support is a reason to discounting a language/library if you're not a native English speaker and/or writing programs that have to be localized.

Python was created by a non-native English speaker.

I know that. I'm Italian, and Western European Languages can be expressed on a 1-byte character type. I also understand that the performance gain of 1 byte char was significant. But now is 2014 and not to have to wrestle with encodings definitely worth the performance and (somewhat) complexity hit.

As a unrelated (to Python) example of the encoding nightmare: have you ever tried to import text from CSV files generated on different OS/locales in Excel that don't support Unicode-encoded CSV files? It can be made, sure... but, man, if it can be avoided... ;)

Re: Python 3 can revive Python

#148
A little more than a year ago I had to choose a programming language that I would use to create a platform and I chose Python. It's a mature, evolved language. There's a deep bench of talent that can use it. It's a practical language for someone to learn because of the resources available-- books, blog posts, community forums, IRC, open source. The heavy hitters in Tech seriously use it. Not only do they seriously use it but their teams release their work into the wild if it can benefit more than themselves in the process (Facebook's Tornado, for instance). Aside from commercially supported Python-related open source, there's an abundance of grass-root open source libraries and frameworks that are absolutely phenomenal. Take, for instance, SQL Alchemy or the Pylons projects, such as Pyramid. I attended my first PyCon this year (2014). More than 3000 people, from all over the world, attended the event in Montreal. I got to meet some great people and feel closer to the community. I watched the PSF award Raymond Hettinger for a lifetime of contribution to Python. He received a loud, standing ovation.

All of the things that make Python great didn't happen over night. It can take years before an idea becomes popular among just a few evangelists. Rarely does technology have a chance to transcend before it is replaced by something more powerful, flexible, and fun. Python has brought society-changing, community-supported innovation. It's not a fly-by-night language. So, if you choose to use it, whether as a newbie or by upgrading, you will not fail at your work nor be disappointed as a lone wolf.

Upgrading technical skillsets isn't easy -- I can speak from experience. People get naturally set in their ways, excel at their craft, and take offense to anyone rocking their boat. So, I can empathize with the devout 2.7 users who are unhappy with migrating. Your baby has grown up without you. But, you can trust that the broad Python community has your best interests at heart, and adopt 3.4.

Best of all, if you choose to continue using Python, there is absolutely nothing stopping anyone from working towards core development. Be the change that you wish to see in the world. You don't have to wait for any benevolent dictator to feed you.

Re: Python 3 can revive Python

#149
post #69

The biggest problem with python 3 as i see it is that it seems to cause people to air grand opinions unencumbered by any actual data. I have seen neither evidence that python is "dieing" in any way, nor that people are dropping it because it lacks radical new feature X. Things may be more competitive now but I don't see any stagnation in the community - and that's always been one of python's strongest points.

> I have seen neither evidence that python is "dieing" in any way Yeah. I'm sure there weren't that kind of hard numeric evidence about Perl dying either. Perhaps, you know, what languages are getting adoption and which might be lossing traction is more of a "sensing the buzz" and following community discussions affair, than some statistic bureau giving hard counts. > nor that people are dropping it because it lacks…

Anecdotes are not evidence. I'm sure that for every post about someone switching to Go from python, you find a post of someone switching to python from something else. Not to mention all the people who are just getting on fine and don't feel the need to tell everyone about it. One blog post does not a trend make. Some things that do make trends:

Python stable in top 10 in TIOBE index: check Python increasingly popular topic on StackOverflow: check Python jobs in popular demand: check Python community is active and lively: check Python used in large scale deployments: check ... and so on.

I'm not saying they can just rest on their laurels, but to claim python is in crises is just bull. People are well aware of the issues and difficulties of updating to new versions, PEPs are written, improvements discussed, etc - the ability to respond to new challenges is key to the survival of a community, and python has had this built into its development process since forever.

Re: Python 3 can revive Python

#150

Earlier quoted context omitted.

Exactly. Python and JavaScript is a perfect demonstration of "worse is better". Python 2 is a vastly better language than JS, avoiding nearly all of its design misfeatures and having actually useful built-in types and standard libraries. Yet while Python spent a decade to go from 95 to 99 percent purity, JS took over the world through sheer ubiquity.

Javascript won the "language lottery" when it was created for the web browser, how would another language capitalize on that?

Exactly. JavaScript has attained ubiquity through convention only. It has nothing to do with its intrinsic qualities or deficiencies. A great many languages are preferable to JavaScript.
Post reply on HN