What is Hack?

Hack is a language for HHVM that interopates seamlessly with PHP. The barrier to entry for Hack is low. To get started, all that is needed is to generally understand the features that Hack provides and how to call the Hack type checker(hh_client invokes the type checker at the command line)

The goal of Hack to offer developers a way to write cleaner, safer and refactorable code while trying to maintain a level of compatibility with current PHP codebases. The primary way that this goal is achieved is to provide developers a way to annotate PHP functions and classes with type information, providing a type checking tool to validate those annotations. In addition, Hack also provides specific language feature additions such as:

Each of the Hack features, and more, is discussed in great detail in this documentation.

Hack code is indicated through the <?hh marker at the top of a file, as opposed to the canonical <?php marker.

Very important note: The type checker is invoked before runtime to determine whether code is typesafe. While HHVM knows about and understands the Hack language, it does not necessarily strictly enforce them. This is different from a true statically-typed language like C# where code is type checked at compile time and enforced (usually via some sort of exception mechanism) at runtime.

Hack 语言学习/参考---1.1 What is Hack?的更多相关文章

  1. Hack 语言学习/参考---1.3 Summary

    Summary Hack provides the following, non-exhaustive list of features: Ability to annotate function a ...

  2. Hack 语言学习/参考---1.2 Hack Background

    Hack Background Facebook was initially built with PHP. Parameters and return types were specified in ...

  3. Hack 语言学习/参考---1.Hack 语言

    Table of Contents What is Hack? Hack Background Summary Hack is a language for HHVM that interopates ...

  4. 学习参考:《Python语言及其应用》中文PDF+英文PDF+代码

    学习简单的数据类型,以及基本的数学和文本操作,学习用Python内置的数据结构来处理数据: 掌握Python的代码结构和函数的用法:使用模块和包编写大规模Python程序:深入理解对象.类和其他面向对 ...

  5. C语言学习 第八次作业总结

    本次作业其实没有新的内容,主要就是复习上一次的一维数组的相关内容.冯老师布置了5道题目,其中涉及到一些比较简单的排序或者是查找的方法.因为数据很少,所以直接使用for循环遍历就可以了. 关于本次作业, ...

  6. linux 下C语言学习路线

    UNIX/Linux下C语言的学习路线.一.工具篇“公欲善其事,必先利其器”.编程是一门实践性很强的工作,在你以后的学习或工作中,你将常常会与以下工具打交道, 下面列出学习C语言编程常常用到的软件和工 ...

  7. 足球运动训练心得及经验分析-c语言学习调查

    在准备预备作业02之前,我参考娄老师的提示,阅读了<[做中学(Learning By Doing)]之乒乓球刻意训练一年总结>一文. 在文章描述的字里行间,给予我的印象是系统.负责,娄老师 ...

  8. 12天学好C语言——记录我的C语言学习之路(Day 7)

    12天学好C语言--记录我的C语言学习之路 Day 7: 昨天进行了一天的数组学习,今天大家可以先写几个昨天的程序热热身,回顾回顾,然后今天第一个新程序也是关于数组的,比较难,准备好就开始啦! //输 ...

  9. 12天学好C语言——记录我的C语言学习之路(Day 4)

    12天学好C语言--记录我的C语言学习之路 Day 4: 首先来看一段程序: //输出下面4*5的矩阵 /* 1  2  3   4   5 2  4  6   8   10 3  6  9   12 ...

随机推荐

  1. Objective-C辛格尔顿

    单例类是一种特殊的类.在一个进程种仅仅会存在一个该类的对象,在iOS应用中仅仅会出现一个对象.这样的设计模式在系统框架中很多地方都使用了.如NSFileManager.UIApplication等. ...

  2. Paypal-Express Checkout快捷支付方式的android端开发心得(二)

    一.前导 上一篇讲的不是非常好,这里再又一次讲一下. Paypal手机支付有2种形式: 1.Mobile Express Checkout,MEC,快捷支付 2.MPL 假设採用MEC支付方式,这样的 ...

  3. hdu 4945 2048 (dp+组合的数目)

    2048 Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submi ...

  4. OpenCV视频播放方法

    OpenCV视频播放方法 今天折腾了一下OpenCV的视频播放功能,希望能对项目又帮助- 代码还是非常easy的,仅仅是之前遇到点小麻烦,找不到cvCreateFileCapture函数的定义,花了一 ...

  5. iOS如何兼容的应用程序32位系统和64Bit系统

    苹果发布iPhone5S时刻,64应用程序位去了眼前.当时我看到苹果公布的官方数据iOS7.x的SDK支撑64位应用程序.而内置的应用程序已经64位置. 我记得自己刚刚接触电脑时还有16位的系统,指针 ...

  6. SAP ABAP第一,两,三代出口型BADI实现 解释的概念

    BADI这是第三代用户出口型.让我们来看看如何实现的细节. 一个,用户出口的类型 1,第一代 sap提供了一个空的子程序代码.在这个过程分,用户可以添加自己的代码.为了控制自己的需求.这样的改进是需要 ...

  7. Codeforces Round #256 (Div. 2) D. Multiplication Table

    主题链接:http://codeforces.com/contest/448/problem/D 思路:用二分法 code: #include<cstdio> #include<cm ...

  8. hdu 1233(还是畅通project)(prime算法,克鲁斯卡尔算法)(并查集,最小生成树)

    还是畅通project Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tota ...

  9. Android fragment onActivityResult 不起作用

    fragment 跳转至Acivity后,fragment里面的onActivityResult 被被调用 试过非常多办法,最后getactivity().startactivityforresult ...

  10. Unity最优化摘要

    我们的游戏已经wp8.ios和android平台上的线. 这是我第一次做Unity工程,过程中遇到很多困难和挫折,但是,我和小伙伴探路,现在.该游戏已经上线一段时间.而且很稳定.为Unity.我一直在 ...