Poll

Do you like Python?

Yes, I love it.
22 (24.2%)
Yes, I like it.
24 (26.4%)
No, I don't like it
17 (18.7%)
No, I hate it.
14 (15.4%)
No opinion, indiferent
11 (12.1%)
I refuse to answer
3 (3.3%)

Total Members Voted: 90

Author Topic: Python becomes the most popular language  (Read 105968 times)

0 Members and 1 Guest are viewing this topic.

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2329
  • Country: 00
Re: Python becomes the most popular language
« Reply #900 on: October 04, 2022, 02:16:03 am »
What Arduino did for hardware Python Did for languages  :scared:

The illusion that everything is easy, just using other people's codes/libraries, without knowing precisely what's behind the scene.

 
The following users thanked this post: Karel

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Python becomes the most popular language
« Reply #901 on: October 04, 2022, 06:39:27 am »
Arduino was designed to make it easy for non-technical people to use a prototyping board.

But Python is used in many applications by technical people who are well versed in different programming languages. It is a professional tool.
« Last Edit: October 04, 2022, 06:41:10 am by Picuino »
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2240
  • Country: 00
Re: Python becomes the most popular language
« Reply #902 on: October 04, 2022, 06:46:09 am »
Arduino was designed to make it easy for non-technical people to use a prototyping board.

Python was designed to make it easy for non-programmers  to use a programming language.

 :popcorn:
 
The following users thanked this post: SiliconWizard

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Python becomes the most popular language
« Reply #903 on: October 04, 2022, 02:31:15 pm »
Python is designed to optimize programming time instead of optimizing execution time. To achieve that, the language has been made to be simple, easy to learn and easy to use. But that does not mean that it is oriented only to neophytes (as is Arduino).

https://blog.dropbox.com/topics/work-culture/-the-mind-at-work--guido-van-rossum-on-how-python-makes-thinking
 

Online jfiresto

  • Frequent Contributor
  • **
  • Posts: 853
  • Country: de
Re: Python becomes the most popular language
« Reply #904 on: October 04, 2022, 05:00:43 pm »
Twenty some years ago, the idea was Python fits your brain.
-John
 

Offline bpiphany

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Python becomes the most popular language
« Reply #905 on: October 05, 2022, 01:35:49 pm »
Use your own words; don't change mine.

You actually reported my post and managed to have it removed? I didn't think the eevblog was that lame  :-DD
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6514
  • Country: fi
    • My home page and email address
Re: Python becomes the most popular language
« Reply #906 on: October 05, 2022, 04:10:03 pm »
I didn't think the eevblog was that lame  :-DD
"fixed that for you", "lame" ... it seems to me you'd be more comfortable at Twatter, Snipthat, Fakebook, Inthatgran, Tiptap, or other like-minded social media, then.

A quick "Apologies; won't happen again, MikeK." would have been the proper answer here.  We all make mistakes, but only some seem to be able to be human enough to admit and apologise.
 

Offline bpiphany

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Python becomes the most popular language
« Reply #907 on: October 06, 2022, 05:58:10 am »
Come on now. You obviously read it, since you can quote it. It was an exceptionally mild poke of fun at his rather condescending tone against those "not competent enough persons to reach the excellence of low level programmer". I really thought this crowd could handle that...
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7035
  • Country: va
Re: Python becomes the most popular language
« Reply #908 on: October 06, 2022, 09:52:35 am »
Quote
It was an exceptionally mild poke of fun

Indeed, it was pretty tame, but I am sure the problem was that you chose to make the joke by changing his quote. That's a big no-no under any circumstance because someone not au fait with the original would think that he really wrote that.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6514
  • Country: fi
    • My home page and email address
Re: Python becomes the most popular language
« Reply #909 on: October 06, 2022, 10:03:01 am »
Come on now. You obviously read it, since you can quote it. It was an exceptionally mild poke of fun at his rather condescending tone against those "not competent enough persons to reach the excellence of low level programmer". I really thought this crowd could handle that...
Is it really that hard for you to admit you've made a mistake?  According to your posting history, it is.

Being unwilling or unable to admit your own mistakes is one of the most despicable human behaviours I know of.  Condescending tone is a mild irritant in comparison.
 

Offline bpiphany

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Python becomes the most popular language
« Reply #910 on: October 06, 2022, 02:00:27 pm »
I'll stand by my opinion in this case. I'm always equally willing to argue my point as accepting when I'm wrong. This however is a matter of opinion, without a right/wrong answer.

He got excessively hurt in the b from me turning his words against him, ratted off to mommy to cover it up, who had it removed on a technicality. It was more than obvious that and which parts of his quote that was changed by me. I haven't read the fine print, but if there happens to be an explicit rule against that, so be it. I accept, not respect, the decision by the moderators to remove the post. That's all that's in my power, which I fully accept. With that said my general experience of forums is that the ones more open and allowing are more lively and fun to hang around. I had (mistakenly?) got the image that the eevblog was one of those.

If you've already got the impression that I'm a prick. I'll leave this matter on that note confirming the image.
 

Offline bpiphany

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Python becomes the most popular language
« Reply #911 on: October 06, 2022, 02:17:21 pm »
I would actually like to apologize in advance, if, in fact, it wasn't him who reported the post. That was a somewhat rash assumption by me. In which case I was actual technical wrong.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6514
  • Country: fi
    • My home page and email address
Re: Python becomes the most popular language
« Reply #912 on: October 06, 2022, 02:46:01 pm »
If you've already got the impression that I'm a prick. I'll leave this matter on that note confirming the image.
My impressions are irrelevant; all that matters is how you interact with others.

I may be too touchy about the behaviour you seemed to exhibit, because it has been a big part of why I've left many Q&A sites.  There, many of those who have "high score" ("reputation") ignore any errors they made as long as it does not impact their "reputation"; and when it does, they simply delete the answer.
The reason this is utterly despicable to me is how often it ends up misleading those looking for help.  It is an understandable human error, but when those trying to learn are involved, it is a very serious problem that undermines everyone elses good-faith efforts, muddying everything into a mess.

The thing I keep repeating here and elsewhere, is that ones opinions do not matter, but the things – facts, observations, thoughts, and even beliefs – behind those opinions are interesting, because unlike opinions, they can be evaluated for relevance and applicability to the situation, problem, or question at hand.

In this thread, I've been on both sides.  I do use Python, especially when implementing UIs (Python3 + Qt5, currently), because it gives me a perfect demarcation line between things that all end-users, even nontechnical users, should feel free to play with and modify (this being the UI), while putting any actually important secret sauce in a binary dynamic library.  I myself am more of a systems programmer, with C being my currently preferred language, but I can develop software in about a dozen languages, and have done some embedded development too (including freestanding C/C++).
So, I'm not your opponent, just another member here who wants to point out some things that you should find useful.
I could say I will not form any kind of impression of you until I see how this pans out, really, because everyone makes errors, and what matters is how they behave when one is pointed out to them.

Your earlier posts, like #850, were on point, but the post where you tried to be funny and modified what MikeK wrote fell flat.  Sometimes it works, sometimes it doesn't.  I've done it myself, I believe, although I do think only to agree/emphasize, not to invert like you did; the inversion is easy to perceive as quite hostile.  When things fall flat, the correct –– as in works with humans, not as in "politically correct" –– response is "oops, that fell flat. Sorry, I was trying to be funny" or something to that effect, not to try and paint the target as someone who "ratted off to mommy".
This is the core of my point to you.  It is just that one of my own flaws is excessive verbosity.  (It is not an affectation; I'm working to cut the excesses down.)

Basically, I'm saying you're digging yourself deeper into a hole for no sensible reason.  Or just to shield your own emotions or mental picture of yourself (as in, "what I wrote was funny, you guys are just ganging up on me because you've no sense of humor").  I'm not ragging on you here, I am telling you what every one of us does, unless we train ourselves or consciously do otherwise; and we must, if we want to interact effectively, without censoring ourselves like we were walking on eggshells all the time.  We are social animals, after all.  Remember, your facial expressions or other cues are not transmitted in written text, so it is unreasonable to assume others will read what you write the same way.  When that happens, you correct the error, and move on.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14888
  • Country: fr
Re: Python becomes the most popular language
« Reply #913 on: October 06, 2022, 06:28:55 pm »
Had to write a custom BOM plugin for KiCad in Python lately. No choice, Python is the only option for KiCad plugins.
I didn't particularly enjoy that, but I made it. :-DD
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7035
  • Country: va
Re: Python becomes the most popular language
« Reply #914 on: October 06, 2022, 06:42:51 pm »
Hope you wore gloves and brushed your teeth afterwards.
 

Online newbrain

  • Super Contributor
  • ***
  • Posts: 1740
  • Country: se
Re: Python becomes the most popular language
« Reply #915 on: October 07, 2022, 06:58:54 am »
I've done it myself, I believe, although I do think only to agree/emphasize
This something I do on occasions, too.
But, as above, it is important to me that any alteration in a quote is marked as such, and the forum SW here allows that:
Code: [Select]
[quote author=Nominal Animal, emphasis by newbrain...
Nandemo wa shiranai wa yo, shitteru koto dake.
 
The following users thanked this post: Nominal Animal

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9912
  • Country: us
Re: Python becomes the most popular language
« Reply #916 on: October 07, 2022, 03:41:41 pm »
The way I use Python is to simply call library functions in the proper order.  I have been playing with Deep Learning and there is darn little programming required.  All of the functionality is provided by libraries that are, more often than not, written in C/C++ for speed.  I don't care how the libraries are written, I just want to know the calling parameters and the results for the myriad functions.

Here is a sample that has not a single 'if' statement - it's just a long list of function calls.  It is the classic 'Digit Recognition' script for the real 'Hello World' of Deep Learning.

Code: [Select]
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.datasets import mnist

(train_images, train_labels),(test_images,test_labels) = mnist.load_data()

model = keras.Sequential([layers.Dense(512,activation = "relu"),
                          layers.Dense(10, activation="softmax")
                         ])

model.compile(optimizer="rmsprop",
              loss     ="sparse_categorical_crossentropy",
              metrics  =["accuracy"])

train_images = train_images.reshape((60000, 28*28))
train_images = train_images.astype("float32") / 255
test_images  = test_images.reshape((10000,28*28))
test_images  = test_images.astype ("float32") / 255

model.fit(train_images, train_labels, epochs = 5, batch_size = 128)

print("\nRunning test data\n")
test_loss, test_acc = model.evaluate(test_images, test_labels)
print("\n")

FWIW, this simple model achieves 98% accuracy using the MNIST hand written digits dataset - about average.  Some of the samples are so badly formed that even a human is going to have a problem with recognition.  Just look at some of the '4's and '9's or that dead-bug 8.

https://towardsdatascience.com/going-beyond-99-mnist-handwritten-digits-recognition-cfff96337392

I get about 99% accuracy with the MATLAB approach.  Pretty good results.

Here's the point:  There is not a single conditional branch in the entire script.  It executes top to bottom in strict order.  No decision logic at all.  Second, there are a lot of Python users doing just this type of thing.  Making function calls to libraries written in C by the actual wizards of coding.

Python may be popular because of the libraries.  There are many high quality libraries that allow a Data Analytics researcher to do work without all the pain of coding gradient descent on an N dimensional space for very large values of N.  It may also be pretty simple to force the execution to use the GPU when available and this speeds thing up quite a bit.  My MATLAB digit recognition program runs in 13 seconds on a CPU and 5 seconds on a GPU.  Now scale the problem up to weeks instead of seconds.  And I didn't have to write the library!  And, yes, weeks of run-time for training isn't unusual.  I have read where the Tesla self-driving AI takes 70,000 GPU hours to train.  Fortunately, GPUs are cheap at that scale - what's a few million $ for a server farm?

https://developer.nvidia.com/how-to-cuda-python

I think Python is a pretty good language when used in its own niche sandbox.  It will never replace Fortran, of course, but other languages have also tried and failed.

BTW, there's a reason that Nvidia provides a Fortran CUDA compiler.  It has to do with the fact that parallel computing is built into the language.  They also provide a C++ compiler...
 
The following users thanked this post: voltsandjolts

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Python becomes the most popular language
« Reply #917 on: October 07, 2022, 05:19:20 pm »
Python is also popular in areas where Fortran was traditionally used (intensive computing).

https://conference.scipy.org/proceedings/scipy2021/pdfs/rollin_thomas.pdf
"""Abstract—In 2021, more than 30% of users at the National Energy Research
Scientific Computing Center (NERSC) used Python on the Cori supercomputer. ..."""

The idea is similar to what you have mentioned. Generalist computationally intensive libraries are programmed in C or Fortran, which are very fast from the machine's point of view.
From there, all the software binding and high-level handling of the libraries is done in Python, a very fast language from the programmer's point of view.


In any case, in other areas all software is written in Python. For example in what I use Python (web development) both the template system (Jinja2) and the offline web code generator (Sphinx) are completely programmed in Python.
There are also frameworks like Flask or Django to generate dynamic webs, written entirely in Python.
Like this very forum in which we are writing right now, which is programmed entirely in another interpreted language (PHP).
« Last Edit: October 07, 2022, 05:21:09 pm by Picuino »
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Python becomes the most popular language
« Reply #918 on: October 07, 2022, 05:30:01 pm »
A few years ago I programmed from scratch a static web page generator, based on hundreds of images spread over dozens of directories and some small data files next to each set of pictures to describe them. The program automatically generates the web pages, the link structure between pages, the indexes, etc.
All written in Python. I'm not a professional programmer, so the code is not a marvel, but I'm proud to have made such a program. In another compiled or mid-level language, such as C, it would have been impossible for me. I owe it to Python to come up with it.
On the other hand, the compilation of the modifications takes only a few seconds and most of it consists of transforming the photos to formats with less weight and watermark. No one has complained about the speed of the program.
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7035
  • Country: va
Re: Python becomes the most popular language
« Reply #919 on: October 07, 2022, 05:37:00 pm »
Quote
In another compiled or mid-level language, such as C, it would have been impossible for me.

I can appreciate that different languages can be easier (or harder) to use for differing purposes. Python sounds like it's much better for generating web pages that C. But why does the compiled vs interpreted thing matter? OK, with a compiled one you have to hit compile, but with an interpreted one you have to actually get the code run to find out if it's code, so really there's not much trade-off either way.

I am thinking the compiled vs interpreted arguments are thrown in simply because C is compiled and Python is not. If the reverse was so - C interpreted and Python compiled - would that make a difference? I suspect that many would say it does make a difference, but really it shouldn't.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9912
  • Country: us
Re: Python becomes the most popular language
« Reply #920 on: October 07, 2022, 06:04:20 pm »
I am thinking the compiled vs interpreted arguments are thrown in simply because C is compiled and Python is not. If the reverse was so - C interpreted and Python compiled - would that make a difference? I suspect that many would say it does make a difference, but really it shouldn't.

BASIC was an interpreted language and very popular in the early '80s when it was the only game in town on the just invented 'hobby' computers (predates 'personal' computers).  It was BASIC or assembly language - those were the only choices for a while.  Eventually, when computer speeds got out of single digits and memory got into the MB range, other languages started to appear.

Most programs run so fast on modern hardware they could as well be etched in stone.  It simply doesn't matter.  This is NOT true for computationally intense programs where even GPUs are a bottleneck.  It turns out that moving large data blocks into and out of GPU memory is still a bottleneck even with 4000 MHz memory.  More GPU memory is a big deal - multiple gigabytes (like 10 or 12 GB) is the way to go.  Don't move the data any more often than absolutely necessary.

Python isn't interpreted in the same way early versions of BASIC were interpreted (parsing statements from source every time).  Python does compile the source to bytecode and this is a pretty fast intermediate form.  But it also explains the lag time between <Return> and any useable output.  This is particularly noticeable for programs that use a lot of imported libraries.

Maybe playing around with the various timing functions would be interesting.  I would be interested in the time around the import statements.
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Python becomes the most popular language
« Reply #921 on: October 07, 2022, 06:12:50 pm »
Here is a very small C interpreter, C99 compatible, that runs at full speed (although it does not optimize the generated code).

Tiny C Compiler: https://bellard.org/tcc/
https://en.wikipedia.org/wiki/Tiny_C_Compiler

It is able to compile and execute in memory, in a few seconds, a linux kernel.
Booting Linux kernel: https://bellard.org/tcc/tccboot.html

Edit:
Tiny C Compiler in Python https://pypi.org/project/tinycc/
« Last Edit: October 07, 2022, 06:19:10 pm by Picuino »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6514
  • Country: fi
    • My home page and email address
Re: Python becomes the most popular language
« Reply #922 on: October 07, 2022, 06:20:10 pm »
But why does the compiled vs interpreted thing matter?
To recompile modified sources, you need a full development environment.  In practice, this is nontrivial, especially when libraries and tool version dependencies are involved.  Even the compilation process itself can be nontrivial.  To modify interpreted human-readable code (as opposed to compiled bytecode), you only need a text editor to modify the code, nothing else.

Also, runtime dependencies are completely different to build-time dependencies.  A typical example is code generation, for example flex/bison workflow, used to create parsers and lexers (for implementing new programming languages) in C.  This means that even though you can run a specific compiled application, does not mean you can compile the same application in that same environment: lots of additional software is needed.

I find it extremely odd that you think the difference should not matter.  To me, asserting that the two should be equivalent, is like asserting that automobiles with internal combustion engines are equivalent to bicycles: after all, both have wheels and move people from place to place, so they provide the same functionality... Of course they do not, when you really investigate the practical details.

I do suspect the difference is something one does not realize before having to build lots of software developed by others.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6514
  • Country: fi
    • My home page and email address
Re: Python becomes the most popular language
« Reply #923 on: October 07, 2022, 06:36:19 pm »
runs at full speed (although it does not optimize the generated code)
That is as useful as a recursive-only Fibonacci calculator.  It, too, runs at full speed; it's just that the results aren't that useful in practice, because there are much better options around.

Compilers are not slow because they are badly written.  They are slow, because they try to optimize the generated code.  The optimizations are done at the algorithmic level –– at the abstract syntax tree level –– and can usually be mathematically proven to adhere to the abstract machine model used in the C standard.  You could say that the fact that the current compilers really do this, is one of the most important features they provide, because if they didn't, we'd be using something that would, instead.

What do you think that Python project proves?  In my opinion, nothing.  I can write the same in Bash (and others probably have already), but it does not really say anything useful about Bash either.  It is just a funny demonstration.

What matters, is which tasks is Python well suited for.

It seems to me you are quite desperately trying to prove that anything worth doing is possible to do in Python, with the proof being that so many humans are using it.  I disagree.  A single man can build a castle out of volcanic rock in a single lifetime, too, but that does not mean that it is a sensible way to build castles.  Not even if you had tens of thousands of people cheering and egging him on, making it a very popular way of building castles.  Nor even if there were tens of thousands of people, each one building their own castles out of volcanic rock.  My proof is that with proper tools and workforce, a castle can be built in a couple of years, and from much better materials.

Again, I do use Python, and quite happily.  Unlike SiliconWizard, I don't mind writing plug-ins (for GDB or Inkscape) in Python; Python seems to suit such tasks quite adequately in my opinion.  Python definitely has its faults and its quirks, and actually has quite narrow niches where it is particularly useful.  It is designed to be easy to write and understand, but it is quite far abstracted from the actual hardware –– so much so that current interpreters cannot run more than one thread of Python code at a time in a single process, which is a serious limitation for anything even close to systems programming.  Pluses and minuses.
« Last Edit: October 07, 2022, 06:38:15 pm by Nominal Animal »
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7035
  • Country: va
Re: Python becomes the most popular language
« Reply #924 on: October 07, 2022, 06:43:31 pm »
But why does the compiled vs interpreted thing matter?
To recompile modified sources, you need a full development environment.

Hmmm. I think my idea was either not expressed usefully or it failed to be noticed (which probably comes to the same).

I am aware that there is big difference in getting compiled and interpreted stuff going, but surely that isn't what makes a language. You can get C interpreters and you can compile Python applications if you really want.

My point was trying to be that C doesn't have great string handling features, for example. Python has high-level features that make a lot of stuff trivial that would be a pain with C, but C is like a sharp knife compared to Python's blunt axe if you want to do (MCU) surgery. Those are the sort of features - the vocabulary - I would choose a language for, not whether it takes 3 secs more to compile or download.

[And it seems to me that when 'compiler' is mentioned, out come the "takes forever to compile" stuff. Even really very big and complex applications typically only take the longest time when setting up - ever after that you're just compiling the bits that have changed, which can often be completed before the return key has stopped  bouncing.]

So, are we really saying that the language's lexical features aren't actually very important, and what everyone is liking is the ability to type into a live system and watch run or crash as they're doing that?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf