Hacker News new | ask | show | jobs
by wink 4468 days ago
I 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.
5 comments

Because 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.

Adding 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. :)

The fact that we wanted the type system to be instantaneous drove some of our design decisions.
Was 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
In Hack's case, the language is the implementation anyway.