Announcement

Collapse
No announcement yet.

Perl 7 Announced As Evolving Perl 5 With Modern Defaults

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #41
    Originally posted by pgoetz View Post
    You do realize there's a yearly competition for writing the most obfuscated C code? It's possible to make C just as, if not way more unreadable than badly written Perl. And I'd rather shoot myself in the head than to have to read another paragraph, er line, of Java code.
    Yeah, and? You can make grammatically correct sentences in English that makes no sense either. Doesn't mean you can't make sentences that are easier to understand.
    The problem with Perl is it's always hard to understand to anyone who hasn't invested a lot of time to learn it. You can't say the same of most other languages.
    The Camel book does more than teach you how to program Perl, it's a treatise on how to think about programming in general. The Camel book is still hands down the best programming book I've ever read, and I've read quite a few. If you were able to write programs in languages after spending less than 5 minutes on tutorials, then either you're talking about a language whose syntax is very similar to another language you've already spent extensive time with, or you're writing mickey mouse programs. Anyone who knows anything about programming knows that all those "Learn C++ in 20 Days!" books are complete bullshit. Yes, you can learn some syntax in 20 days, but it takes at least months, generally years of practice to become proficient in a language that's sufficiently expressive to allow for the solution of complex tasks.
    I didn't say the book doesn't, but programming is all about logic. A logical mind will pick up on something foreign but built logically. Perl doesn't look logical at a glance, it looks like someone crammed a bunch of random symbols in front of everything to mean something different.
    As for "you're talking about a language whose syntax is very similar to another", that's my entire point. Pretty much every major language has enough similarities where you can jump from one to another without having to re-lean everything, except Perl. The only professional training I got was for C and shell scripting. Every other language I know I managed to figure out within a few hours or days based on what I knew from those. As for "mickey mouse programs", one of these programs was the entire project management system for the company I currently work for, and it has resulted in a significant increase in revenue every year. This was made in Python, a language I taught myself within a matter of days (I knew the language prior to working on that project). I also built a database search tool out of PHP that our customers pay thousands for, and that's a language I didn't use any tutorial to learn. Meanwhile after spending a full hour trying to decipher this Perl code that just outputs a simple XML file, I'm just like "this is a waste of time" and re-wrote the whole thing in a couple days.
    I'm not saying Perl is hard, I'm saying it's gibberish to anyone who didn't seriously try to learn it. You can't say the same of other languages. I have no doubt whatsoever that someone who learned Perl could pick up on any other language without much difficulty.
    In particular, you did not learn how to program in javascript after spending 5 minutes on a tutorial. Just saying that tells me you don't know javascript and are bullshitting. Just understanding how "this" works takes more than 5 minutes.
    Why? Just because you suck at it, doesn't mean I have to. I never said I was proficient at it, but you need to know Javascript if you intend to do anything worthwhile with PHP (EDIT: yes, I know you can write entire complex programs in PHP, but my point is it's usually server-side logic to a website, and to do any complex interactions with it tends to need Javascript).
    For the record, I actually despise Javascript. It's a horrible language, but, at least it's easy to read. The only reason I know how to do anything with it at all is because it doesn't pull the weird crap Perl does.
    All you're really telling us is you're not interested in spending the time to learn Perl, which is fine, but don't extrapolate your ignorance into a criticism of the language itself.
    First of all, it's not ignorance, it's neglect. Learn the difference. I gave Perl a shot more than once and found it to be a waste of effort, because time is money and I don't have the time to spend on a now niche and dying language. As stated before, there's a reason Perl isn't popular despite the pioneering it has done. I don't suppose you have a better idea besides its steep learning curve?
    Second, I find it unreasonable to dislike something without good reason. If I were to just simply say "I don't like Perl so I don't want to learn it" that just makes me look like an asshole. So, I gave a reason.
    Last edited by schmidtbag; 25 June 2020, 12:58 PM.

    Comment


    • #42
      Originally posted by Raka555 View Post
      After actually reading the Perl announcement, my personal opinion is that this will be the final nail in Perl's coffin...

      They cite the following users of Perl:
      • People who are never going to change their code
      • People who use new features
      • People starting from scratch
      The problem is there will be no "People starting from scratch" because of all the bad press.
      It also seems to be too hard to learn for the new generation.

      That leaves only the other 2 categories.
      So now they are going to break most existing scripts/modules in favor of new features. (I know they promise and claim otherwise)

      This will just piss off current Perl users and instead of fixing the old scripts, they will rewrite it in something "new" and close the chapters on Perl...

      RIP Perl. We had a lovely romance ...
      To get best practices from a Perl 5 program, you need to start each source file with something like this:
      Code:
      [COLOR=#66d9ef]use[/COLOR] v5[COLOR=#ae81ff].24[/COLOR];   # force a minimum 5.x release
      [COLOR=#66d9ef]use[/COLOR] utf8;
      [COLOR=#66d9ef]use[/COLOR] warnings;
      [COLOR=#66d9ef]use[/COLOR] open [COLOR=#e6db74]qw(:std :utf8)[/COLOR];
      [COLOR=#66d9ef]no[/COLOR] feature [COLOR=#e6db74]qw(indirect)[/COLOR];   [COLOR=#66d9ef]# actually needs a 5.32 if you want to use this one
      use[/COLOR] feature [COLOR=#e6db74]qw(signatures)[/COLOR];
      [COLOR=#66d9ef]no[/COLOR] warnings [COLOR=#e6db74]qw(experimental::signatures)[/COLOR];
      With Perl 7 you get all of those by default, and if you want the Perl 5 defaults instead you can just put the single line:
      Code:
      [COLOR=#66d9ef]use[/COLOR] compat:perl5;
      So for existing code, if it's well written to make support for Perl 7 you do nothing. If it's using deprecated features, you add one line to the top. Their plan going forward is to add options that are off by default that you use with each minor release of Perl 7, and then when Perl 8 comes out those options will be enabled by default, and you can start your source file with "use compat:\perl5;" or "use compat:\perl7;". This makes writing the Perl runtime itself harder on the maintainers, but it allows the language to be evolved.

      Among other things, one of the experimental features they want to add in Perl 7 is an object-oriented system in the core language (beyond 'bless' and all of the boilerplate you needed to use it). Moose and Moo are fine object systems, but it's a hassle to have to download a bunch of dependencies for something that's builtin to most other languages.

      If they do nothing, Perl is just going to die anyway. I think this is the best option they had. And maybe if I'm lucky, in 20 or 30 years Perl 17 will be Raku anyway.

      Comment


      • #43
        Originally posted by pgoetz View Post
        If you don't know Perl, you won't be able to read Perl code, this is true. One might argue that you probably shouldn't be trying to modify code written in a language you don't actually understand. If you know Perl and still can't read the code, that's not on Perl, that's on the shitty programmer who wrote the code. Perl is extremely flexible and allows you to write poorly formatted, obfuscated code. That doesn't mean you should do so. You can make Perl code just as readable and elegant as code written in any other language.
        I generally agree; I don't like modifying code in a foreign language because it's easy to screw something up. But, modifying PHP code is how I learned how to make something new in it. Attempting to modify Perl code is what got me to say "screw it" and re-write the whole thing.
        If Perl can be made just as readable as any other language, I have yet to see an example of that. I'm sure Perl isn't that difficult once you know it, but the reason I fault the language is you just simply can't reliably learn it by reading it and tinkering with it; you HAVE to read books, take courses, or use tutorials to get anywhere, regardless of any other programming knowledge you have. I'd be curious to hear the story for someone who is the exception to that.

        Comment


        • #44
          Originally posted by schmidtbag View Post
          I generally agree; I don't like modifying code in a foreign language because it's easy to screw something up. But, modifying PHP code is how I learned how to make something new in it. Attempting to modify Perl code is what got me to say "screw it" and re-write the whole thing.
          If Perl can be made just as readable as any other language, I have yet to see an example of that. I'm sure Perl isn't that difficult once you know it, but the reason I fault the language is you just simply can't reliably learn it by reading it and tinkering with it; you HAVE to read books, take courses, or use tutorials to get anywhere, regardless of any other programming knowledge you have. I'd be curious to hear the story for someone who is the exception to that.
          I think if you get a guide to the use of $, %, @, and &, and a reference sheet for the special variables and a few of the syntactic quirks, you can start reading and writing Perl within a day.

          Most developers who just jumped into Javascript from C and other languages think everything is straightforward until variable scoping bites them in the ass.

          Working with C pointers looks pretty straightforward, but most people starting in that encounter a series of buffer overruns and segfaults until their mental model of the feature matures.

          Lisp dialects look alien to people coming from most other programming languages, but once you get used to it the parenthesis aren't a problem and you just work.

          I think, "I knew language X pretty well, so I could use language Y without any problems even though I never saw it before" is actually pretty rare.

          Comment


          • #45
            Originally posted by pgoetz View Post

            Thanks for taking the time to write all that up -- it was informative.

            I'll speak to just one point, the one quoted above. I work with scientists, particularly molecular biologists who are becoming more and more dependent on computational methods, and virtually everything we use is still written in Python 2. The Python 2 vs. Python 3 thing is an ongoing source of frustration in the real world; so much so that almost everything has be to run out of a conda environment, which comes with its own problems; most particularly when you need to pipe the output from one program to the input of another one in a different conda environment. Seriously, the Python 2 vs. Python 3 thing alone has me cringing every time I get a request for a new analysis tool and find out it's written in Python, or is encapsulated in miniconda by someone who doesn't really understand how the conda thing works (the norm, since it's frequently biologists writing the software).
            Another fair point. I was thinking about it in terms of "I need dependencies for X. What should I start my project in?"

            I'll freely admit that I'm still behind schedule on migrating my own stuff to Py3.

            Comment


            • #46
              Perl is super efficient, when compared with majority of scripting languages..
              It uses low resources, it has one problem( it doesn't scale well in multicore systems, like other languages.. ).

              One example, I consider python a not so good language, contrary to Perl it uses insane amounts of resources to accomplish the same as Perl,
              But it does scale well in multi core systems, but it also uses lots of resources..

              Outside scaling problems I see nothing wrong with Perl( you can avoid the shenanigans ).
              A language that I would not program with, even if well paid would be Ruby..

              I had read some code during the last 20 years in Perl, and I don't see nothing really strange on it, even though that, I don't consider the shenanigans, a feature, but instead a bug in the language..although I do consider that Regular expressions are a very powerful tool, in any language, but abusing it should be avoided..

              Comment


              • #47
                I do hope perl to evolve on, or becomes Raku eventually. It is a good script language. It is like C, and more than C in terms of ease to shoot on one's own foot. It is efficient but never possible to be comparable to compiled language anyways. People don't care about 1sec or 2sec to finish something. If 1minute vesus 2 minute it'll be another story and people will usually pick up a compiled language.

                Now I am wondering why there is still no one language that can be both interpreted (with a subset, for easy learning) and compiled (for real efficiency), and also easy to read and intuitively expressive. Give me examples if you happen to know. I don't even know a remotely close candidate of such.

                So there is still needs to creating new language...

                Or, if a compiled language is more suitable to create an interpreter for than others, which one is it? Rust?

                I don't expect a script language can become compiled easily though. PHP even compiled is not a good generic language.
                Last edited by goTouch; 27 June 2020, 04:48 PM.

                Comment

                Working...
                X