DOWNLOAD PORTALS AND LATEST S APP |
LATEST NEWS | ALL MOST WANTED JAVA APPLICATION FREE DOWNLOAD |
HOW TO BUILD A SITE ASK QUESTION FROM THIS PORTAL | ALL HACKING APPLICATION FOR ANDROID |
What is Hack?
Hack is a programming
language for HHVM.
Hack reconciles the fast
development cycle of a
dynamically typed
language with the
discipline provided by
static typing, while
adding many features
commonly found in
other modern
programming
languages.
Hack provides
instantaneous type
checking by
incrementally checking
your files as you edit
them. It typically runs
in less than 200
milliseconds, making it
easy to integrate into
your development
workflow without
introducing a noticeable
delay.
The following are some
of the important
language features of
Hack. For more
information, see the full
documentation, or
follow through the
quick, interactive
tutorial.
Type
Annotations
Type annotations allow
for code to be explicitly
typed on parameters,
class member variables
and return values.
1
2
3
4
5
6
7
8
9
<?hh
class
con
pri
pub
$
r
}
}
Generics
Generics allow classes
and methods to be
parameterized (i.e., a
type associated when a
class is instantiated or a
method is called) in the
same vein as statically
type languages like C#
and Java).
1
2
3
4
5
6
7
8
9
10
11
12
<?hh
clas
pr
pu
}
pu
}
}
Nullable Types
Nullable Types are
supported by Hack
through use of the ?
operator. This
introduces a safer way
to deal with nulls and is
very useful for
primitive types that
don’t generally allow
null as one of their
values, such as
bool and int
(using ?bool and
?int respectively).
The operator can be
used on any type or
class.
Collections
Collections provide first
class, built-in
parameterized types
such as Vector (an
ordered, index-based
list), Map (an ordered
dictionary), Set (a list of
unique values), and
Pair (an index-based
collection of exactly
two elements).
Lambdas
Lambdas succinctly
allow definition of first-
class functions.
1
2
3
4
5
6
7
8
9
<?hh
funct
$x
ret
}
funct
$fn
ech
}
Other Features
Other significant
features of Hack include
XHP, Shapes, Type
Aliasing, Async
support, backwards
compatibility with PHP
code, and much more.
We are delighted to
have open-sourced
both Hack and
conversion tools you
can use on your own
codebase. We are
dedicated to continuing
to work on this project:
we would love to have
your feedback on our
work so far, and
welcome you all to
participate in the HHVM
and Hack communities.
Facebook Ope
Open Source Projects
GitHub Twitter
Contribute to this project
on GitHub