Live data from Hacker News

Goro – An implementation of PHP written in Go

github.com

81–90 of 135 posts

Re: Goro – An implementation of PHP written in Go

#81
post #42

Earlier quoted context omitted.

Probably the repetition of if err != nil {} You get used to that pretty quickly in Go, but it still looks messy to a lot of people.

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.

Re: Goro – An implementation of PHP written in Go

#82

> PHP is having trouble keeping up with modern language which are these modern languages and which are the cases where it is not keeping up? IMO PHP is one of the languages where development is really quick and the ecosystem is flourishing.

A great way to look into the future of languages is checking how many people is learning it now compared to the last few years, a great tool for that is google trends and things don't look good for PHP: https://trends.google.com/trends/explore?date=all&geo=US&q=p...

By your tool, then it means that javascript is dying: https://trends.google.com/trends/explore?date=all&geo=US&q=j...

Would you say that JS is dying?

Not to mention Java, which from Google trends it looks like it's an elephant half-way to the cemetery already https://trends.google.com/trends/explore?date=all&geo=US&q=j...

Re: Goro – An implementation of PHP written in Go

#83
post #50

Earlier quoted context omitted.

wait for js.rs

You joke but that's very likely to happen eventually if it hasn't already. At the very least I wouldn't be surprised if Mozilla made a prototype JS engine in Rust.

I guess it's less likely for JS as JS already has 3? 4? 5? highly optimised runtimes, and you don't get too much value out of Rust's safety guarantees if you're JITing code anyway...

Re: Goro – An implementation of PHP written in Go

#84
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…

PHP has gotten a lot better. New APIs have been added on top of features like classes. And many of the worst of the older APIs have been deprecated.

It still works on the "new interpreter per request model". But that has advantages in the multicore world: everything is thread-safe by default, and will scale to N cores without any extra work (for shared state people tend to use something like Redis).

It's by no means perfect. But if you stick to the modern bits and use one of the nicer frameworks (like Laravel), then I think I'd prefer it over something like Ruby.

Re: Goro – An implementation of PHP written in Go

#85
post #45

Earlier quoted context omitted.

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.

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.

There's also Laravel, which is more popular than both Django and Rails on a worldwide basis (https://g.co/trends/9CGj5). Rails and Django are more popular in the US where I hear PHP is not very popular...

Re: Goro – An implementation of PHP written in Go

#86
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…

[deleted]

Re: Goro – An implementation of PHP written in Go

#88
post #45

Earlier quoted context omitted.

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.

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.

> Facebook forked PHP to make Hack to try and make PHP usable.

Facebook clearly found PHP usable before they created Hack, otherwise they would (a) not have bothered and (b) may well not have existed in the first place.

The accurate statement is probably closer to "FB created hack to adapt to performance demands at an unusual scale and add some additional typing discipline bringing additional order across a large engineering team."

Re: Goro – An implementation of PHP written in Go

#89
post #72
post #56

Earlier quoted context omitted.

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.

HHVM can't make its way entirely back to core, and is in fact completely separating from PHP entirely now[1]. If I recall correctly, while PHP7 implemented better op-caching, it has _not_ implemented JIT compilation yet. 1. https://hhvm.com/blog/2017/09/18/the-future-of-hhvm.html

This is true. But HHVM lit a fire under the php devs to get php7 out the door with significant performance improvements. (php6 never saw the light of day). Php has improved so much with the 7x releases.

Re: Goro – An implementation of PHP written in Go

#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 advance with CoreRT, but even if they can't, they're a huge upgrade over any interpreted language.)

I would mention Rust except that it's terrible. All popular programming languages in our timeline are bad, and deter millions of smart people from the profession. But Rust is extraordinarily bad and should be replaced.

Post reply on HN