Stories
Slash Boxes
Comments

SoylentNews is people

posted by janrinok on Monday September 16 2019, @09:06AM   Printer-friendly
from the use-whatever-you-want dept.

Arthur T Knackerbracket has found the following story:

Python sits firmly in top place in the newest annual ranking of popular programming languages by IEEE Spectrum.   

The ranking and others like it are meant to help developers understand the popularity of languages in a world where no one really knows what programmers are using on their laptops. 

IEEE Spectrum has placed Python in first spot since 2017, and last year it was just ahead of C++. The top language is given a score of 100, and all languages with lower scores are scaled in relation to it. C++ last year scored 99.7, followed by Java at 97.5, and C with 96.7.

Today, in the IEEE Spectrum's sixth annual ranking, Python's 100 is a long way ahead of runner-up Java's 96.3 score, while C is in third place with 94.4. C++ has slipped to fourth with 87.5, while in fifth is specialist statistical computing language R with a score of 81.5. 

The magazine for engineering members of IEEE, the world's biggest engineering and applied-science organization, attributes Python's popularity to the vast number of specialized libraries it has, especially for developers building artificial-intelligence applications. 

[...] They go on to note that Facebook, which was originally built with PHP, launched its alternative to PHP, Hack, in 2014 and since then JavaScript, TypeScript and Python have become the most popular languages for web development. 


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by Snotnose on Monday September 16 2019, @10:25PM (4 children)

    by Snotnose (1623) on Monday September 16 2019, @10:25PM (#894843)

    Python has a lot of nice features, and a wide range of applicability, but it doesn't make byte aligned structures easy.

    Um, Python is a scripted language. Of course it can't do byte aligned structures. Neither will Java, nor Perl, nor Javascript.

    Just because your only tool is a hammer doesn't mean every problem is a thumb.

    --
    When the dust settled America realized it was saved by a porn star.
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 2) by Snotnose on Monday September 16 2019, @10:28PM (1 child)

    by Snotnose (1623) on Monday September 16 2019, @10:28PM (#894844)

    I have this sinking feeling Perl can do byte aligned structures. I've used it enough over the past few decades to realize "just write a perl script" covers pretty much everything outside of poor management, and I'm not sure it can't make up for that either.

    --
    When the dust settled America realized it was saved by a porn star.
    • (Score: 0) by Anonymous Coward on Wednesday September 18 2019, @02:43PM

      by Anonymous Coward on Wednesday September 18 2019, @02:43PM (#895667)

      I have this sinking feeling Perl can do byte aligned structures.

      But what would you plan to use those byte aligned structures for?

      In most cases wouldn't you be able to do all that stuff in the perl library? https://metacpan.org/pod/Net::DHCP::Packet#SERIALIZATION-METHODS [metacpan.org]

      e.g. leave the C/ASM style stuff in the library and do the other stuff in perl.

      Many years ago for work I wrote a DHCP server in Perl and it was better and more secure than existing crap like ISC DHCPD.

      Rules based, easily handled >1000 VLAN interfaces, support for regex interface matching etc (e.g. if a dhcp packet came in through a matching interface do X). The rules, state, etc were stored in postgresql.

      FWIW Python seems to have become crappier for some scenarios in recent times: https://www.reddit.com/r/learnpython/comments/cbqd5n/what_should_i_use_to_generate_a_single_exe_that/ [reddit.com]

      This used to "just work".

  • (Score: 2) by HiThere on Monday September 16 2019, @10:42PM (1 child)

    by HiThere (866) Subscriber Badge on Monday September 16 2019, @10:42PM (#894852) Journal

    You're missing the point. Every Turing complete language (i.e. all common computer languages) CAN do anything computable. I *can* do byte aligned structures in Python. It's just a real pain. Enough of a pain that I always contemplate doing them in C and handling the interface problem...but it's not quite that bad. I could also define a specialized type and have it handle strings (either of bytes or chars) of known byte length. But it's enough of a pain that I always find a different way to solve the problem.

    Now at this precise instant I've got a problem that may cause me to dive into the metaclass protocol of Python to figure out how to solve it...but I'm hoping I'll be able to find a solution that's less of a problem. This would be easier in Smalltalk, but Smalltalk has it's own problems, that would make other parts of the problem worse. The language that would actually be best for addressing this problem is Self, or perhaps Io, but those are so slow as to make Python seem as fast as optimized assembler (and neither is well-maintained...though I think that Io is still being developed).

    --
    Javascript is what you use to allow unknown third parties to run software you have no idea about on your computer.
    • (Score: 0) by Anonymous Coward on Wednesday September 18 2019, @03:45AM

      by Anonymous Coward on Wednesday September 18 2019, @03:45AM (#895482)

      I don't understand your issue with strings vs bytes. Strings don't have a byte length because that depends on your encoding. If you want to get the length of an encoded string in bytes, then encode it, a la len(my_string.encode('utf-16-le')) or len(my_string.encode('cp-1252')). Otherwise, when you know the internal encoding used by your system and the type of string you are expecting, you can just get the size of the internal object and subtract the size of an empty string object, something like:

      >>>sys.getsizeof("A") - sys.getsizeof(str())
      1
      >>>sys.getsizeof("ABC") - sys.getsizeof(str())
      3
      >>>sys.getsizeof("X" * 1_000_000) - sys.getsizeof(str())
      1000000
      >>>sys.getsizeof("☺") - sys.getsizeof(str())
      15