Hack is a programming language created in 2014 by Julien Verlaguet and Alok Menghrajani and Drew Paroski.
#153on PLDB | 9Years Old | 1.4kUsers |
27Books | 3Papers | 68kRepos |
Try now: Riju
Hack is a programming language for the HipHop Virtual Machine (HHVM), created by Facebook as a dialect of PHP. The language implementation is open-source, licensed under the BSD License. Hack allows programmers to use both dynamic typing and static typing. Read more on Wikipedia...
<<__EntryPoint>>
function main(): void {
echo "Hello, world!\n";
}
<?hh
echo "Hello World";
<?hh
// Hello world in Hack
echo 'Hello World';
<?hh // strict
/**
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
function startup(): void {
setup_errors();
}
<?hh
// Hack functions are annotated with types.
function negate(bool $x): bool {
return !$x;
}
Feature | Supported | Token | Example |
---|---|---|---|
Strings | âś“ | " | "Hello world" |
MultiLine Comments | âś“ | /* */ | /* A comment */ |
Print() Debugging | âś“ | echo | |
Comments | âś“ | // A comment |
|
Line Comments | âś“ | // | // A comment |
First-Class Functions | âś“ | ||
Semantic Indentation | X |
title | authors | year | citations | influentialCitations |
---|---|---|---|---|
Hack weeks as a model for data science education and collaboration | D. Huppenkothen and A. Arendt and D. Hogg and Karthik Ram and J. Vanderplas and A. Rokem | 2017 | 36 | 3 |
HHVM JIT: a profile-guided, region-based compiler for PHP and Hack | Guilherme Ottoni | 2018 | 30 | 5 |
“Serenade Tower” Hack and Slash Game | Leonardo and Jeanny Pragantha and Darius Andana Haris | 2020 | 1 | 0 |