Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Amicable divorce

by jcb (Parson)
on Jul 15, 2020 at 04:10 UTC ( #11119342=note: print w/replies, xml ) Need Help??


in reply to Re^2: Amicable divorce
in thread Amicable divorce

This was once unthinkable — now I find myself having to defend one of the Monastery's more infamous users.

I could name a few things that aren't purely interpreted and aren't interpreted at every run, such as [a list of XS-based modules]

I am fairly sure that this misses his point: Perl programs are compiled only to an in-memory form; there are no binary artifacts that remain usable even if they cannot be regenerated, as with languages like C. (C is a bad example here because backwards compatibility is maintained, but I do not know of any examples of compiled languages that did what PHP did — or any language other than PHP that did that.)

If your latest C compiler cannot compile your old sources, the old binaries still work; Perl programs have no such binaries. If current perl can no longer load the version of Perl your programs need, your only solution other than rewriting your code is to keep an old version of perl itself around that can load your code.

Put DBI in that list for your previous point too.

You are both correct here. DBI is an XS module, but his argument was centered on Perl's modularity: DBI only exists in your program if you ask for it, while in PHP all available extensions are effectively statically-linked into the interpreter and register their symbols in the single global namespace, a limitation that even Tcl moved beyond years ago.

The Perl language has largely avoided such snares because, as a language, it is minimal.
Compared to PHP maybe, but if you read the grammar it's really not and if you read the Camel it's really, really not.

Perl probably has the most complex grammar of any programming language I know, complex enough that full syntax highlighting in Emacs actually requires a fair amount of Lisp code to fix up what the syntax tables cannot express. As a language, Perl has very, very, vary far from a minimal grammar, but his point seems to have been that the set of builtins is small compared to PHP, where everything that Perl does with XS modules instead has to be provided by yet more builtins.

unless you truly believe that using a platform that's supported for things like bug fixes and security improvements represents no measurable business gain

I have worked in places like that. Managers often do not see that value; they see only "we have to spend all this money 'fixing' something that is not broken why again?" because you are changing a large amount of code for the same feature set.

No, managers do not always see security as "business value", either. There was one system, written in an old PHP4 framework, that kept getting cracked and various bots installed. Management preferred to routinely clean the intrusions off of the server instead of replacing the system with something reasonably secure. Yes, that is insane. No, that was not my call. I no longer work there.

Perl created a lightweight and flexible way to interface with the standard binary libraries upon which we all ultimately depend, without embedding this directly into the compiler/interpreter.
I have no idea what this means.

He seems to be describing XS in that sentence.

Lisp or a Scheme or a Forth or Smalltalk

Arguably, Common Lisp macros are a preprocessor, itself written in Lisp; consider the MACROEXPAND and MACROEXPAND-1 builtins from this perspective. Forth grammar is simple enough that defining procedures can make interesting quasi-syntax that ultimately relies on the Eliza effect, and I do not know enough about Smalltalk to comment. Raku is also notable here; if I understand correctly, there are metaclass-like entities in Raku that can define their own parsing rules, distinct from the main Raku grammar.

Replies are listed 'Best First'.
Re^4: Amicable divorce
by chromatic (Archbishop) on Jul 15, 2020 at 22:53 UTC
    If your latest C compiler cannot compile your old sources, the old binaries still work

    That's not always true, especially if they use dynamic linking. Sometimes it's not even true with static linking. (Try to run an old proprietary Linux game from before 2000 on a recent system, for example.)

    No, managers do not always see security as "business value", either. There was one system, written in an old PHP4 framework, that kept getting cracked and various bots installed. Management preferred to routinely clean the intrusions off of the server instead of replacing the system with something reasonably secure. Yes, that is insane. No, that was not my call. I no longer work there.

    I've seen that too, but you're reading into sundial's comment something he never said. He explicitly argued that there was no business value to moving from PHP 5 to PHP 7 and tried to convince people of that.

    That's not an argument I expect to hear from a developer of his purported experience. Running a public-facing project with a dependency that's out of support from its maintainers as well as long-term support from its distribution is ignorant and best and, more likely, malicious malfeasance.

    That's why I respond. I am 100% in favor of asking "What's the business value of this technical change?", but anyone who claims to be a senior developer but snidely brushes away the idea of security updates as an annoyance and hindrance is doing something very wrong.

      That's not always true, especially if they use dynamic linking.

      That is a fair caveat after a system upgrade, but I was thinking of a scenario where the compiler has been upgraded specifically.

      argued that there was no business value to moving from PHP 5 to PHP 7

      From the perspective of a manager who is looking only at the feature lists, what is gained by that change? The "after" feature list looks just like the "before" feature list.

      I see his perspective and I have seen managers apparently make decisions with that kind of thought process. I have had to very carefully firewall Windows servers partially from the Internet, so their services were still available, but the wandering malware could not reach the SMB listener. There was no upgrade path because another piece of proprietary software relied on that specific version of Windows and the newer version would have required a large chain-reaction upgrade (including replacing some very expensive long-life-span equipment that was actually still supported by its manufacturer but not by the other vendor) to continue to support a small part of the business that brought in enough revenue to keep operating but not enough to justify that much expense.

      The problem is what PHP did — breaking backwards compatibility and dropping maintenance on the older version. That Perl 5 remained maintained is why the Perl 6 fiasco did not kill all of Perl.

      PHP was able to drag its userbase along because most of them barely understand what they are doing and have no real alternative to PHP. A few well-run projects happen to be in PHP because their early prototypes were made in PHP and incrementally grew complex enough that migration away from PHP is very difficult for them. As an example, last I checked, MediaWiki has an ongoing long-term effort to migrate to Python. The typical small PHP "app" does not have anything close to the level of developers available to MediaWiki. They are stuck with PHP, and the PHP runtime developers learned this after pushing PHP 5 on their community and have continued to abuse this power.

      The perl developers do not have this power — mastering Perl in the first place requires developing a level of skill sufficient to easily branch out into other languages; I actually learned C after learning Perl. Perl developers can jump to other languages much more easily, and breaking backwards compatibility to the point of needing significant rewrites has a much lower threshold for those rewrites to go to some other language if there is the slightest hint that it could happen again. Put simply, Perl is a far better language than PHP, with a far more skilled community that, unlike most PHP developers, can already go elsewhere.

      Accordingly, I argue that backwards compatibility must not be broken without very, very, very good reasons — and the advice in PBP does not meet that threshold for a language that famously touts TIMTOWTDI.

        From the perspective of a manager who is looking only at the feature lists, what is gained by that change? The "after" feature list looks just like the "before" feature list.

        Sure, but why should anyone care what a really bad manager thinks? If we're going to chase the lemon market of terrible management, we're not going to get what we want.

        Perl developers can jump to other languages much more easily, and breaking backwards compatibility to the point of needing significant rewrites has a much lower threshold for those rewrites to go to some other language if there is the slightest hint that it could happen again.

        Ah, but from the perspective of a manager who is looking only at the feature lists, what is gained by that rewrite to some other language? The after feature list looks just like the before feature list!

        I think your argument here wants it both ways.

        Accordingly, I argue that backwards compatibility must not be broken without very, very, very good reasons and the advice in PBP does not meet that threshold for a language that famously touts TIMTOWTDI.

        There aren't very many people arguing seriously that backwards compatibility should be broken willy-nilly, but there seem to be several people arguing that other people are arguing that. That makes it difficult for me to take this argument seriously.

        My argument is that backwards compatibility is largely a good thing, but it's less important than:

        • Improving the default experience for new programmers
        • Fixing bugs and security flaws
        • Adding long-missing features

        The argument in favor of maintaining strict backwards compatibility has lost (. in @INC by default, hash randomization, do &sub syntax, pseudohashes, unescaped { in regular expressions, mandatory parentheses around quoted lists in iterations), and it's prioritizing use cases that neither contribute to Perl development nor have a coherent use case.

        I'll expand on the latter. What do we know about a project that's still deployed on Perl 5.6.1? We know:

        • They're not using much of the CPAN
        • They're not particularly interested in new Perl language features
        • They don't care about support from p5p or distributions
        • They don't care about security
        • If they're investing in their code, they're not considering any external factors as important

        What benefit is there in releasing a Perl 5.34 designed to support them that they will not update to (which we know because they haven't updated to 5.8.0, 5.8.1, 5.8.2, 5.8.3, et al)?

        They have chosen their support burden—lack of community support, lack of security features, backporting patches they want, dwindling OS and compiler toolchain support—so why put a greater support burden on people who actively do contribute to the language and the language ecosystem?

Re^4: Amicable divorce (Macros)
by LanX (Sage) on Jul 17, 2020 at 04:20 UTC
    > Arguably, Common Lisp macros are a preprocessor, itself written in Lisp; consider the MACROEXPAND and MACROEXPAND-1 builtins from this perspective

    Nope. Syntactic macros are lightyears ahead of preprocessor stuff.

    Source filters are fancy preprocessors and failed to deliver because they require an extra parsing phase and understanding of the grammar at a distance.

    Lisp macros look like functions but expand in the very same parsing phase, no confusion here. Eg a macro in a comment will never be expandend!

    And they get their arguments as code before it's evaluated and can reconfigure it. Eg a deeply nested peace of syntax.

    That's incredibly powerful.

    Switch.pm (and so many things more) as syntactic macro would actually really work.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      To me, the only difference is that the Lisp macro facility does not actually print its result for the next stage to read back in, but it could do that and still work. The difference from a preprocessor seems to me to be an implementation detail.

      I am currently up late drafting a Meditation on the broader topic. I hope to have it posted soon.

        That is the same as saying that all programming languages are equal because they are Turing complete.

        Common Lisp macro facility is far more than a preprocessor. It allows manipulation of the language AST using the full language and the mechanic is perfectly ingrained into it.

        That allows the programmer to create new abstractions, domain specific languages, or to add support for new programming paradigms (as for instance, logic programming or as suggested by LanX, alternative OO systems).

        That's like carriage vs rocket.

        The preprocessor struggles to parse the code.

        The only thing you can statically parse in Perl is POD.

        But the lisp macro gets the code (or rather AST) for free. No confusion where it begins or ends and about the elements in between.

        When OOP became popular, various lisp dialects just added some macros for implemention. Backwards compatibility included.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

        ) well as POD, you can't make it to code. Mind you:

        POD inside a here doc is both string code and extractable comment.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11119342]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2021-09-29 02:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?