hacklang

hh_client reports errors on package

时光怂恿深爱的人放手 提交于 2021-01-27 07:46:10
问题 I am following the instruction in Getting started on official Hacklang website. As it says, I run: $ touch .hhconfig $ mkdir bin src tests $ cat > hh_autoload.json { "roots": [ "src/" ], "devRoots": [ "tests/" ], "devFailureHandler": "Facebook\\AutoloadMap\\HHClientFallbackHandler" } $ composer require hhvm/hsl hhvm/hhvm-autoload Then I run hh_client , which throws 74 errors like those: Typing[4110] You cannot use HH_FIXME or HH_IGNORE_ERROR comments to suppress error 4110 --> vendor/autoload

Is code written in Hack faster than code written in PHP on HHVM?

落爺英雄遲暮 提交于 2020-01-10 00:28:24
问题 Can we expect a speed gain by transitioning from PHP to Hack on HHVM? I'm thinking of the strongly typed parameters / return types, in particular scalars, does that allow HHVM to do a better job at compiling the code to native code, or is the speed gain insignificant as compared to using classic PHP and its mixed types? 回答1: I answered this on Reddit a few months back. I've copied my answer below, since the state of the world hasn't changed much since then. But keep in mind that HHVM is still

Typechecking Hack code on VirtualBox via NFS shared folder

半世苍凉 提交于 2019-12-31 07:00:24
问题 It seems prudent to first mention this issue and then this aptly-named edit which seems related and has made hh_server refuse to run on NFS file systems. I am not very familar with file systems and have never touched OCaml before, so in trying to accomplish the question title, I have tried editing what I know: /etc/hh.conf and /etc/hhvm/{php, server}.ini , adding hhvm.[server.]enable_on_nfs = true by pure guesswork. No dice. As I understand it from the issue, the change stems from the hh

Can I use HHVM side by side with the regular PHP interpreter

南笙酒味 提交于 2019-12-08 03:31:09
问题 I'm aware that HHVM can run regular PHP code. What I would like to know is if I can migrate in a way where I serve all files written with hack with the HHVM and all the files written with PHP via the regular PHP interpreter. I assume this should be possible by using two different file extensions (say .hh and .php ) and then somehow map them two the different interpreters/VM with some nginx setting, no? 回答1: Even though you asked for nginx, here is an example (untested) Apache CGI

Can I use HHVM side by side with the regular PHP interpreter

。_饼干妹妹 提交于 2019-12-06 14:06:47
I'm aware that HHVM can run regular PHP code. What I would like to know is if I can migrate in a way where I serve all files written with hack with the HHVM and all the files written with PHP via the regular PHP interpreter. I assume this should be possible by using two different file extensions (say .hh and .php ) and then somehow map them two the different interpreters/VM with some nginx setting, no? Even though you asked for nginx, here is an example (untested) Apache CGI configuration: (sorry I don't know nginx) <IfModule mod_fcgid.c> IdleTimeout 3600 ProcessLifeTime 7200 MaxProcessCount

Common php functions in hack

与世无争的帅哥 提交于 2019-12-05 22:18:55
问题 I decided to start a new project to get into hacklang, and after fixing some if the problems I initially ran into transitioning from php habits, I ran into the following errors: Unbound name: str_replace Unbound name: empty Doing some research I found that this is due to using 'legacy' php which isn't typechecked, and will error with //strict . That's fine and all, empty() was easy enough to replace, however str_replace() is a bit more difficult. Is there an equivalent function that will work

Common php functions in hack

风流意气都作罢 提交于 2019-12-04 04:27:08
I decided to start a new project to get into hacklang, and after fixing some if the problems I initially ran into transitioning from php habits, I ran into the following errors: Unbound name: str_replace Unbound name: empty Doing some research I found that this is due to using 'legacy' php which isn't typechecked, and will error with //strict . That's fine and all, empty() was easy enough to replace, however str_replace() is a bit more difficult. Is there an equivalent function that will work with //strict? Or at least something similar. I'm aware that I could use //decl but I feel like that

What IDEs have support for the Hack Language?

时光毁灭记忆、已成空白 提交于 2019-12-03 07:12:13
问题 Has anyone managed to find an IDE for Hack Language used on HHVM ?Is there any plugin available for the well-known IDEs like Eclipse,Netbeans,etc? Thank you! Edit : By the time SiebelsTim has embedded typechecker and made a basic syntax highlighting for Sublime. You can find the plugin here 回答1: Here are the plugins for vim, emacs and Sublime 1 . More support in other IDEs will be probably added in the future. I'm especially waiting for plugins for PHPStorm and Netbeans. 1 = I don't use these

What IDEs have support for the Hack Language?

你说的曾经没有我的故事 提交于 2019-12-02 20:45:41
Has anyone managed to find an IDE for Hack Language used on HHVM ?Is there any plugin available for the well-known IDEs like Eclipse,Netbeans,etc? Thank you! Edit : By the time SiebelsTim has embedded typechecker and made a basic syntax highlighting for Sublime. You can find the plugin here Here are the plugins for vim , emacs and Sublime 1 . More support in other IDEs will be probably added in the future. I'm especially waiting for plugins for PHPStorm and Netbeans. 1 = I don't use these editors, so please don't ask me how to install the plugins. EDIT : There is now a page in HHVM docs with

HHVM+Hacklang: errors/warnings output into browser

假装没事ソ 提交于 2019-11-29 07:41:05
Is there any way to tell HHVM to output Hacklang warnings and errors into the browser? Something like PHP does with enabled display_errors , display_startup_errors and error_reporting set to E_ALL HHVM version: $ php -v HipHop VM 3.1.0-dev+2014.04.09 (rel) Compiler: heads/master-0-g4fc811c64c23a3686f66a2bea80ba47f3eaf9f3d Repo schema: 79197c935790c0b9c9cb13566c3e727ace368117 I've tried the following config: $ cat /etc/hhvm/php.ini ; php options display_startup_errors = On error_reporting = E_ALL display_errors = On ; hhvm specific hhvm.log.level = Warning hhvm.log.always_log_unhandled