hacking Flapjax

61 views
Skip to first unread message

Arjun Guha

unread,
Apr 14, 2009, 10:59:00 AM4/14/09
to fla...@googlegroups.com
Flapjax is open source software. I'd like to give you a quick
introduction to the Flapjax source:

http://www.github.com/arjunguha/flapjax

We use git for version control. If you don't want to use git, you can
click the Download button across the top to get a tarball/zip with the
current sources.

To build the Flapjax library and compiler, you will need to use our
JavaScript Contract Compiler (jscc). This tool is written in Haskell
and is available on Hackage, the Haskell package repository.
Instructions for setting up the Haskell compiler and command-line
access to Hackage are here:

http://book.realworldhaskell.org/read/installing-ghc-and-haskell-libraries.html

Once you've setup Haskell, you can install JavaScript Contract Compiler with:

cabal install JsContracts

After this, I promise you won't have to deal with Haskell again!
(Unless you want to hack the compiler.)

--

This repository contains the Flapjax library (fx/) the compiler
(compiler/) and the website (doc/ and website/).

The implementation of the Flapjax library is fx/flapjax-impl.js. The
interface to Flapjax is specified in fx/flapjax.jsi. Our jscc tool
combines the implementation and interface in two ways:

1. For our Flapjax release, jscc wraps the implementation in a
"module" that only exports the names specified in the interface.

2. The interface specifies both names and contracts for the Flapjax
library. jscc can compile these contracts so that they are checked at
runtime. Checked contracts provide substantially better error
reporting but are slower than unchecked contracts. They are great for
debugging but you may wish to turn them off for released code.
Support for contracts is fairly new and is still unreleased.

If you build the library, the Flapjax release is flapjax.js and
Flapjax with contracts is flapjax.debug.js.

I hope that helps you get started. Let us know if you have any questions.

Patches welcome and happy hacking!

Arjun

Reply all
Reply to author
Forward
0 new messages