Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Wow the PHP is going to magically get into the binary?

It's fairly simple to pack assets into a binary. (Not sure, if they are doing that. But it wouldn't involve any magic.)

Compare also https://doc.rust-lang.org/beta/core/macro.include_bytes.html

Btw, making a tarball or a zipfile is also a way to put multiple files into one binary file. You might have even heard of self-extracting zip files? They were very popular, before Windows got a build-in unzipper, I think.



Optionally, you can embed the PHP scripts in the final binary using a Go feature similar to `include_bytes`: https://frankenphp.dev/docs/embed/

But for PHP, it's even simpler: PHP is available as a C library, and we just use it. (libphp can be embedded using static compilation, or used as a dynamic library, we support both).


> But for PHP, it's even simpler: PHP is available as a C library, and we just use it. (libphp can be embedded using static compilation, or used as a dynamic library, we support both).

Yes, but that's completely independent from whether / how you embed the scripts? (Which you do via the the procedure described in your first link?)

Btw, how does your version of PHP compare to Facebook's Hack? I had opportunity to use Hack a few years ago, and I think it's the best language they could have made (from PHP as the fixed starting point).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: