The GIL means that only one thread can be in a state of execution at any point in time. That isn't really multi-threaded.Python supports multithreading. You do have the GIL you have to contend with, but it is supported.
The GIL means that only one thread can be in a state of execution at any point in time. That isn't really multi-threaded.Python supports multithreading. You do have the GIL you have to contend with, but it is supported.
C extensions don’t get blocked by the GIL (numpy, for example). Some muti-threaded workloads are used for IO, which has threads mostly waiting anyway. It’s multi-threaded enough to be incredibly useful, even if it isn’t “true” multithreading. Again, I’m valuing my productivity over the semantics.The GIL means that only one thread can be in a state of execution at any point in time. That isn't really multi-threaded.
As Xiao_Xi said: "Every data scientist faces the eternal two-language programming problem."It's not really Python then if it's calling C code. Almost forty years ago we'd call assembly language or machine language code from slow AppleSoft BASIC. That's not AppleSoft BASIC either.
By the people writing those libraries, sure, but the rest of us mere mortals just import their libs and code in python.As Xiao_Xi said: "Every data scientist faces the eternal two-language programming problem."
Python is commonly used on Wall Street but the core analytic code is normally written in C++.
I mean, most Python libraries that include fast C code (e.g. Numpy) still contain a heck of a lot of pure Python code wrapped around it, so pure Python performance is still important for those of us who use those libraries.It's not really Python then if it's calling C code. Almost forty years ago we'd call assembly language or machine language code from slow AppleSoft BASIC. That's not AppleSoft BASIC either.
The GIL means that only one thread can be in a state of execution at any point in time. That isn't really multi-threaded.
For Stefan Karpinski, a co-creator of the Julia programming, the social barrier, a wall between users and developers, is one of the main drawbacks of the two-language programming problem.By the people writing those libraries, sure, but the rest of us mere mortals just import their libs and code in python.
People who say python is slow are speaking of something that used to be true more than 10 years ago. Between pandas, numpy, and scipy (all which have compiled c libraries), python is becoming (or arguably already is) the language of choice for data scientists, stock traders, and others because of both how robust it is, and how fast it is.
In order to learn Python, I ported some of my old Perl scripts to it. My first impressions were mostly positive since Python's a far better language for both writing and reading code -- its "programmer ergonomics" are vastly superior. (There's things I don't like, mostly the incredibly dumb syntactically significant indentation, but when you're comparing to Perl, all the other usability factors easily win.)People who say python is slow are speaking of something that used to be true more than 10 years ago. Between pandas, numpy, and scipy (all which have compiled c libraries), python is becoming (or arguably already is) the language of choice for data scientists, stock traders, and others because of both how robust it is, and how fast it is.
In order to learn Python, I ported some of my old Perl scripts to it. My first impressions were mostly positive since Python's a far better language for both writing and reading code -- its "programmer ergonomics" are vastly superior. (There's things I don't like, mostly the incredibly dumb syntactically significant indentation, but when you're comparing to Perl, all the other usability factors easily win.)
If you’re needing to run Python scripts within Power Bi for example, then Python performance in a windows VM would be important if you’re running a Mac.People who care about performance (particularly multi-core performance) don't use Python. Also you are not comparing the 2016 MBP with a comparable Intel Mac, your Intel Macs are all pretty low end performance wise.
I am also a little confused about why someone would care about Python performance in a Window 10 VM on a Mac. Python is a cross platform scripting language.
The lack of curly braces makes Python code cleaner.indentation system is really bad - especially when dealing with tabs vs spaces
Python is still slow when in comparison to compiler languages. There’s no way around it.People who say python is slow are speaking of something that used to be true more than 10 years ago. Between pandas, numpy, and scipy (all which have compiled c libraries), python is becoming (or arguably already is) the language of choice for data scientists, stock traders, and others because of both how robust it is, and how fast it is.
The lack of curly braces makes Python code cleaner.
VS Code makes very easy to convert indentation to spaces or tabs.
Since it's become so popular among scientists, I'm glad Python forces you to write properly indented code. It may or may not be more readable than properly indented and structured C/C++ code (for example), but it sure is more readable than 'freestyled' C/C++ code.This is a “to each his own” style but I disagree. I find it less readable and more annoying to write.
Yes there are systems to help. It’s still annoying to have to deal with it, especially when prototyping quickly and combining multiple sources together. Spaces vs tabs and the amount of each shouldn’t be a runtime error.
It’s worth noting that Python is alone in this regard amongst the “big” languages and none of the newer “big” languages developed since Python have adopted indentation as the source of delineating code blocks. Given that, I think most see it as a design flaw.
Don’t get me wrong, I like Python in most respects. Just not that one.
Since it's become so popular among scientists, I'm glad Python forces you to write properly indented code. It may or may not be more readable than properly indented and structured C/C++ code (for example), but it sure is more readable than 'freestyled' C/C++ code.
Can you explain it?I find it less readable and more annoying to write.
Can you explain it?
If you indent your code, the only difference between Python and other programming languages that don't enforce indentation is the lack of curly braces. Why do you prefer C-style code instead of Python-style code?
Copy code can become a nightmare very easily. Every time I copy code from the Internet, especially Google's code, I need to fix the indentation.1) Prototyping: This is the biggest one. As I alluded to earlier, if I’m prototyping code, testing it quickly, combining multiple code sources together, I just want to go quickly and I don’t care about formatting. Python forces me to care whether I want to or not. Again I shouldn’t get runtime errors from poor formatting of prototype code which is more or less designed to be thrown away. The same is doubly true when actually typing in the interpreter in interactive mode (especially on a headless system).
Has your group thought about switching to Julia?Without question, projects that are Python-based are easier to deal with in this context, even when considering that the vast majority of students have zero Python experience but at least some experience with C or x86 assembly by this point. It may be that the C/++ project(s) we have are just too complex at their level
No. I’ve personally looked into Julia, but what you often see with research projects is that you’ll have very few students intimately familiar with the code base, and perhaps a few familiar with technical details, but not enough spread to rework an entire project, especially without any commercial backing to do so.Has your group thought about switching to Julia?