Fork me on GitHub

What is Haste?

Haste is a dialect of the Haskell programming language geared towards web applications. Haste supports the full Haskell language, including most GHC extensions but comes with a different set of standard libraries, implementing native support for modern web technologies such as WebSockets, LocalStorage, Canvas and others. In addition, Haste comes prepackaged with facilities for cooperative multitasking, working with binary data and other niceties.

A Haste program can be compiled into a single JavaScript file, much like traditional browser-side programs, or into a JavaScript file and a server-side binary, with strongly typed communication between the two. In essence, Haste lets you write your client-server web application as a single, type-safe program, rather than two separate programs that just happen to talk to each other over some web API as is traditional.

You don't need to throw away all of your old code to start using Haste. In addition to the standard Haskell FFI, Haste provides its own flexible library for easy Haskell-JavaScript integration, using magic typing tricks to allow data of any type to be used by both Haskell and JavaScript code with minimal effort.

Haste programs are compact. While a certain increase in code size over hand-rolled JavaScript is unavoidable, an optimized but uncompressed Haste program is normally less than 3x the size of an equivalent hand-written program and the compiler takes special care to produce minifiable code, making the latency penalty of using Haste minimal.

Haste is free software under the three-clause BSD license. If your favorite feature is not yet implemented, why not submit a patch? You might also want to join the Haste mailing list or our IRC channel #haskell-haste @ Freenode.