3 [![Join the chat at https://gitter.im/vu3rdd/functorrent](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/vu3rdd/functorrent?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5 [![Build Status](https://travis-ci.org/vu3rdd/functorrent.svg?branch=master)](https://travis-ci.org/vu3rdd/functorrent)
9 Functorrent can be build with [Stack](https://github.com/commercialhaskell/stack) or
10 [Nix](https://nixos.org/nix/).
14 Sandboxes give you per project independent containers, just like Python's
18 $ git clone https://github.com/vu3rdd/functorrent && cd functorrent
19 $ cabal install stack # or install stack by other means
20 $ stack build # binaries in $(pwd)/.stack-work/install/x86..../lts-2.16/7.8.4/bin/functorrent
24 ``$ nix-shell``` at the root of the source code repo should drop you into a
25 shell which has all the package dependencies installed.
30 [nix-shell] $ cabal configure && cabal build
34 If you invoke functorrent without any options, it expects the contents of a torrent file
35 to be given in stdin. So
37 $ cat ubuntu-14.10-desktop-amd64.iso.torrent | functorrent
40 Or one can explicitly specify the torrent file as input.
42 $ functorrent ubuntu-14.10-desktop-amd64.iso.torrent
47 - [Optimized for Fun](http://www.slideshare.net/autang/ofun-optimizing-for-fun).
48 (should have called it "funtorrent")
49 - Become more profient with Haskell.
50 - Implement something non-trivial with Haskell (crypto, file operations, network
51 operations, concurrency, bit twiddling, DHT).
52 - Follow the spec ([official spec](http://bittorrent.org/beps/bep_0003.html), [unofficial spec](https://wiki.theory.org/BitTorrentSpecification))
53 - Easy for newbies like me to read and understand alongside the spec.
54 - doctest and quickcheck tests.
55 - Follow Haskell Style Guide - https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
59 - most of the peer wire protocol works.
60 - talks only to one peer at the moment. Single threaded.
61 - can download files. But needs every piece to be served by the peer it connected to.
65 - this client is not usable as your daily bit torrent client yet. You may get corrupted files and end up wasting a lot of bandwidth. So, until we achieve some robustness, consider this as a programmer-friendly project to learn about a bunch of stuff.
70 * Talk to multiple peers.
71 * Piece download algorithms.
72 * Concurrency (threads per peer)
73 * Multifile torrent support.
74 * other advanced features of Bit Torrent (like DHT).