Live data from Hacker News

PHP: v8.js

php.net

11–20 of 43 posts

Re: PHP: v8.js

#11
post #10
post #5

Well that just makes me go WTF. I genuinely can't think of a way this will be used which will be positive for PHP.

In theory, it will have the exact same use as the rubyracer gem ( http://rubygems.org/gems/therubyracer ). Possible uses of that are compiling coffee script using the official compiler or running the same form validation code on both the client- and the server side. In general I'd be cautious about both the ruby racer and this as you are practically embedding a garbage-collected heap into another garbage collected he…

"or running the same form validation code on both the client- and the server side."

That sounds great until you realize that you usually do a lot more validation on the server than on the client (is the username taken, is password correct, etc etc). So you would still have to use PHP for validation (in most cases).

Re: PHP: v8.js

#13
post #5

Well that just makes me go WTF. I genuinely can't think of a way this will be used which will be positive for PHP.

This extension has been around for a long time, just like the PHP Lua extension.

Re: PHP: v8.js

#15

It looks like a PHP extension to embed JavaScript using the V8 engine. The docs are pretty limited. The return value of executing a blob of JS is described thusly: "Returns the last variable instantiated in the Javascript code converted to matching PHP variable type." I supposed the mapping is obvious, to someone :). I'd personally want to know if JS objects come back as stdClass objects or assoc arrays. It could def…

Last time I looked I don't remember seeing any bindings to the PHP environment.

Re: PHP: v8.js

#16
I have been doing a lot of work with PHP recently, and reading through their library docs, it seems to me like they will put anything in a core extension, regardless of whether it's something that really belongs there.

Re: PHP: v8.js

#18
post #11
post #10

Earlier quoted context omitted.

In theory, it will have the exact same use as the rubyracer gem ( http://rubygems.org/gems/therubyracer ). Possible uses of that are compiling coffee script using the official compiler or running the same form validation code on both the client- and the server side. In general I'd be cautious about both the ruby racer and this as you are practically embedding a garbage-collected heap into another garbage collected he…

"or running the same form validation code on both the client- and the server side." That sounds great until you realize that you usually do a lot more validation on the server than on the client (is the username taken, is password correct, etc etc). So you would still have to use PHP for validation (in most cases).

Sure, but only for the cases not covered by the JS.

Re: PHP: v8.js

#19

I have been doing a lot of work with PHP recently, and reading through their library docs, it seems to me like they will put anything in a core extension, regardless of whether it's something that really belongs there.

This isn't a core extension, it's a PECL extension--see http://pecl.php.net/package/v8js. PECL extensions are not distributed with PHP. You have to explicitly install them if you want to use them.

I think sharing code is always better than not sharing code. If you run into a use case where this would be useful, then you can just grab it and install it.

Re: PHP: v8.js

#20

do. not. want. If you think this is anything but the worst idea ever - trust me; you're doing it wrong.

I wouldn't want it as a base for developing something new, but if you are knee deep in some old, smelly codebase that should be fixed yesterday, I can definately see how it could be usefull.
Post reply on HN