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 97116 times)

0 Members and 1 Guest are viewing this topic.

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Python becomes the most popular language
« Reply #750 on: May 10, 2022, 12:00:40 pm »
the point is you solve language and integration problems through composition, not through consolidation.

(..)
In modular designs, correctly tracking and fulfilling dependencies is key.  Interpreted languages like Python can do much more logic when choosing which dynamic library to load, than lower-level systems programming languages like C that rely on the system dynamic loader.

If we consider portable binaries say across x86-64 ELF systems using SYSV ABI (Linux, BSDs, etc.), the optimum case would be if we could provide a dynamic linking 'hint' or 'script' file, a sort of a shell script type of thing, that could specify the paths/files to the dynamic libraries based on the current run-time environment, mixing both system-provided and application-provided libraries as needed.

 (.)

The big problem here is that PYTHON  unlike other POSIX tools  can not do one liner redirection and tests  the proper way...   like decades peer reviewed GNU Automake can..

https://venomlinux.org/   and https://voidlinux.org/    both use the same modified script based AUTO BUILD system and both  need to follow the Autoconf dependency  on PERL Make and a goo reliable POSIX shell  (BASH)..

Hardly you can escape that circular ... in particular other platforms free from these nasty systemd schemas. ( other NIXES)..

Paul

PS> for newcomers it may seem just a matter or reinventing the wheel with Python.. that will fall short as soon as POSIX implementations on other *NIX flavors hit these bad Python interfaces...
 

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23033
  • Country: gb
Re: Python becomes the most popular language
« Reply #751 on: May 10, 2022, 12:13:50 pm »
I'm not sure exactly what you mean by that to be honest.

Regarding nasty Unixes, I'm actually sitting writing this on a certified UNIX which doesn't have systemd :-DD
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Python becomes the most popular language
« Reply #752 on: May 10, 2022, 12:23:16 pm »
I mean for example  FreeBSD OpenBSD and a half dozen others BSD flavors..

I can no longer issue opinion on (for example)  AIX, HP-UX and some others..
because last time I used them was on 80 to 90s early years..

I changed my SCO to Slackware around 93/ to 95 when complete ditched all old stuff.
Since then only  (Li)NIX  variants..   

The bottom line is that Autconf and all GNU build system was meant as cross platform
and they do work very reliable in all of them..

You can run autoconf and be confident it will produce a sane configure && make asset build

I agree.. Autoconf looks intimidating but it does the cross platform job like no other
I am still to see  a better one..

And I have seen some dozens...  no other build system is as portable as GNU autotools

Paul
 

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23033
  • Country: gb
Re: Python becomes the most popular language
« Reply #753 on: May 10, 2022, 12:30:05 pm »
I had some serious problems with portability of autoconf back pre 1.0 days on Solaris. Took me a month to get it working. There's probably some usenet postings of me being somewhat critical of the whole thing still :)

It's not intimidating, it's just a horrible solution that probably should have gone away by now.

As for portability, there are only a few fairly well normalised targets these days. It's not the Unix wars. Linux, Windows, MacOS, possibly a BSD or two and that's about it. The buy eyed monster is only windows now (not OSF1  :-DD:(
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: Python becomes the most popular language
« Reply #754 on: May 10, 2022, 01:25:37 pm »
I had some serious problems with portability of autoconf back pre 1.0 days on Solaris. Took me a month to get it working. There's probably some usenet postings of me being somewhat critical of the whole thing still :)

Yeah, that matches my experience. For quite a long time my personal kit was mostly Solaris based and more than anything else that pushed me to move away from it was the hell of trying to get quite standard 3rd party packages to build cleanly without days of tweaking, and the principal culprit in that was autoconf et al. I still have 3 SPARC machines and one SPARC motherboard sitting in a pile gathering dust.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 
The following users thanked this post: bd139

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Python becomes the most popular language
« Reply #755 on: May 10, 2022, 01:33:13 pm »
Yes this is also my opinion.

Autoconf is intimidating.
Autoconf is very steep to learn
Autoconf is no newbie friendly

What to expect ... Autoconf  was made to support several dozen variants and systems.
Across decades of fixes and peer review...

But it does the job and it has not even a close replacement so far..
All those "alternatives"  fall short sooner or later.

Autoconf is really hard to deal - but it works
Paul
 

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23033
  • Country: gb
Re: Python becomes the most popular language
« Reply #756 on: May 10, 2022, 06:10:16 pm »
What you call fixes and peer review I call shitty hacks  :-DD
 
The following users thanked this post: newbrain, 2N3055

Offline mansaxel

  • Super Contributor
  • ***
  • Posts: 3554
  • Country: se
  • SA0XLR
    • My very static home page
Re: Python becomes the most popular language
« Reply #757 on: May 10, 2022, 07:03:27 pm »

The bottom line is that Autconf and all GNU build system was meant as cross platform
and they do work very reliable in all of them..


I was known as The Solaris Man before Larry bought them and turned The Old SUN evil.  I spent the better part of the early 00s trying to compile GNU software on Solaris, using the Autoconf shite, not seldom using the Sun compilers.  To call that festering pile of optimistic programming that is Autoconf "reliable" is a true Baghdad Bob moment in my book.  Then, it also does not work.

In a world when people are upset at the "enormous differences" between RPN and APT for X86_64 Linux, it's of course a practical illusion that Autoconf appears to work for the bizarre subset of shit linuxen people run.

Add in a BSD using clang on ARM and it breaks. Run a /bin/sh that isn't bash and it breaks.

Offline ve7xen

  • Super Contributor
  • ***
  • Posts: 1193
  • Country: ca
    • VE7XEN Blog
Re: Python becomes the most popular language
« Reply #758 on: May 10, 2022, 10:08:17 pm »
I like Ruby much more than Python. Unfortunately it hasn't gotten the same mindshare outside of a couple of web frameworks.

I will admit I haven't used it much, mostly secondary exposure through Chef and Puppet, but it feels very much like Perl++ to me. Powerful and with lots of sugar, but inscrutable to non-experts, and prone to unmaintainable IOCCC-style code. I'm not too surprised that Python won that popularity battle, it is much more approachable. It's part of the reason I have been moving things over to Salt instead, which is Python-based.

Quote
Modern Javascript is also better than Python, especially TypeScript. With v8 it also runs far far more quickly. It's for general scripting, not only in the browser. There are a huge number of libraries available in npm.

JavaScript is a tough one to pin down for sure, but I'm not sure I'd call it 'better' than Python on too many axes (though certainly some, popularity and performance included). Moreso than even Python, its popularity isn't based much on its merits (it was pretty awful when it became popular), but its ubiquity and special status as the universal Web language. From that comes its huge benefit for server-side programming, which is code reuse and developer flexibility. It's only relatively recently (wrt. Python, anyway) that it's been a viable language for anything else, and it does have rather a lot of warts. But as you say, along with its popularity comes great performance, a large amount of good libraries, lots of available talent, and lots of tools like TypeScript to make the language and working with it a little less... awkward. I do think that as a core language for outside-the-browser use it doesn't offer a great showing against Python; the interpreter is not nearly as ubiquitous, the language is warty and doesn't have much sugar without preprocessing, its type system (or lack thereof) sucks, the system interface isn't great, the included library isn't as comprehensive...

Quote
"displaced ... bash" - I don't think so. You put /usr/bin/python in place of /bin/bash in your /etc/passwd entry and let us know how you get on, if you ever recover from doing so.

I did not say 'replaced' for a reason, and wasn't talking about interactive OS shells when I said it, either. Aside from very small scripts, what you once may have turned to bash (or Perl) for, the vast majority of times these days you'd probably choose Python, and this is the trend in most nixy OSes for small system tools too; I am sure that bash has lost popularity in favour of Python for scripting in the past decade.
73 de VE7XEN
He/Him
 
The following users thanked this post: gmb42, Picuino

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Python becomes the most popular language
« Reply #759 on: May 11, 2022, 07:34:06 am »
What you call fixes and peer review I call shitty hacks  :-DD

You have not compiled a full distro recently...

I have a half dozen packs segfaulting with MESON  while they compile and run perfectly with autoconf..

It is not that simple
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Python becomes the most popular language
« Reply #760 on: May 11, 2022, 09:07:43 am »

The bottom line is that Autconf and all GNU build system was meant as cross platform
and they do work very reliable in all of them..


I was known as The Solaris Man before Larry bought them and turned The Old SUN evil.  I spent the better part of the early 00s trying to compile GNU software on Solaris, using the Autoconf shite, not seldom using the Sun compilers.  To call that festering pile of optimistic programming that is Autoconf "reliable" is a true Baghdad Bob moment in my book.  Then, it also does not work.
(..)


As far as  SOLARIS is concerned...  we have some sort of OUT_OF_THE_SPECTRUM  "product(s)"

Sun came down the hill across the 90s.. 00s.. 10s...  up to the point where it does not even counts.

There is no surprise..  they could not position themselves when SCO sunk...
They could not position themselves when GNU tools arise on the Linux and BSD arena..
and they could not position themselves today  as well.

Considering Automake tools are GNU based and Sun insisted way too long in not following the GNU best practices...  nobody really consider porting Automake scripts for Sun...

Automake is not simple to deal and requires a considerable cumulative tidbits..

At the moment who really cares about SOLARIS while deploying OpenBSD FreeBSD  TrueNAS or some of the 100 available LINUX...   nobody cares...

bottom line .. you can not compile BSD or LINUX without Autoconf at the first step.
MESON has been a pot of glued hacks trying to force Python into everybody throats..

Some packs are still unreliable having both MESON and Autoconf...

and so far.. reliable is Autoconf..

At this point nobody really cares porting Autoconf macros to SOLARIS..
it just makes no sense

Paul
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4040
  • Country: nz
Re: Python becomes the most popular language
« Reply #761 on: May 11, 2022, 10:40:41 am »
Sun came down the hill across the 90s.. 00s.. 10s...  up to the point where it does not even counts.

I used Sun stuff a lot in the 90s. A SPARCStation ELC (33 MHz, 64 MB RAM, CPU built in to a 1152x900 mono screen) was my first personally owned *nix machine, bought for $50 or so from a university that was moving on to more powerful machines. I taught myself *nix going through all the binaries, everything in /etc including the init/runlevel stuff. Stood me in good stead for some consulting jobs right afterwards. Learned emacs on that machine, haven't used anything else seriously since.

The last time I used Solaris was in a job for a telephone exchange add-on ("IN" -- Intelligent Network) company in 2002-2003. Their old legacy machines were HP/UX, the current production stuff was Sun, all the devs wrote and tested everything on Linux first -- and Linux had valgrind, which was used extensively. My work PC then was an Athlon XP 1800+
 

Offline mansaxel

  • Super Contributor
  • ***
  • Posts: 3554
  • Country: se
  • SA0XLR
    • My very static home page
Re: Python becomes the most popular language
« Reply #762 on: May 11, 2022, 11:31:32 am »

The bottom line is that Autconf and all GNU build system was meant as cross platform
and they do work very reliable in all of them..


I was known as The Solaris Man before Larry bought them and turned The Old SUN evil.  I spent the better part of the early 00s trying to compile GNU software on Solaris, using the Autoconf shite, not seldom using the Sun compilers.  To call that festering pile of optimistic programming that is Autoconf "reliable" is a true Baghdad Bob moment in my book.  Then, it also does not work.
(..)


As far as  SOLARIS is concerned...  we have some sort of OUT_OF_THE_SPECTRUM  "product(s)"

Sun came down the hill across the 90s.. 00s.. 10s...  up to the point where it does not even counts.

Autoconf sucked even when Solaris and Sparc was a major platform. It's always sucked.

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Python becomes the most popular language
« Reply #763 on: May 11, 2022, 12:19:55 pm »

Autoconf sucked even when Solaris and Sparc was a major platform. It's always sucked.

It is TRUE..  i can not agree more...

But..  it still is the primary and best tool to have the job done..

For anything concerning GNU and a wide spectrum of tools based on it..

What to expect...  it still is a several decades old tool with fixes and thousand reviews...

We live with it..

Re inventing the wheel may be a FIASCO.. ( as the ISC consortium learned the hard way...)
Paul
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6265
  • Country: fi
    • My home page and email address
Re: Python becomes the most popular language
« Reply #764 on: May 11, 2022, 12:40:34 pm »
A major point of the above autotools discussion relevant to Python is that whatever you do, you want the language base libraries to be the same across all systems, for the code to be portable.

If C hadn't fragmented, no autoconf+automake would have ever been needed.  After all, their main purpose is to discover the installed libraries and their system-specific quirks for the code to compile and run correctly.

The way OS-specific interfaces are exposed in Python via the os built-in module isn't exactly optimal, though.  If each OS family was exposed via a submodule (say, os.posix, os.linux, os.bsd, os.macos, os.windows, etc.), then it would be possible to write OS dependent Python that could still be run on another system via a compatibility module (that probably would have application-specific runtime tunables to deal with the completely different interfaces and their assumptions on different OSes).
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Python becomes the most popular language
« Reply #765 on: May 11, 2022, 01:05:10 pm »

If C hadn't fragmented, no autoconf+automake would have ever been needed.  After all, their main purpose is to discover the installed libraries and their system-specific quirks for the code to compile and run correctly.


that is no longer just about C

I have just upgraded my OCTAVE site this week to latest version....

Marvelous job  was done by the folks crafting a very good Autoconf set for that...

OCTAVE now requires a full and wide set of system libs...  in particular.. BLAS and LAPACK (otherwise it won't even configure.. )..   and both  BLAS and LAPACK  are compiled in FORTRAN and sustain -lgfortran  dependency..

bottom line that a sane group of tests (including binutils for ELF formats) should be done to check if mixing all these  inter-compiled libs will actually dlopen()  themselves when glued..

OCTAVE compiled fine .. took a long long time with more than 8cores dedicated to link the whole thing..

Thanks to Autoconf... no segfaults...

We barely could rely that sort of  redirection tests to some Pythonish "os.module"...

Paul
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7770
  • Country: de
  • A qualified hobbyist ;)
Re: Python becomes the most popular language
« Reply #766 on: May 11, 2022, 01:15:44 pm »
I was known as The Solaris Man before Larry bought them and turned The Old SUN evil.  I spent the better part of the early 00s trying to compile GNU software on Solaris, using the Autoconf shite, not seldom using the Sun compilers.  To call that festering pile of optimistic programming that is Autoconf "reliable" is a true Baghdad Bob moment in my book.  Then, it also does not work.

The first thing I did on Solaris machines was to install bash and the GNU soft dev essentials. With this setup I had rarely any problems with autoconf or compiling in general.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6265
  • Country: fi
    • My home page and email address
Re: Python becomes the most popular language
« Reply #767 on: May 11, 2022, 02:45:48 pm »
both  BLAS and LAPACK  are compiled in FORTRAN and sustain -lgfortran  dependency..
There are actually multiple implementations providing the exact same API (and ABI), from Goto to OpenBLAS to Intel MKL and AMD OCL.

Not all of them are written in Fortran, nor do all of them even have Fortran bindings.

We barely could rely that sort of  redirection tests to some Pythonish "os.module"...
Bullshit, because existing Python code that does not rely on non-builtin modules runs absolutely fine on all architectures.  That is proof that it can be done.  It is the contributed Python modules that rely on specific native libraries that makes things difficult.

Moreover, the fact that you can use native Qt 5 libraries using the same Python code using PyQt5, PySide2, or GIR bindings –– the first two using SIP and the latter using GObject introspection files to generate the Python bindings –– with something like a fifty-line module shim (that selects the interface to be used at runtime, depending on what is available, optionally controlled by an environment variable) –– shows that it is also practically possible; it is just a matter of the Python modules being uniform and available on all OSes also, without their own dependency hells.

You could ask "Why, then, do so many Python projects suffer from dependency hell?".  This is what my post above dug into.  Because the base library doesn't modularise OS features properly, many developers don't bother to do it either.  (I am drawing a somewhat tenuous relationship here, but I believe it is true: it just isn't something Python developers want to consider at all.)  Hell, most external Python modules don't even bother to state their library versions and dependencies!

That is a problem that an interpreted programming language could and should solve better.

If you want to provide an "universal Linux binary" using any interpreted language like Python, it is easiest to do so via a dynamically linked interpreter that uses a fixed directory for all its libraries, that directory being populated by symlinks to either system libraries or the versions provided along with the binary itself, whichever is newer or preferred by the user.  You could even have a run-time configurator utility to manage those.  (However, that has security implications re. system-wide vs. per-user installations, and the interpreter/binaries being able to modify themselves, making this approach one of those which basically requires a dedicated user and group for such an application.  Very doable, but it is a complex subject that requires quite a lot of experience to do right, which explains why it is so often done wrong.)

I often write POSIX C exactly because of this.  The subset and superset of C implemented is closer to what I need, so that the code I write does not need autotools to be compilable and runnable across basically all POSIXy systems (Linux, Android, MacOS, BSDs, Unixes with a POSIXy C library).  What does annoy me, however, is that as long as I use the standard C library in Linux, I cannot get at the really nifty features provided by the Linux kernel for my Linux-only code, like per-task credentials (user and group).  (The C library in Linux uses a realtime signal across all threads in the process to synchronize those in userspace.)

(I have written simple shell scripts to emulate basic ./configure functionality to modify an included Makefile fragment setting the directory paths and such.  It is not necessary to run it, but if someone wants to modify how the binary is compiled and installed, they can do so either via that script or by modifying the configuration Makefile snippet.  All explained in the traditional INSTALL text file.)

As someone having used Linux from Scratch extensively a decade or two ago, I'm very familiar with using autotools.  However, I do not like to write code that requires autotools to be compiled myself.  For similar reasons, I don't like CMake much either.  In other words, I am happy that autoconf and automake and CMake exist as they can often fix these issues without worries; that on my systems running GNU-derived build tools they almost always Just Work.  However, I am decidedly not happy that autoconf and automake are needed in the first place.
« Last Edit: May 11, 2022, 02:49:13 pm by Nominal Animal »
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Python becomes the most popular language
« Reply #768 on: May 11, 2022, 03:05:13 pm »
both  BLAS and LAPACK  are compiled in FORTRAN and sustain -lgfortran  dependency..
There are actually multiple implementations providing the exact same API (and ABI), from Goto to OpenBLAS to Intel MKL and AMD OCL.

Not all of them are written in Fortran, nor do all of them even have Fortran bindings.


Exactly . that boils down to the point

 http://www.netlib.org/blas/
 http://www.netlib.org/lapack/

You should  probably want to integrate Fortran77 subroutines designed to solve large scale eigenvalue problems with both..   soo....... a base system will end up with a mixture of libs like this one now..

 http://www.caam.rice.edu/software/ARPACK/

Code: [Select]
libarpack.so.2 => /lib/libarpack.so.2 (0xb4549000)
libblas.so => /lib/libblas.so (0xb7e57000)
libbz2.so.1.0 => /lib/libbz2.so.1.0 (0xb3df9000)
libcrypto.so.1.1 => /usr/local/ssl/lib/libcrypto.so.1.1 (0xb37ec000)
libcurl.so.4 => /lib/libcurl.so.4 (0xb4596000)
libfftw3.so.3 => /lib/libfftw3.so.3 (0xb5121000)
libfftw3_threads.so.3 => /lib/libfftw3_threads.so.3 (0xb527c000)
libfftw3f.so.3 => /lib/libfftw3f.so.3 (0xb4fc9000)
libfftw3f_threads.so.3 => /lib/libfftw3f_threads.so.3 (0xb511a000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb748a000)
libgfortran.so.5 => /lib/libgfortran.so.5 (0xb74ed000)
libgomp.so.1 => /lib/libgomp.so.1 (0xb56de000)
libgsasl.so.7 => /lib/libgsasl.so.7 (0xb3b30000)
liblapacke.so => /lib/liblapacke.so (0xb77ec000)
libncursesw.so.6 => /lib/libncursesw.so.6 (0xb444e000)
liboctave.so.8 => /usr/lib/octave/6.4.0/liboctave.so.8 (0xb5950000)
liboctinterp.so.9 => /usr/lib/octave/6.4.0/liboctinterp.so.9 (0xb6aec000)
libquadmath.so.0 => /lib/libquadmath.so.0 (0xb73e2000)
libssl.so.1.1 => /usr/local/ssl/lib/libssl.so.1.1 (0xb3a99000)
libtmglib.so => /lib/libtmglib.so (0xb732f000)

I hope the folks on octave devel  keep Autoconf because it worked perfect out of the box

Paul
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6265
  • Country: fi
    • My home page and email address
Re: Python becomes the most popular language
« Reply #769 on: May 11, 2022, 03:35:40 pm »
Code: [Select]
libarpack.so.2 => /lib/libarpack.so.2 (0xb4549000)
libblas.so => /lib/libblas.so (0xb7e57000)
libbz2.so.1.0 => /lib/libbz2.so.1.0 (0xb3df9000)
libcrypto.so.1.1 => /usr/local/ssl/lib/libcrypto.so.1.1 (0xb37ec000)
libcurl.so.4 => /lib/libcurl.so.4 (0xb4596000)
libfftw3.so.3 => /lib/libfftw3.so.3 (0xb5121000)
libfftw3_threads.so.3 => /lib/libfftw3_threads.so.3 (0xb527c000)
libfftw3f.so.3 => /lib/libfftw3f.so.3 (0xb4fc9000)
libfftw3f_threads.so.3 => /lib/libfftw3f_threads.so.3 (0xb511a000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb748a000)
libgfortran.so.5 => /lib/libgfortran.so.5 (0xb74ed000)
libgomp.so.1 => /lib/libgomp.so.1 (0xb56de000)
libgsasl.so.7 => /lib/libgsasl.so.7 (0xb3b30000)
liblapacke.so => /lib/liblapacke.so (0xb77ec000)
libncursesw.so.6 => /lib/libncursesw.so.6 (0xb444e000)
liboctave.so.8 => /usr/lib/octave/6.4.0/liboctave.so.8 (0xb5950000)
liboctinterp.so.9 => /usr/lib/octave/6.4.0/liboctinterp.so.9 (0xb6aec000)
libquadmath.so.0 => /lib/libquadmath.so.0 (0xb73e2000)
libssl.so.1.1 => /usr/local/ssl/lib/libssl.so.1.1 (0xb3a99000)
libtmglib.so => /lib/libtmglib.so (0xb732f000)
Many of those are just the fortran bindings to the underlying libraries (libarpack, libfftw3f, libfftw3f_threads, libgfortran), and Fortran is not intrinsically faster than C (just easier to write efficient code for, especially when one wishes to use array slicing and such).  Unless you do write (some parts of) your application in Fortran, there is no benefit in having the Fortran bindings.

(I've read and written quite a lot of Fortran 95 code myself; molecular dynamics simulations for HPC clusters.  It is definitely easier to teach a Physicist/Chemist to write acceptable HPC code in Fortran than it is to teach them to do the same in C.  In either case it will be ugly and basically unmaintainable code, though.)

I hope the folks on octave devel keep Autoconf because it worked perfect out of the box
I hope so too.  It's not like we have anything better, really.  Some may argue CMake is better, but meh; I've not used both in enough different architectures and operating systems to say either way, and definitely porting an application from one to the other is not worth the effort.

I consider autotools a practical example of why it is so important that base libraries do not differ between OSes and architectures, and that OS-specific extensions/quirks are properly modularised.  Python does it half-way: its core has annoying parts that could have been better, but one can live with it.  It is the external Python libraries and their dependencies that are the problem in Python.  For autotools, initially the purpose was to handle the differences between the standard C implementations and extensions, and it just sorta grew from there, to cover other libraries via test cases as well.  Autotools should not be needed[/i], if the library interfaces are properly modularised and versioned.  We can't change C because there is so much existing code already, but when new languages are developed, it is something that definitely should be considered – but currently is not.
 
The following users thanked this post: nctnico

Offline PicuinoTopic starter

  • Frequent Contributor
  • **
  • Posts: 730
  • Country: 00
    • Picuino web
Re: Python becomes the most popular language
« Reply #770 on: May 12, 2022, 04:05:56 pm »
That's what I've come to write so far.

Merits and demerits of Python:

Speed:
Python imperative programming are slow. 50 times slower than C. (demerit)
Python can do very fast computations thanks to its libraries, such as numpy (merit)
Python has functional programming, faster than imperative programming (merit)

Code blocks and indentation
Python uses colons and indentation to separate blocks.
This is a merit for some people and a demerit for others.

Easy of programming
Python is very easy to program.
It is a good language to start learning programming. (merit)
This leads to a lot of code written by bad programmers. (demerit)

Code maintainability
Python helps to make code easily maintainable in the long term. (merit)

Libraries
Python has a large number of libraries (>300000).
Many for Artificial Intelligence, Big Data processing, Scientific, Web development. (merit)
Security issues relating the big number of libraries and dependencies (demerit)

Language updates
Frequent language updates that keep it up to date. (merit)
Frequent changes that are no longer compatible with previous versions (demerit)

Documentation and help
Python has many good free and paid manuals. (merit)
Python has a large, very active community of programmers from which help is readily available. (merit)

Multiplatform
Python is multiplatform and runs on Unix, Windows and Mac. Recently in a web client as well. (merit)
Cross-platform libraries present certain problems (demerit)
« Last Edit: May 12, 2022, 04:13:45 pm by Picuino »
 
The following users thanked this post: newbrain, bd139

Offline eugene

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: us
Re: Python becomes the most popular language
« Reply #771 on: May 12, 2022, 05:28:29 pm »

Easy of programming
Python is very easy to program.
It is a good language to start learning programming. (merit)
This leads to a lot of code written by bad programmers. (demerit)


I've heard this as a complaint about Python before and I've always had a hard time getting my head around it. (I know that Picuino is not introducing the idea hear, simply repeating it.)

It would seem that the only alternative is that no beginning programmers should be allowed to actually code anything until they've proven themselves to be a "good programmer." Obviously, that would be silly.

So what is the complaint really about? Is it just "good" programmers grousing, or is it believed that a programming language could exist that is easy for beginners to learn and somehow prevents them from being "bad." I expect that the truth is neither of those...
90% of quoted statistics are fictional
 
The following users thanked this post: nctnico, newbrain

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 6848
  • Country: va
Re: Python becomes the most popular language
« Reply #772 on: May 12, 2022, 08:32:03 pm »
Quote
It would seem that the only alternative is that no beginning programmers should be allowed to actually code anything until they've proven themselves to be a "good programmer." Obviously, that would be silly.

Well, kind of. A beginner of assembly programming would either give up or learn some hard lessons quite quickly. By the time they can string together a decently-sized application their code is likely to be decent. So there you have someone who really wants to be a programmer, and has made the mistakes to achieve that end.

OTOH, someone running off a couple of lines of BASIC in Word is probably wanting to be an author, and so long as the code seems to achieve what they are wanting to achieve, they're happy. And, apparently, a programmer.

I think the comments aimed at the likes of beginning Python programmers is that it's too easy not to make the mistakes that let you progress as a competent programmer. Stuff like cohesion and coupling, which seem unimportant when you're just gluing together some libraries. So when they write some slightly harder stuff it's the modern equivalent of spaghetti code. They need to fail a few times before sharing, perhaps, but it's too easy to share as well now!

Personally I have no idea about Python or programmers of same (the above is what I perceive to be the argument). However, I have looked at Arduino code, which I think is seen similarly, and not been overly impressed. Often, there is little to no error recovery - the stuff works great so long as nothing goes wrong! There is undoutedly excellent code, both Arduino and Python, it's just that there is also a quite high percentage of not so good code, because it's easy to write stuff that kind of works. And to share same.
 

Offline ve7xen

  • Super Contributor
  • ***
  • Posts: 1193
  • Country: ca
    • VE7XEN Blog
Re: Python becomes the most popular language
« Reply #773 on: May 12, 2022, 08:56:07 pm »
I think the comments aimed at the likes of beginning Python programmers is that it's too easy not to make the mistakes that let you progress as a competent programmer. Stuff like cohesion and coupling, which seem unimportant when you're just gluing together some libraries. So when they write some slightly harder stuff it's the modern equivalent of spaghetti code. They need to fail a few times before sharing, perhaps, but it's too easy to share as well now!

Personally I have no idea about Python or programmers of same (the above is what I perceive to be the argument). However, I have looked at Arduino code, which I think is seen similarly, and not been overly impressed. Often, there is little to no error recovery - the stuff works great so long as nothing goes wrong! There is undoutedly excellent code, both Arduino and Python, it's just that there is also a quite high percentage of not so good code, because it's easy to write stuff that kind of works. And to share same.

Unfortunately, while I think I can mostly agree with the interpretation of what's going on here, I think it's just another angle on the 'language safety' issue, which is a lot closer to something we can objectively compare between languages. It's hard to get code working in assembly for many of the same reasons that it's hard to write safe assembly even if your architectural decisions are good - there are a metric shedload of footguns, and you have to do lots of fiddly but critically important bits by hand. It means that beginner-level code will probably never see the light of day because they will give up, but it also means that experts have far more places to go wrong, and even the best programmers aren't always perfect, so while the code might be 'better', it's also far more likely to be dangerous or have weird bugs that crash the program for obscure reasons.

It's interesting that you mention error handling (and the kind of related input validation), because this is probably the biggest problem with 'amateur' code in 'hard' languages like C or assembly that works fine. It's good enough to work reliably, but bad enough to give remote shell access to anyone who bothers to try, or trash your directory if you give a weird filename or suchlike. It might not be ideal to let every exception bubble up all the way to the user, but it's more error handling than many C programs have, and is usually safe. Error recovery is a separate issue and is hard in every language  8)

Personally, I think that even if there's tons of 'bad' code written in Python, it's a much better situation than if that same code were all in 'good' assembly (ignoring that that's totally impractical, in real terms), because it's very unlikely that Python code is going to do something dangerous, most likely it will just be inefficient, which is not really a big deal. It will also be much easier to give a basic code review or debug.
« Last Edit: May 12, 2022, 08:59:34 pm by ve7xen »
73 de VE7XEN
He/Him
 

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23033
  • Country: gb
Re: Python becomes the most popular language
« Reply #774 on: May 12, 2022, 09:11:24 pm »
Interesting diversion on the thread. No programs are perfect but some languages allow several more layers of imperfection. Most of the newly conceived languages have one less layer of imperfection: no memory management, forced non-stupid error handling, better concurrency primitives.

On exceptions...

Recently I tripped over a wonderful bit of code, in C# in a HTTP integration service. In the resource controller it caught every exception thrown and returned an HTTP 400 code (bad request). This was expected for about 80% of the cases, of course the tested ones, but when the upstream integration failed and returned a simple Exception instance, it caught that and returned a 400 too. Of course that didn't drop to the global error handler which would have logged the context, exported the error rate through the logging metrics, kick prometheus into action and trigger an SLO violation and incident. Nope it just sat there swallowing errors until someone wondered why their shit had stopped working and called support.

There's probably a thousand places this is happening on that product and no one would know until the client phoned up.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf