2010-08-27, 12:24 PM
Python:
Problems with dynamic languages in general:
In larger projects, you need to know the type of the variable you're using, especially if it's a method that depends on a certain object entering it. So the language being dynamic really doesn't give me any flexibility as reassigning types doesn't do any good within the scope of the method. So instead I have to name a variable in such a way that its association with an object or primitive is obvious. These days I tend to program Python like Java/C# due to this problem.
With python in general:
There is no multithreading possible due to a Global Interpreter Lock (GIL). All threads of a program are limited by the GIL in that it can only execute one bytecode at a time. Attempts have been made to make the GIL multithreaded, but the mass spawning of threads slowed down the already slow language by twofold. The only way to get a multithreaded application is to spawn multiple processes within python so that it operates on two sets of bytecodes - but then it can't share a global state between them. So if you're working with a large data set, you have to work with double the memory and each process cannot communicate with each other. Regular threading works well on I/O bound operations since they do not invoke GIL bytecode.
There are incompatibilities with Python 2.x and 3.x. Most static languages bend over backwards to ensure backward compatiblity, but not python. In Python 3.x, they include new types (byte, bytearray) and make UTF-8 the standard string type. This totally screws with reading binary files as you have to use bytes types instead of string types. The frustrating thing is that according to C, a string and an array are the SAME THING. So why can't it be the same in Python? Why can't I XOR a char in Python if I can XOR a char in C?
When working with integrated database classes (anydbm, bdbm), if the program crashes while you are working with a database then the database will be corrupted. You have to include try/catch blocks on everything to make sure the db is totally closed so that it isn't corrupted.
No JIT. If you want a JIT, you have to install psyco or Unladen Swallow.
Problems with dynamic languages in general:
In larger projects, you need to know the type of the variable you're using, especially if it's a method that depends on a certain object entering it. So the language being dynamic really doesn't give me any flexibility as reassigning types doesn't do any good within the scope of the method. So instead I have to name a variable in such a way that its association with an object or primitive is obvious. These days I tend to program Python like Java/C# due to this problem.
With python in general:
There is no multithreading possible due to a Global Interpreter Lock (GIL). All threads of a program are limited by the GIL in that it can only execute one bytecode at a time. Attempts have been made to make the GIL multithreaded, but the mass spawning of threads slowed down the already slow language by twofold. The only way to get a multithreaded application is to spawn multiple processes within python so that it operates on two sets of bytecodes - but then it can't share a global state between them. So if you're working with a large data set, you have to work with double the memory and each process cannot communicate with each other. Regular threading works well on I/O bound operations since they do not invoke GIL bytecode.
There are incompatibilities with Python 2.x and 3.x. Most static languages bend over backwards to ensure backward compatiblity, but not python. In Python 3.x, they include new types (byte, bytearray) and make UTF-8 the standard string type. This totally screws with reading binary files as you have to use bytes types instead of string types. The frustrating thing is that according to C, a string and an array are the SAME THING. So why can't it be the same in Python? Why can't I XOR a char in Python if I can XOR a char in C?
When working with integrated database classes (anydbm, bdbm), if the program crashes while you are working with a database then the database will be corrupted. You have to include try/catch blocks on everything to make sure the db is totally closed so that it isn't corrupted.
No JIT. If you want a JIT, you have to install psyco or Unladen Swallow.
