Fork me on GitHub

This just in: A seamless, client-centric programming model for type safe web applications accepted for publication at Haskell Symposium '14

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

Documentation

The documentation for Haste is currently a bit lacking, in particular with regards to tutorials and similar introductory texts. If you feel like contributing a tutorial or some other documentation, we'd be happy to link to it here!

Get Haste

Currently, the easiest way to get Haste is to install it from Hackage. Make sure you have a recent version of the Haskell Platform installed, then run the following in a terminal:

$ cabal update
$ cabal install haste-compiler
$ haste-boot

If you get an error about haste-boot not being found, you will need to add ~/.cabal/bin to your $PATH. If you are unsure about how to do this, please consult your OS documentation Google.

Another possibility is to build Haste from GitHub. This requires you to have the Haskell Platform installed, as well as Git.

$ git clone https://github.com/valderman/haste-compiler.git
$ cd haste-compiler
$ cabal install
$ haste-boot --local

In addition to the above methods, we are working on providing pre-compiled, pre-booted Haste packages here. For now, however, you will have to do without.

Try Haste

If you are curious, you can try Haste right here in your browser, without needing to install anything at all. Just type in your program and hit the Try it! button. Of course, there are limits to what can be done in this mode. In particular, the client-server features of Haste.App will not work.

Note also that this service is quite experimental, and some users have reported issues when on a poor connection. If you run into this issue, any information at all pertaining to your problem would be quite appreciated.

We seem to be having trouble connecting to the server; Haste Live is thus currently unavailable. :(

Getting involved

There are as many ways of getting involved with Haste as there are people using it. Here are a few suggestions for those who want to help out a bit more. In addition, we're currently in need of maintainers for the Windows and OSX platforms.

  • Submit a patch! Annoyed about your favorite feature still not being implemented? Grab the source, implement it yourself and submit a pull request!
  • Report a bug! Even if you don't feel up to hacking the compiler yourself, please do report any bugs you find, and perhaps even request features you'd like to see.
  • Join the mailing list! If you are having trouble with the crappy minimalist documentation or you want to discuss implementation details, the mailing list is the place to go.
  • Write a tutorial! Documentation is the hardest part of development - contributions in this area are at least as important as patches for the code generator.