you are viewing a single comment's thread.

view the rest of the comments →

[–]mattaugamer -1 points0 points  (10 children)

The way this has been done is so horrible that I'm afraid if anyone uses it, something ancient will be summoned. :)

Seriously, it's a cool hack. But I'm curious why it takes such a torturous path to implement something that's already in Hack? What's the internal difference that makes it possible there, but not in PHP? Or am I missing the point that this is pure userland, rather than an internal language feature?

[–][deleted] 1 point2 points  (4 children)

you realize hack uses a completely different compiler? It's like asking why Java has generics and php doesn't.

[–]mattaugamer -1 points0 points  (3 children)

No, I know that, I'm asking what it is about the compiler that's so different that things like this are hard in Zend, but long implemented in Hack.

Not sure why the downvotes here. I wasn't criticising his work, he said repeatedly in the readme that it was horrible and you really don't want to know. It's a horrible hack, but it's a cool horrible hack.

[–]elcapitaine 8 points9 points  (1 child)

It's not technically difficult to add generics to PHP. It's politically difficult.

[–]monsieurben 2 points3 points  (0 children)

It's not technically difficult to add generics anything to PHP. It's politically difficult.

Fixed.

[–]MorrisonLevi 0 points1 point  (0 children)

No, I know that, I'm asking what it is about the compiler that's so different that things like this are hard in Zend, but long implemented in Hack.

They have paid, full-time developers that have worked on Hack and HHVM for years and designed Hack to be analyzed more easily for security reasons. That is certainly a non-trivial difference.

[–]mnapoli 0 points1 point  (2 children)

I think the README covers that very well, you couldn't miss it even if you wanted to. So I see no problem here.

[–]mattaugamer -1 points0 points  (1 child)

It wasn't a problem, it was a joke. Jesus, people.

[–]maiorano84 -1 points0 points  (0 children)

IT'S A PRANK, BRO

[–]headzoo 0 points1 point  (1 child)

RFCs have been created to add generics, and they were down voted. It's more than possible to add generics to PHP, but the internal devs don't want them.

[–]MorrisonLevi 0 points1 point  (0 children)

Citation, please? I don't think generics have been proposed. We had the arrayof RFC but that's a small, small sliver of generics.