Liste des Groupes | Revenir à cl c |
On 19/06/2024 23:51, bart wrote:[Discussing Python]
You haven't given an opinion. I think this is an unnecessary aspect of it, which also makes it harder to optimise, and to reason about.Pretty much everything can be assigned to (the only exception is reserved words). Because every user identifer (even if declared with def or class or module) is a variable.The concept of "variable" in Python is quite different from that of C. You can pretend they are similar for very simple Python snippets, but then you will end up thinking there are lots of arbitrary rules for when assignment and function parameters are by value or by reference. It is better to think that all "things" in Python are anonymous reference-counted objects on the heap. When it looks like you have a variable, you actually just have a named reference to such objects. Imagine it more like your "variables" are all "void *" pointers or references, while all other types and structures are malloc'd. These references have no type information - but the objects they point to are all strongly typed. And the objects have reference-counted garbage collection.
That is a way to make structures for interaction with external code - basically, for when you are connecting to DLLs or so libraries.And /then/ they include the feature! I've long given up keeping track.
It's just a big, ugly, kitchen-sink language. They throw in every feature they can think of (like C++, possibly why DB likes it) in the hope that somewhere in the mess is a solution to your needs.Neither Python nor C++ throws in "every feature they can think of" - for both languages, there is a long process of proposals, discussions, testing, and consideration of the impact on the rest of the language, existing code, and possible future language features, before a feature is included.
>
I'm not surprised it takes 20MB to embed.
>
Yes, these are big languages. Sometimes big is good, sometimes it is bad - it would be wildly foolish to think that one language, or one style of language, is all that people need or want.It's a big language that ignores many fundamental features. My scripting language is smaller and simpler, but it takes care of those because I think they are important.
Les messages affichés proviennent d'usenet.