Also, not sure why so many people seem to take "... written in PHP" as a gauntlet slap to their own face, instead of some additional technical information.
If you have nothing to add to the conversation other than witty snark about PHP, maybe your time would be better spent writing a competing open source product in a language of your choice, giving it away for free, and then letting users compare their pros and cons?
Seeing this thread derail into a discussion about PHP is pretty annoying. It seems to happen to anything PHP-related here. Do that all day long please, if someone comes here saying PHP is the best language... but he created something useful and open sourced it - that deserves more than toxic bike shedding about your favorite toys.
It can be handled using a single go binary using pgrok which comes less the source code size and not to mention without any dependencies on almost all platforms!
This requires unnecessary things to bundle and too complex for some simple stuff. Mileage may vary though.
But just my views.
...which does look useful indeed.
I don't even know how to run a Go server.
These tunneling services use a client-server architecture with the server-side running on a public IP address. A static binary written in Go, like pgrok, is ideal for the client-side. On the server-side, you want an app server that is both common and can dynamically load a module. A dedicated Go server makes sense if you are building a service but not if you want to add functionality to an existing app server with a public domain name.
The reason for asking is I'd like to find a self-hosted ngrok solution for development.
Going to try Expose soon, really excited by what it brings to the world of PHP without having to support a new stack.
PHP would benefit from the Zen of Python:
>>> import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
I guess at least 80% of web traffic would go to the Alexa top 100 sites. How many of those run on PHP? There was a time where many if not most of them ran on PHP, but today many have migrated away from it for performance reasons.
Large chunks of Slack?
That's a lot of traffic.
Fun fact: Companies typically leave PHP not for performance reasons (it's faster than Python and Ruby, for example) but because it's hard to hire people who know PHP since there's a strong bias against it.
(To be fair, I was one of those anti-PHP people, but after seeing PHP7, Laravel, etc, I acknowledge it's vastly improved from the early 2000s).
We got around that by hiring language-agnostic. Laravel is such a well designed framework we had no issue getting people contributing week 1, while continuing to expand their knowledge of the framework over time.
99% of users only read articles and blog posts, which is content that can be aggresively cached. If the workflow was not as cache friendly, they would not be using PHP, for sure.
Does it compare favorably or equally to most interpreted languages? Yes, it is not an outlier in performance (and tends to be one of the fastest cause of all the tuning it's had from use at high load companies). And yes, large chunks of the code in these companies still, today, run PHP. I guarentee you Wikipedia's global editor activity is higher than you think it is. Same with Tumblr and Slack's entire channel communication pipeline (which was an offshoot from Glitch).
It generally scales better than Ruby and Python. You can write shitty code in all of these languages and you can write clean code in all of these languages. And every language has it's warts (Python, which I LOVE and had a startup built around it, is FULL of these warts too).
The average person working on PHP applications cannot write a multithreaded socket server and do not understand TCP. They don't know how things work and what to do when they don't.
Their mental model is based on self-evident truths such as "Laravel is good because Laravel is good" and "PHP is good because PHP is good", but as soon as you ask why, they cannot really ellaborate in terms other than "because it's good". It's a cargo cult.
I assure you the actual writers of Laravel know why Laravel (or Lumen) is good and why they made decisions they made. I promise you the Facebook PHP engineers who worked on HHVM and Hack know best practices and PHP really well (and know how to write a multithreaded socket server and understand TCP).
I also promise you that there are engineers that work all over the place (like non pure tech companies like banks and insurance companies) that don't look at Java as craft. They use Spring cause it's "good" and have written the DAO pattern 100s of times cause it "works". I bet the vast vast vast vast majority of Java Spring developers have not read Rod Johnson's Expert One-on-One J2EE Design and Development and actually understand WHY Spring was invented.
Knowing Java doesn't create some magical space where you suddenly know the TCP protocol state diagram. That's just a silly statement. I promise ANY average developer of ANY language can NOT spit out a bare metal implementation of TCP. Hell, I bet the average Java developer doesn't know the difference between UDP and TCP (or the average php developer, average python developer, average ruby developer, you get what I'm saying)
PHP is a language. One that is as performant as it's peers, has a large presence on the internet, and is battle-tested. If you instinctively shit on PHP developers, that's something you need to work on.
And, just to be clear, I don't CODE IN PHP and never have. I just know people who are brilliant who do and also deal with some PHP buried in my company to this day (like pretty much every tech company).
I said "the average person working on PHP applications", that clearly does not fit the description of HHVM engineers at Facebook, people that certainly know what they're doing.
If PHP users are so great, let's take a quick look at what kind of discussions are they having in 2020:
"Why you should use asynchronous PHP", posted on February 2020:
Seriously? Communities for other languages already moved past this debate long ago. I do not have time to debate stubborn people trapped in 2004.
> PHP is a language. One that is as performant as it's peers, has a large presence on the internet, and is battle-tested.
PHP is not as performant as Java, C#, Go, Rust and many others. And it's battle tested in battles not worth having.
Again, you listed a ton of compiled languages compared to an interpreted language. Want to throw X86 Assembler in there too? Should we write all software in Intel syntax x86 Assembler? It's faster than Rust - just manage the registers yourself!
Fact is, interpreted languages have THEIR advantages in lots of areas.
Nice random zend link. I literally took 100ms and found questions on Stack Overflow about writing async PHP code from 2013.
Python LITERALLY just added the async/await keywords and co-routines in 3.5 in 2015 (AFTER PHP did). I can also link to "Why you should use Async in Python articles" from 2020 and 2019. Hell, google that phrase and see what comes up. Look at the talk tracks at PyCon last year.
I can also link to an article on how to do asynchronous programming in C# on MICROSOFT.COM from May 20, 2020 (you know, a pretty authoritative community place for .net) But it's a stupid point. There are tutorials to learn how to do things in every language written every day.
I get it, you're a language snob. This conversation feels like "Man, fuck people who speak German. They don't know how to build cars the way people who speak Japanese do."
Languages are languages. You can write shitty things in any language and good things in any language.
The facts are, nearly all of the big sites on the Internet have PHP somewhere, some PHP is bad and some is good, and there is a wide variance of skill level among PHP developers.
Replace that previous paragraph with any language and the answer is the same.
Was async I/O promoted to a core language feature? It hasn't. You can do it, but you have to install a 3rd party dependency, and you will have to still interoperate with code that does not use async I/O. Contrast that to the reality in other languages.
Then, the rest of your arguments are not new, and are the usual last-resort losing arguments:
- "write everything in assembler if you care about performance": zero/low cost abstraction are different than no abstractions at all. Different in terms of productivity, maintainability, portability, etc. And you know this, I wonder why you mention it.
- "everything is relative and the choice of language doesn't really matter because they're all the same": they are not the same and the choice does matter. Languages are the product of different design and implementation processes, as well as different levels of investment, and results can differ a lot.
- Ad-hominem: I don't care. To me, your ad-hominem is the same as admitting your argument is inferior.
Anyways, PHP jumped the shark long ago and today it's just another legacy code language.
Zapier is built on Python, Django, React, Node.js, and AWS
Were you aware of the tradeoffs you made with that stack. Zapier has many technical issues: https://ca.trustpilot.com/review/zapier.com
If you went with a different stack I don't think you would have half of the issues your customers are reporting.