5 ms·
"Hack provides instantaneous type checking via a local server that watches the filesystem." What does this mean?
by mlubin 13y ago
"Hack provides instantaneous type checking via a local server that watches the filesystem."
What does this mean?
- bos 13y agoOn Linux, we use the inotify subsystem to be informed every time you save a source file or switch branches. The hh_server process can then update its data structures immediately, without being explicitly asked.
- wink 13y agoI don't really get why this is the second paragraph on the page of a language though. It's like touting the jar command in an overview of Java.
- bos 13y agoBecause this is tremendously important to the usability of the language. One of the reasons that PHP has been such a success is that you can simply save a source file and reload a web page to see what's going on. The server-based typechecker that runs instantaneously is what makes it possible for Hack to replicate this experience: you save a file and reload a web page, but you have the safety net of a typechecker that told you about your type errors as soon as you saved the file. I can't overstate how important this instant feedback is: it's really the thing that distinguishes Hack from working in a more traditional compile-based static language.
- amenghra 13y agoThe fact that we wanted the type system to be instantaneous drove some of our design decisions.
- acorkery 13y agoWas it debated whether this should be a tooling feature - thinking of an IDE plugin that parses and type-checks in the background rather than a dedicated service to watch text files on disk
- reikonomusha 13y agoIn Hack's case, the language is the implementation anyway.
- 6cxs2hd6 13y agoAdding static typing to a dynamic language means that more work must be done at compile time than at run time. One appeal of dynamic languages is you don't have a long compile time[1]. So I imagine they emphasize this to address the worry that this will get ruined and there will be a horrible workflow. [1] However Turbo Pascal was a one-pass typed compiler in the early 80s that was blazingly fast with 1 MHz CPUs and 64 KB RAM. :)