Stories
Slash Boxes
Comments

SoylentNews is people

posted by hubie on Thursday July 07 2022, @09:53PM   Printer-friendly
from the agile-SNOBOL-FTW dept.

Over at ACM.org, Doug Meil posits that programming languages are often designed for certain tasks or workloads in mind, and in that sense most languages differ less in what they make possible, and more in terms of what they make easy:

I had the opportunity to visit the Computer History Museum in Mountain View, CA, a few years ago. It's a terrific museum, and among the many exhibits is a wall-size graph of the evolution of programming languages. This graph is so big that anyone who has ever written "Hello World" in anything has the urge to stick their nose against the wall and search section by section to try find their favorite languages. I certainly did. The next instinct is to trace the "influenced" edges of the graph with their index finger backwards in time. Or forwards, depending on how old the languages happen to be.

[...] There is so much that can be taken for granted in computing today. Back in the early days everything was expensive and limited: storage, memory, and processing power. People had to walk uphill and against the wind, both ways, just to get to the computer lab, and then stay up all night to get computer time. One thing that was easier during that time was that the programming language namespace was greenfield, and initial ones from the 1950's and 1960's had the luxury of being named precisely for the thing they did: FORTRAN (Formula Translator), COBOL (Common Business Oriented Language), BASIC (Beginner's All-purpose Symbolic Instruction Code), ALGOL (Algorithmic Language), LISP (List Processor). Most people probably haven't heard of SNOBOL (String Oriented and Symbolic Language, 1962), but one doesn't need many guesses to determine what it was trying to do. Had object-oriented programming concepts been more fully understood during that time, it's possible we would be coding in something like "OBJOL" —an unambiguously named object-oriented language, at least by naming patterns of the era.

It's worth noting and admiring the audacity of PL/I (1964), which was aiming to be that "one good programming language." The name says it all: Programming Language 1. There should be no need for 2, 3, or 4. Though PL/I's plans of becoming the Highlander of computer programming didn't play out like the designers intended, they were still pulling on a key thread in software: why so many languages? That question was already being asked as far back as the early 1960's.

The author goes on to reason that new languages are mostly created for control and fortune, citing Microsoft's C# as an example of their answer to Java for a middleware language they could control.

Related:
Non-Programmers are Building More of the World's Software
Twist: MIT's New Programming Language for Quantum Computing
10 Most(ly dead) Influential Programming Languages


Original Submission

 
This discussion was created by hubie (1068) for logged-in users only, but now 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 DannyB on Tuesday July 12 2022, @05:40PM (5 children)

    by DannyB (5839) Subscriber Badge on Tuesday July 12 2022, @05:40PM (#1260219) Journal

    I'm glad you know everyone's business better than they do. And you know the one perfect language they should all be using.

    GC has its place. That place is in most modern languages. There are still languages that do not have GC for uses where GC is wholly inappropriate.

    Sloppy web developers and other quick-fix junkies. And it's good for that. If you want tiny projects, Java, Python and friends are great quick fix tools to replicate common things.

    This is the one that tells me you really don't know what you're talking about. Maybe you are thinking of Javascript not Java?

    Java is for huge gigantic projects. Millions of lines of code. Written by many developers. Maintained for years even decades by many different people who have no contact with the original authors. Java does very well for this use. Unlike Python 2 vs 3 you can take the very oldest compiled binary or source code and run it on the latest Java versions. Java has a very carefully maintained backward compatibility. I think you do not understand the sheer amount of Java code in existence. I'm not saying you should like Java. Just realize that it really does have its place and is not some kind of mistake just because it is not suitable for YOUR purposes.

    Python is at the opposite end. Great for small projects because it is interactive and dynamic. Fantastic for prototyping. Even for good sized programs. But not for an enterprise application that I just described. Refactoring is a big problem with dynamically typed languages.

    I like Python. I like Lisp (various lisps). Java. Other languages. I use the right tool for the right job. Not a one size fits all.

    I take the view that any successful language must be doing something right for someone.

    Anything can be coded in any (Turing complete) language.

    That actually proves my point. We could, and you could write everything in assembly language. Do away with C and all higher level languages and mandate only assembly language worldwide for all programming. Period. No exceptions.

    Yes, it could actually be done. But at what cost?

    There is a reason Java exists. There is a reason it is successful. Java it not the right language for all possible uses.

    --
    If you think a fertilized egg is a child but an immigrant child is not, please don't pretend your concerns are religious
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 2) by JoeMerchant on Tuesday July 12 2022, @07:21PM (4 children)

    by JoeMerchant (3937) on Tuesday July 12 2022, @07:21PM (#1260255)

    >And you know the one perfect language they should all be using.

    There is no one perfect language. GC has its place, but the languages that use it tend to become unmaintainable byzantine disasters when you put them in the hands of people who "need" GC and ask them to do a large, long lived project with it.

    >I think you do not understand the sheer amount of Java code in existence.

    I have encountered plenty of it. I have also encountered a great number of management types who thought that Java was their answer for high performance cross platform solutions, and could never quite grasp why it would be unacceptably slow for any of our applications. I even encountered a couple of "Java prototypes" where management steamrollered the crew into "doing it in Java" and had to translate it out to something faster to make it anywhere near competitive in the marketplace. For my purposes, Java usually isn't the answer. I'm sure there are plenty of places where it makes sense, but I also suspect there are many places where it was a bad choice that got implemented anyway because nobody who knew better stood up to explain the issues.

    --
    Україна досі не є частиною Росії Слава Україні🌻 https://news.stanford.edu/2023/02/17/will-russia-ukraine-war-end
    • (Score: 2) by DannyB on Tuesday July 12 2022, @08:45PM (3 children)

      by DannyB (5839) Subscriber Badge on Tuesday July 12 2022, @08:45PM (#1260280) Journal

      Java is not slow. It is quite fast actually. You use commercial web sites that are Java without knowing it. All of the java bytecode is compiled down to native code. Unlike, say, PHP or Perl which is interpreted, or Python, when Java services an HTTP request, it is pure native compiled machine code that services that thread.

      When a Java program starts up, the java bytecode is interpreted (slow). As soon as any (at this point every) function is using a disproportionate amount of cpu, that function is immediately rapidly compiled into poorly optimized machine code by the C1 compiler, and is put on a list to be recompiled again soon by the C2 compiler. When the C2 compiler comes around, it spends a lot of time and effort producing highly optimized code. Better than an ahead of time compiler is capable of (such as C).

      Why better? Because the C2 compiler in Java has the WHOLE PROGRAM, not just part of it. When you compile in C, the compiler is only compiling part of the program. The linker may see the machine code of all the component parts which it links together, but it does not globally optimize them in any deep way.

      Java's C2 compiler can aggressively inline code and it does. It optimizes for speed over size. You can always buy more memory but you can't buy back time. With a compiled and linked program in C, a function in my precompiled library cannot be inlined into your code where you call my function. Your code and my code are independent development efforts. The C2 compiler has the entire program, in java bytecode form, to work with. It can rewrite function parameter calling conventions. It can recognize when certain methods in an object do not need a vtable entry because they are the only possible call target. (Something C++ cannot do)

      Because of all of this, a Java program seems to start up slowly and then "warm up" and run fast. Thus, Java is not a good solution for writing a replacement for the 'ls' command. But it is fantastic for a very large program running on giant servers where the program runs for a very long time without being interrupted or restarted.

      I almost never hear anyone complain about Java unless they really don't know much about Java.

      My journal article: It's fashionable to hate Java [soylentnews.org]

      That article explains a lot, and some SN readers were surprised.

      and had to translate it out to something faster to make it anywhere near competitive in the marketplace.

      It is funny that the marketplace, for enterprise applications, has already decided two decades ago.

      Ask yourself, why does Red Hat do research on the latest state of the art Java garbage collectors? Why are they spending money on this? See Red Hat's Shenandoah GC for Java. This can work with 16 Terabyte memory heaps with a max GC pause time of 1 millisecond. See for yourself. Yeah, Java is slow.

      Or Oracle's ZGC garbage collector which is also state of the art and has similar specs to the previous paragraph.

      Or why does IBM build its own Java runtime called J9?

      And why oh why does Microsoft, yes Microsoft contribute to Java development? Here's why: because their biggest mega customers all use Java extensively.

      If you're using Java for dinky programs that run in less than 32 GB of memory you're doing it wrong.

      --
      If you think a fertilized egg is a child but an immigrant child is not, please don't pretend your concerns are religious
      • (Score: 2) by JoeMerchant on Tuesday July 12 2022, @09:29PM (2 children)

        by JoeMerchant (3937) on Tuesday July 12 2022, @09:29PM (#1260304)

        >I almost never hear anyone complain about Java unless they really don't know much about Java.

        I had to actively start defending against Java being used on desktop PCs for heavy-lift analysis software 20 years ago. The primary Java cheerleaders had no idea of what they were talking about. At the time, bytecode interpretation in dedicated silicon was one of the "visions of the near future" which, to my knowledge, never materialized.

        Since then, Java (not Javascript) as web based applications have occasionally haunted me, forcing end-runs around modern browser security improvements. Small time stuff, 2-3 man-months to implement, that would have been better implemented in something else to achieve their "low maintenance cross platform" objectives.

        No doubt the large scale web-apps have benefited from advances in JIT compilation, but if you tell me that much of Facebook runs on Java and owes its elegant user experience to the power of Java I'm going to have to laugh you off the board.

        I wouldn't advocate for C++ to implement a big web based app, although I'm listening to an http interfaced mp3 player I coded up last year right now, it is pretty good for simple-ish stuff.

        >why does Red Hat do research on the latest state of the art Java garbage collectors? Why are they spending money on this?

        Because the customers want it. Doesn't make it "the best" answer for all problems. If you're at scale with 1000+ coders in a single playground, I see the need for sandboxes, garbage collection, etc. I play more on teams of 50 or less, often times over the past 30 years on teams of 5 or fewer engineers. We have always made self-contained widgets, not web-facing million+ user monsters. The widgets tend to have 5 to 100 man-years in their development, and serve a handful of users at a time, often just one.

        >If you're using Java for dinky programs that run in less than 32 GB of memory you're doing it wrong.

        Agreed. Our latest box only has 16GB of RAM.

        --
        Україна досі не є частиною Росії Слава Україні🌻 https://news.stanford.edu/2023/02/17/will-russia-ukraine-war-end
        • (Score: 2) by DannyB on Wednesday July 13 2022, @07:17PM (1 child)

          by DannyB (5839) Subscriber Badge on Wednesday July 13 2022, @07:17PM (#1260577) Journal

          It sounds like you have been influenced by Java long long ago and are unaware of what modern Java is like. Java has come a very long way. Java's C2 compiler is one of the most sophisticated compilers there is. Similarly some of its modern GC's.

          It was a mistake for browsers to ever support:
          * Java applets
          * Flash
          * ActiveX
          * Silverlight

          Java's C2 compiler can rewrite functions. For instance, produce two versions with two parameter lists and calling conventions. It can do this because it has the WHOLE program to work with at runtime.

          --
          If you think a fertilized egg is a child but an immigrant child is not, please don't pretend your concerns are religious
          • (Score: 2) by JoeMerchant on Wednesday July 13 2022, @08:19PM

            by JoeMerchant (3937) on Wednesday July 13 2022, @08:19PM (#1260596)

            >Java's C2 compiler can rewrite functions. For instance, produce two versions with two parameter lists and calling conventions. It can do this because it has the WHOLE program to work with at runtime.

            That's nice. Right now, I'm fighting with gcc over optimizing a "whole module" at one time. We have a system backbone of ~3000 properties with message broker getters, setters, default values, value changed signals, etc. and the biggest of our property using applications is causing the gcc linker-optimizer to balloon in optimization time such that the total system build is taking 14 minutes with 2900 properties, 15 minutes with 2925 properties, 17 minutes with 2950 properties, 20 minutes with 2975 properties, 24 minutes with 3000 properties, etc. The basic problem is: all the properties are written to a single module and when gcc is optimizing this "whole module" at one time, it is scaling at something like O(n^3) optimization time, and we're getting to the point where that is starting to hurt.

            I believe we're coming down to horses for courses. If you're writing a Facebook competitor, Java may be your horse. I live in a world of 5-50 developers writing apps that are used by 1-5 users at a time running on a single machine of the Core i7-6xxx class. We've got some STM-32 accessory boards playing in the system, and might network out for 2% of the total functionality of the system, otherwise we're focused on delivering the best user experience to our local user(s) on ~10K copies of this mostly self-contained system running in 40+ countries around the world. We sell the system for $10K-$40K at a build cost of around $8K, but that's not the point, the point is to sell $200 disposable "razor blades" (that we make for $50 net per copy after $5M development costs) that the system enables our users to benefit from during their $2-5K operations. Our best users do ~1500 operations a year, for a profit of $225K annually per device to us on the "blades" alone. So, we're not Facebook, but just this one device (of about 6 that we make) nets around $700M per year - not all users are "best" users, some only do 10 operations per year per device. Our software dev team for this device might run a total headcount cost of around 30 (coders, testers, quality, etc.), at maybe $220K per head (not that we take home anywhere near that), so we're only costing about 1% of gross revenue - not a bad margin, and not an insignificant business model. Over the last 30+ years, I have worked for a dozen similar companies with similar products, and Java is just not our horse, though we are starting to let the Javascript camel's nose under the tent flap, in the name of diversity and accommodating the available hiring pool which includes our latest programmer who took a maternity leave last month.

            --
            Україна досі не є частиною Росії Слава Україні🌻 https://news.stanford.edu/2023/02/17/will-russia-ukraine-war-end