Sujet : Re: Joy of this, Joy of that
De : 186283 (at) *nospam* ud0s4.net (186282@ud0s4.net)
Groupes : comp.os.linux.miscDate : 25. Nov 2024, 01:35:57
Autres entêtes
Organisation : wokiesux
Message-ID : <qaWcnZSF3q3zW976nZ2dnZfqn_WdnZ2d@earthlink.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0
On 11/24/24 12:01 AM, rbowman wrote:
On Sat, 23 Nov 2024 23:48:59 +0000, Pancho wrote:
I'm actually quite unconvinced by Python.
For many things it provides a convenient level of abstraction if
performance isn't a major concern. It's not so much the language itself as
that the language has become very popular and the range of modules has
greatly expanded.
For example, the Esri Python API makes common GIS manipulations less
painful than using C++. Similarly if you're into machine learning while
TensorFlow and PyTorch have C++ bindings almost all tutorials will use
Python. In data science Python is starting to overtake R and is actually
faster for some operations. For REST APIs you have flask, django, and
several other frameworks.
For embedded work as Arm microprocessors have become the norm and SRAM has
greatly increased a Python interpreter, either MicroPython or
CircuitPython can be loaded on the device. Again you can work in C++ and
get greater speed and control but it comes at a cost. Controlling a servo
with PWM is easy in Python. Doing it in C++ means you need to determine
the slice and channel for the GPIO pin, decide what to load into the
counter to get the desired frequency from the 125 MHz clock,determine if
you need to use the divider for lower frequencies, and make other
decisions.
Using Python means you get uniformity across many disciplines and it's
good enough for most things. It could have been Perl if it hadn't gotten
stuck in the tar pits, or Ruby, or Go but from whatever twist of fate
occurred it was Python.
For almost anything, it's good enough - or more than
good enough. The large number of libs has left little
beyond its (relatively easy) reach. It's also READABLE,
nothing too mysterious about the syntax or defining/using
vars and such.
Do kinda pref "{ }" or "begin end" over the dangling
depth thing ... get six or eight levels into something
and it's a total bitch to spot what's inside what
without using comments.
However it's NOT as fast as the true compiled langs.
Yea, yea, there's Python compilers - turn it into 'C' -
but with sometimes difficult barriers and the final exe
tends to be pretty fat - VERY VERY fat if you get past
version issues by encapsulating all the needed libs
inside the exe.
In any case, it's become the "new BASIC" for good reasons
and I don't see that being changed anytime soon. It's
in *everything* now from microcontrollers on up.
I never learned it until M$ started sneaking it into
their OS junk. "What's a .py ???". The good side of
that is that it was right near the v2 -> v3 transition
and I decided to learn the 'new and improved'.
Anyway, I do full apps and utils in Python and almost
always use it to proto stuff before re-writing in 'C'
or Pascal.