Live data from Hacker News

Goro – An implementation of PHP written in Go

github.com

91–100 of 135 posts

Re: Goro – An implementation of PHP written in Go

#91
post #90

I don't like unnecessary layers. Interpreted languages waste silicon and energy. I've heard startups justify using Ruby or PHP by saying "servers are cheap", which is just a bad engineering mindset. Instead of building PHP apps on a PHP platform built in Go, people should just build apps in Go. Or in C++, D, Nim, F#, C#, or even Java 8 or 10 with that new AOT compiler. (I think F# and C# can also be compiled in advan…

> I've heard startups justify using Ruby or PHP by saying "servers are cheap", which is just a bad engineering mindset.

But a sensible startup mindset. Use whatever setup allows you to get things up and running the quickest. By the time you run into scaling problems brought about by a choice to program in Ruby (if you ever do) you'll have a viable product, and can transition pieces away as you see fit.

Re: Goro – An implementation of PHP written in Go

#92

Earlier quoted context omitted.

The alternative is just as bad, a multi block try and catch mess that is in Java!

No, the alternative here would be to just let the write()'s throw and let upstream handle them. You don't try/catch to catch an error just to re-throw it for the same reason you don't try/catch every single line of your program. Exceptions are one reason other languages don't need this "if err throw err" code, without making a comment on if either is superior.

Yeah, but an error error is not really an exception. Often in Go, errors are used to mark different states, such as EOF which are expected and you can deal with locally and have more control whenever you want to return or not, for example, you can test the error in the same if condition and decide whenever to keep going - usually you do. Error handling code is more local rather than all over the place, plus no need to declare more classes for specific exceptions.

Re: Goro – An implementation of PHP written in Go

#93
post #90

I don't like unnecessary layers. Interpreted languages waste silicon and energy. I've heard startups justify using Ruby or PHP by saying "servers are cheap", which is just a bad engineering mindset. Instead of building PHP apps on a PHP platform built in Go, people should just build apps in Go. Or in C++, D, Nim, F#, C#, or even Java 8 or 10 with that new AOT compiler. (I think F# and C# can also be compiled in advan…

> All popular programming languages in our timeline are bad

Consider the possibility that you consider all of the popular languages bad because there is something about "bad" languages which causes them to become popular. For example, I notice that all of the examples of "bad" languages are ones which let you push out buggy software that is "good enough".

Re: Goro – An implementation of PHP written in Go

#95
post #45

Earlier quoted context omitted.

A majority of the web runs on one of a handful of programs that use php...WordPress, Magento...

While true, there is still a tremendous amount of the web that is powered by php and not using WordPress or Magento. Facebook, Yahoo, Wikipedia, even Google.

Employee of Google here... really? Where does Google use PHP?

Re: Goro – An implementation of PHP written in Go

#96
post #15

> PHP is a nice language but is having trouble keeping up with modern languages It's only "having trouble" because it can't change its API from month to month to match whatever's in vogue. A majority of the web still runs on some variant of PHP, and that guarantees that it's not dying anytime soon. More broadly, it seems the author wants to create a version of PHP that's not focussed on web requests, which is sort of…

It feels like you are downplaying decades of genuine improvement in web development under the guise that it's all just fashion, flavor-of-the-week stuff that has no substance. I get that people have an inverse reaction to hype, but I am disappointed that this is the top comment.

There's a reason why the world moved on from CGI, even PHP moved on from CGI - and yet, its request model is still based on CGI, executing a script for each request. People are still relying on a webserver to rewrite URLs because PHP doesn't have the concept of an application server with a router. How is that superior to the more modern paradigm?

Despite this, the most largely used pieces of PHP software, MediaWiki, Wordpress, etc. tend to use things like the front controller pattern that actually invert the old CGI model into something more like what you would see with application servers in Ruby on Rails, Django, even Go to a degree.

Re: Goro – An implementation of PHP written in Go

#98
post #80
post #15

> PHP is a nice language but is having trouble keeping up with modern languages It's only "having trouble" because it can't change its API from month to month to match whatever's in vogue. A majority of the web still runs on some variant of PHP, and that guarantees that it's not dying anytime soon. More broadly, it seems the author wants to create a version of PHP that's not focussed on web requests, which is sort of…

> a version of PHP that's not focussed on web requests, which is sort of the entire point of PHP. But even for web requests it's terrible. Or at least, it was, last time I used it years ago. Couldn't really do any long-running tasks in response to an HTTP request, or load a single data set into memory to share among all the HTTP requests over the lifetime of the server. (Maybe you could, but I couldn't figure out how…

> But even for web requests it's terrible

Maybe you have specific needs? At Vimeo it runs reasonably well, with median response time around 30ms.

> Or at least, it was, last time I used it years ago

Ah, PHP 7 was released three years ago and made some massive improvements to performance.

> Couldn't really do any long-running tasks in response to an HTTP request

We add something to a queue, and handle those tasks offline. Pretty simple.

> or load a single data set into memory to share among all the HTTP requests over the lifetime of the server

apc_store does that: http://php.net/manual/en/function.apc-store.php (it's part of a very popular extension)

> I'm quite happy that I haven't touched PHP in years.

Cool, it's not for everyone and all use cases. But it's always there if you need it.

Re: Goro – An implementation of PHP written in Go

#99
post #56

Earlier quoted context omitted.

Facebook forked PHP to make Hack to try and make PHP usable. Yahoo is yahoo. Wikipedia wouldn't have the resources to change anything. Google has a wiki page for their developers telling them to never ever use PHP for any google project.

Those facebook improvements made there way back into the core. Google might be able to move quicker if they allowed php. Facebook killed them in social. The type of products google can offer is limited by this decision.

Google+ did not fail for technical reasons. Everything I saw about it was technically better. It failed for social reasons, facebook already exists and has everyone on it.

Re: Goro – An implementation of PHP written in Go

#100

For C#, checkout PeachPie which allows you to run PHP applications on .NET Core including WordPress - https://www.peachpie.io/2017/02/wordpress-announcement.html

PeachPie is really interesting. I haven't had a chance to use it, but the most fascinating bit to me is that it can compile PHP to .NET. Could be a great way to incrementally move legacy code if you like writing servers in .NET, potentially. I do wonder how things like Wordpress extensions and dynamically generated code work, though. phpBB, for example, generates PHP files at runtime for its formatting engine (s9e TextFormatter, it's quite a nice library.)
Post reply on HN