Announcement

Collapse
No announcement yet.

PXP 0.0.1 Released For What Aims To Become A Superset Of PHP

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

  • #11
    Has there ever been anyone who took PHP and thought, nah, this isn't enough, I need more syntax?

    Well, apparently there have, otherwise this project wouldn't exist, but still, quite hard to believe lol.

    Comment


    • #12
      Originally posted by zexelon View Post

      Having spent a ton of time developing in PHP for many years... I can confirm it sucks. That "$" syntax was something I just could never get used to! The language and associated libraries are also severely inconsistent. I have some legacy projects in PHP that still have to be maintained and I dread every time I have to approach them!
      I don't agree.
      As a long time PHP developer myself, I find it super useful when you want to write templated strings (as well as in bash):

      PHP Code:
      $name "pluto";
      echo 
      "Hello $name, how are you?"
      For the rest of the sentences, despite the many inconsistencies of PHP libraries and the horrible choices of things like DateTimeImmutable, a decent programmer can absolutely write very good and maintanable code in PHP.
      On the other hands, a bad programmer can write poor code in Java, PHP, C, C++, Python, Rust or whatever... the language itself does not really matter.
      Last edited by blackshard; 16 May 2023, 06:12 PM.

      Comment


      • #13
        Originally posted by Jakobson View Post

        Pretty eXploitable PHP
        Does PGP mean "Pretty Gross PHP" then? :P

        Comment


        • #14
          Originally posted by blackshard View Post
          I don't agree.
          As a long time PHP developer myself, I find it super useful when you want to write templated strings (as well as in bash):

          PHP Code:
          $name "Pluto";
          echo 
          "Hello $name, how are you?"
          It's not necessary to have $ on out-of-template-string variables to use it inside template strings.

          Bourne-family shells do it that way.
          Code:
          $ name="Pluto"
          $ echo "Hello, $name, how are you?"
          Hello, Pluto, how are you?
          JavaScript requires curly braces, but allows arbitrary expressions in its backtick-delimited template literals:
          Code:
          let name = "Pluto"
          console.log(`Hello, ${name + "-san"}, how are you?`);

          Python doesn't use $, but it has something similar with f-strings (string literals with an f modifier prefix):
          Code:
          >>> name = "Pluto"
          >>> print(f"Hello {name}, how are you?")
          Hello Pluto, how are you?
          ​(Python doesn't allow arbitrary expressions, but it has a printf-like set of formatting modifiers.)

          Rust's println!, print!, eprintln!, eprint!, and format! are comparable, feature-wise and syntax-wise to Python's f-strings:
          Code:
           let name = "Pluto";
          println!("Hello, {name}, how are you?");​
          (Being able to do println!("{hello}"); instead of println!("{}", hello); or println!("{0}", hello); or println!("{hello}", hello=hello); is a relatively recent feature in Rust and, like Python, it doesn't support arbitrary expressions so something like println!("One-based: {}", zero_based + 1); still needs to use the argument list approach.)

          I'm not aware of a template literal syntax in Ruby, but it does have the same "% as an sprintf-like string-formatting operator" feature that Python treats as legacy functionality:
          Code:
          name = "Pluto"
          puts "Hello, %s, how are you?" % [name]
          Last edited by ssokolow; 17 May 2023, 02:26 PM.

          Comment


          • #15
            Originally posted by zexelon View Post
            uid313 Yah, I moved over to Python as the back end of choice. Nothing is perfect though... Python has some really nice things... initially... that come back to haunt you as the project grows if your not careful, but its way easier to read and make sense of I find.
            Python is alright too, but I think it is not as easy to type hint as PHP, in Python you have dict/mapping, list/sequence/iterable. Static fields can be confusing in Python, the http client in the standard library sucks (so you have to use requests which is better but is not async), the JSON module in the standard library cannot deserialize to classes, etc. PHP have strict_types which makes it more reliable. I think PHP with interfaces and abstract classes is more suitable to architecture than Python with ABCs and protocols.

            Python is a good language for AI, math, robotics, and tinkering, but I think PHP is the better language for the web. Of course, PHP has its shortcomings too which is outside the web which is where Python shines.

            I much prefer ASP.NET Core over both PHP and Python as the backend of choice.

            Originally posted by WiR3D View Post
            I don't get this, really don't.

            I used to code a lot in php in the symfony 3 days, I still have to code review a lot of php/symfony. The language has made staggering improvements in both functionality and performance, which is epic.

            Symfony is as incredibly powerful as ever and equally baffling/not user friendly. Well it is basically a framework to define your own project framework so I guess that's expected.


            Back to the point. In such a rapidly evolving language why bother with a superset... Like I mean Hacklang?
            I think many people aren't aware of the evolution of PHP and how much it has improved over the years.
            PHP used to get a lot of criticism and it was deserved, which got PHP a bad reputation but the development team has really improved and modernized PHP over the years.

            Hacklang was interesting some years ago, and has served like an idea or test bed, much of what Hacklang pioneered has been implemented in PHP so nowadays Hacklang is less interesting because PHP has improved so much, but it is still great that Hacklang came along because it inspired PHP so much and I guess PHP wouldn't be what it is today if it weren't for Hacklang.

            Comment


            • #16
              Originally posted by uid313 View Post
              Hacklang was interesting some years ago, and has served like an idea or test bed, much of what Hacklang pioneered has been implemented in PHP so nowadays Hacklang is less interesting because PHP has improved so much, but it is still great that Hacklang came along because it inspired PHP so much and I guess PHP wouldn't be what it is today if it weren't for Hacklang.
              100% agree, it was like the kick of possibilities php needed. And tbh as I read newer code I'm constantly pleasantly surprised.

              That said, out of curiosity how are you running asp.net? On Linux or windows. Because managing windows vm's with all their networking oddities and the occasional "I have spontaneously decided I no longer want to communicate with any network" plus the resource footprint has kept me faaaar away.

              Comment


              • #17
                uid313 I would like to second what WiR3D asked! How are you running your ASP setup?

                Yes, Python has some shortcomings... especially around static typing and it takes some work to fix that, but it is largely the blend of features that make it really attractive, especially if you want to build ML/AI into a platform. Python can help you eliminate a whole language from your stack.

                A ton of people use ASP.net these days, but I have no personal experience with it as everything I am involved with is built on a Linux base.

                Comment


                • #18
                  Originally posted by WiR3D View Post

                  100% agree, it was like the kick of possibilities php needed. And tbh as I read newer code I'm constantly pleasantly surprised.

                  That said, out of curiosity how are you running asp.net? On Linux or windows. Because managing windows vm's with all their networking oddities and the occasional "I have spontaneously decided I no longer want to communicate with any network" plus the resource footprint has kept me faaaar away.
                  Originally posted by zexelon View Post
                  uid313 I would like to second what WiR3D asked! How are you running your ASP setup?

                  A ton of people use ASP.net these days, but I have no personal experience with it as everything I am involved with is built on a Linux base.
                  I am using ASP.NET Core, not to be confused with the old ASP.NET.
                  The old ASP.NET was for the .NET Framework (like 4.8).
                  The new ASP.NET Core is for the .NET (previously called .NET Core) which is a new platform or framework that is different from the previous one. ASP.NET Core is cross-platform with native and official support for Linux.

                  I develop on Ubuntu with VS Code then I can run that on my machine. Then I deploy on Azure where I first can build it on a Windows, Mac or Linux machine (it doesn't really matter), and then deploy it to a Windows, Mac or Linux machine (it doesn't really matter).

                  Comment


                  • #19
                    There's no fate for "supersets" of actual programming languages.

                    Once PHP gains any of the same features but with a slightly different syntax, you're in a world of hurt. The problems only compound if it's impossible to adapt the "superset language" to native PHP syntax without conflicting with other syntax reserved for other language features. PHP is especially nasty to expand syntax-wise due to the idiotic decisions made way back when (or last night).

                    Comment


                    • #20
                      Originally posted by uid313 View Post
                      I am using ASP.NET Core, not to be confused with the old ASP.NET.
                      The old ASP.NET was for the .NET Framework (like 4.8).
                      The new ASP.NET Core is for the .NET (previously called .NET Core) which is a new platform or framework that is different
                      Oh my! Microsoft is really bad with naming, isn't it?!

                      Comment

                      Working...
                      X