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. 【Android基础】AndroidManifest常用权限permission整理

    android.permission.ACCESS_COARSE_LOCATION 通过WiFi或移动基站的方式获取用户错略的经纬度信息,定位精度大概误差在30~1500米 android.permi ...

  2. 2014年10本月微软MVP应用程序启动!

     2014年10本月微软MVP启动应用程序!    CSDN与微软合作,长期为用户提供申请"微软最有价值专家"的平台,希望有兴趣.资历的朋友以及正在朝这个方向努力的朋友可以积极參与 ...

  3. 严格模式 (JavaScript)

    严格模式是一种将更好的错误检查引入代码中的方法. 在使用严格模式时,您无法使用隐式声明的变量.将值赋给只读属性或将属性添加到不可扩展的对象. 〉声明严格模式 可以通过在文件.程序或函数的开头添加 &q ...

  4. spring 整合quartz的方式——简单介绍

    一.继承QuartzJobBean,重写executeInternal方法 <bean name="statQuartzJob" class="org.spring ...

  5. Xenomai 3 和 PREEMPT_RT 有哪些优势相比,

    Q: 我可以在我的开发板PREEMPT_RT直接在内核环境中执行POSIX应用, 使用Xenomai3 这是什么原因它? A:假设你的应用程序已经完全是POSIX,而且性能也满足,则,而且也没有理由去 ...

  6. win9x_win2k下对物理磁盘的操作

    void CReadSectorDlg::OnReadButton() { UpdateData (TRUE) ; CFile m_Sector_file ; char * buffer ; if ( ...

  7. 【安德鲁斯】于java代码集drawableLeft给予适当的大小如何,当?

    textView.setCompoundDrawables(drawable, null, null, null);如果看不到图片,这是由于需要手动定drawable适当的大小,使用drawable. ...

  8. 【电视桌面CSWUI】电视桌面(launcher)截图欣赏

    网络播放器是最重要的电视桌面.cswui,我们公司做了一个非常大的人力,物力搞一个电视柜.后来一一介绍,简言之发送屏幕截图.给大家看. watermark/2/text/aHR0cDovL2Jsb2c ...

  9. UVa 11790 - Murcia&#39;s Skyline

    称号:给你一个行长度的建设和高度,我们祈求最长的和下降的高度. 分析:dp,最大上升子. 说明:具有长度,不能直接优化队列单调. #include <iostream> #include ...

  10. ZOJ-3652-Maze(BFS)

    Celica is a brave person and believer of a God in the bright side. He always fights against the mons ...