Live data from Hacker News

Recki-CT – A compiler for PHP, written in PHP

github.com

1–10 of 15 posts

Re: Recki-CT – A compiler for PHP, written in PHP

#2
This looks awesome. PHP doesn't get a lot of love but it is really improving a lot and obviously still dominates the web... Glad the turkish bug is finally done with.

Would be really nice to see security augmentations to the language. The vast majority (maybe 9/10) sites I look at where no framework was used, the site is missing have no CSRF tokens, very poor XSS protections, and RCEs are pretty common too. I think this would really improve the language.

Re: Recki-CT – A compiler for PHP, written in PHP

#3

This looks awesome. PHP doesn't get a lot of love but it is really improving a lot and obviously still dominates the web... Glad the turkish bug is finally done with. Would be really nice to see security augmentations to the language. The vast majority (maybe 9/10) sites I look at where no framework was used, the site is missing have no CSRF tokens, very poor XSS protections, and RCEs are pretty common too. I think t…

There is something to be said about security by obscurity. I don't want to see any security implementation because is means shared vulnerabilit.

Re: Recki-CT – A compiler for PHP, written in PHP

#4

This looks awesome. PHP doesn't get a lot of love but it is really improving a lot and obviously still dominates the web... Glad the turkish bug is finally done with. Would be really nice to see security augmentations to the language. The vast majority (maybe 9/10) sites I look at where no framework was used, the site is missing have no CSRF tokens, very poor XSS protections, and RCEs are pretty common too. I think t…

There is something to be said about security by obscurity. I don't want to see any security implementation because is means shared vulnerabilit.

What? I don't understand what you mean. PHP is not any more insecure than other languages. Some extremely secure sites run PHP....so security augmentations would not be obscurity.

An example would be built in CSRF protections through something like a form builder

Re: Recki-CT – A compiler for PHP, written in PHP

#5

This looks awesome. PHP doesn't get a lot of love but it is really improving a lot and obviously still dominates the web... Glad the turkish bug is finally done with. Would be really nice to see security augmentations to the language. The vast majority (maybe 9/10) sites I look at where no framework was used, the site is missing have no CSRF tokens, very poor XSS protections, and RCEs are pretty common too. I think t…

I find it odd that a language whose entire purpose is mixing code in with html doesn't come with the ability to automatically escape any echoed string by default. If you're not using something like Twig you have to wrap each variable in htmlspecialchars or something.

The argument that 'PHP is a framework' may be valid, but as a framework, raw PHP kind of sucks.

Re: Recki-CT – A compiler for PHP, written in PHP

#6
>This means that global variables, dynamic variables (variable-variables, variable function calls, etc) and references are not allowed.

Globals, sure, bad practice. Ideally we wouldn't have any. Dynamic variables make sense to exclude, it turns static analysis into the halting problem. Luckily they're a bad practice too since 5.3 introduced closures.

But references?

EDIT: It's by Anthony Ferrara! and some other pretty big names in the PHP community

Re: Recki-CT – A compiler for PHP, written in PHP

#7

Earlier quoted context omitted.

There is something to be said about security by obscurity. I don't want to see any security implementation because is means shared vulnerabilit.

What? I don't understand what you mean. PHP is not any more insecure than other languages. Some extremely secure sites run PHP....so security augmentations would not be obscurity. An example would be built in CSRF protections through something like a form builder

>PHP is not any more insecure than other languages.

This is debatable. It's not if you know to avoid many awful components of the language that are pushed in tutorials (like extract, or mysql_query, or register_globals, or loose comparisons).

Re: Recki-CT – A compiler for PHP, written in PHP

#8
post #7

Earlier quoted context omitted.

What? I don't understand what you mean. PHP is not any more insecure than other languages. Some extremely secure sites run PHP....so security augmentations would not be obscurity. An example would be built in CSRF protections through something like a form builder

>PHP is not any more insecure than other languages. This is debatable. It's not if you know to avoid many awful components of the language that are pushed in tutorials (like extract, or mysql_query, or register_globals, or loose comparisons).

register_globals was removed several years ago;

mysql_* functions all have a big red warning at the top of the docs pages warning users not to use it;

extract has a big red warning about using it on untrusted data.

PHP shouldn't hold developer's hands, but it does enough to warn them away from the Here There Be Dragons.

Re: Recki-CT – A compiler for PHP, written in PHP

#9
Does anyone have an idea for some of Recki-CT's use cases? I get that compiled PHP will be faster. This seems useful for PHP scripts you would run from the command line. Using the resulting binary as a CGI with Apache would incur the fork/exec cost that the PHP module avoided.

Re: Recki-CT – A compiler for PHP, written in PHP

#10
post #9

Does anyone have an idea for some of Recki-CT's use cases? I get that compiled PHP will be faster. This seems useful for PHP scripts you would run from the command line. Using the resulting binary as a CGI with Apache would incur the fork/exec cost that the PHP module avoided.

There are plenty of extremely large PHP applications that would certainly benefit from compilation. Before HHVM, Facebook compiled all of their PHP to C++, which was distributed as a giant binary.
Post reply on HN