Pages

Tuesday, March 25, 2014

What can HHVM do?

Nearly anything. HHVM is mainly focused on server-side scripting, so you can collect form data, generate dynamic page content, or send and receive cookies. But HHVM can do much more.
There are two main areas where HHVM scripts are used.
  • Server-side scripting. This is the most traditional and main target field for HHVM. You need three things to make this work. The HHVM parser, a web server and a web browser. You need to run the web server, with a connected HHVM installation. You can access the Hack program output with a web browser, viewing the Hack page through the server. All these can run on your home machine if you are just experimenting with Hack programming. See theinstallation instructions section for more information on how to install HHVM.
  • Command line scripting. You can make an HHVM script to run it without any server or browser. You only need the HHVM parser to use it this way. This type of usage is ideal for regularly executed scripts or testing new libraries and functionality. These scripts can also be used for simple text processing tasks. See the section aboutCommand line usage of HHVM for more information.
HHVM is fully available on major variants of the Linux operating system, including Ubuntu, CentOS, Debian, etc. HHVM can be installed on Mac OS X to run in interpreted mode (no JIT, but that is being actively developed). Windows support is actively being developed. HHVM has also support for most of the web servers today. This includes any web server that can utilize the FastCGI protocol, like Apache, lighttpd and nginx.
So with HHVM, you have the freedom of choosing an operating system and a web server. Furthermore, you also have the choice of using procedural programming or object oriented programming (OOP), or a mixture of them both. And, of course, you can choose to use Hack or PHP as your programming language.
With HHVM you are not limited to output HTML. HHVM's abilities includes outputting images, PDF files and even Flash movies (using libswf and Ming) generated on the fly. You can also output easily any text, such as XHTML and any other XML file. HHVM can autogenerate these files, and save them in the file system, instead of printing it out, forming a server-side cache for your dynamic content.
One of the strongest and most significant features in HHVM is its support for a wide range of databases. Writing a database-enabled web page is incredibly simple using one of the database specific extensions (e.g., for mysql), or using an abstraction layer like PDO, or connect to any database supporting the Open Database Connection standard via the ODBC extension. Other databases may utilize cURL or sockets.
HHVM also has support for talking to other services using protocols such as LDAP, IMAP, HTTP, and others. You can also open raw network sockets and interact using any other protocol. HHVM has support for the WDDX complex data exchange between virtually all Web programming languages.
HHVM has useful text processing features, which includes the Perl compatible regular expressions (PCRE), and many extensions and tools to parse and access XML documents. HHVM standardizes all of the XML extensions on the solid base of libxml2, and extends the feature set adding SimpleXML, XMLReader and XMLWriter support.
And many other interesting extensions exist, which are categorized both alphabetically and by PHP category and Hack category.
As you can see this page is not enough to list all the features and benefits PHP can offer. Read on in the sections aboutinstalling HHVM, and see the PHP function reference and the Hack function reference for explanation of the extensions mentioned here.

1 comment:

  1. Your blog has given me that thing which I never expect to get from all over the websites. Nice post guys!


    ReplyDelete