LOCKER: hacklang FILE: /mit/hacklang/README.athena CONTENTS: HACK base locker DESCRIPTION: HACK is a new Open Source web programming language for the HHVM (Hip Hop Virtual Machine) that is largely compatible with php. It allows programmers to use both static and dynamic typing. HOW TO RUN: setup hacklang hhvm file.php (to run HACK language code in file file.php) FROM DASH: no INTERFACES: command-line VERSIONS: For Linux 64: HACK 3.1 (note: strictly speaking this is the current hhvm version supporting HACK. The authors do not clearly associate a version number with HACK itself) DEPENDENCIES: none known DATAFILES: Platform-independent LICENSE SERVER: no ------------------------------------------------------------------------- SUPPORT ISSUES -- I/S SUPPORT: CONSULTING: none TRAINING: tutorial at http://hacklang.org/tutorial/ DOCUMENTATION: http://docs.hhvm.com/manual/en/hack.intro.php OTHER SUPPORT: http://www.sitepoint.com/hhvm-hack-part-1/ CONSULTING: (none) TRAINING: (none) WEB PAGE: http://www.hacklang.org/, http://hhvm.com/ BUG REPORTS: Use sendbug ------------------------------------------------------------------------- LEGAL ISSUES -- STATUS: BSD license - see http://web.mit.edu/hacklang_v3.0/distrib/dev/hhvm/hphp/hack/LICENSE for details SITES: any RESTRICTIONS: DOCUMENTATION: ------------------------------------------------------------------------- ABOUT THIS LOCKER -- MAINTAINER(S): swmaint (group), alexp DIRECTORY STRUCTURE: current - link to current version hacklang_v3.0 - link to version 3.1 MODIFY HISTORY: 4/8/14 - Alex Prengel Created this README.athena, initial locker setup MISCELLANEOUS: HACK is mainly intended for use in conjunction with web servers, which Athena doesn't support. The hhvm installation in this locker can only be used directly to run HACK scripts from the command line (runnable examples are in the tutorial directory at the top level of this locker). A way to get around this is to use a web server running in a preconfigured virtual machine. Detailed instructions for doing this with VirtualBox and Vagrant are below. ******************************************************************************* To install a webserving environment for hhvm/HACK: The installs below default to putting a large number of files in two locations in your home directory: ~/.vagrant.d (about 300 meg) ~/"VirtualBox VMs" (about 1.9 gig) This is likely to overfill your disk quota. If so, first make symlinks like these to writable directories of the same name where there is enough free space: ~/.vagrant.d -> /var/tmp/.vagrant.d ~/"VirtualBox VMs" -> /var/tmp/"VirtualBox VMs" 1. Install the latest VirtualBox release for the current Athena release base Ubuntu version (as of this writing 12.04): from https://www.virtualbox.org/wiki/Linux_Downloads, download: virtualbox-4.3_4.3.10-93012~Ubuntu~precise_amd64.deb (or newer version) install as root with: dpkg -i virtualbox-4.3_4.3.10-93012~Ubuntu~precise_amd64.deb then build kernel module with: /etc/init.d/vboxdrv setup 2. Install vagrant from http://www.vagrantup.com/downloads.html; select 64 bit Ubuntu, download: vagrant_1.5.2_x86_64.deb (or newer version) install as root with: dpkg -i vagrant_1.5.2_x86_64.deb 3. cd to a writable location, run (you don't need to be root): git clone https://github.com/vicb/hhvm-vagrant.git cd hhvm-vagrant vagrant up from the same directory, you can ssh into the virtual machine with: vagrant ssh a sample HACK program is at /vagrant/www/hello/index.php in the VM: {$hello}!

{$hello}

; To run it in a browser on the host machine go to: http://localhost:8080/hello/ Other demos are located below /vagrant/www/ in the VM, and you can put your own in different named directories, i.e. if /vagrant/www/mydemo/index.php contains your code, you can run it in a browser at http://localhost:8080/mydemo/ To suspend/resume later, run from hhvm-vagrant directory: vagrant suspend vagrant resume To shut down/restart, run from hhvm-vagrant directory: vagrant halt vagrant up