Giter Club home page Giter Club logo

ihaskell's Introduction

IHaskell

IHaskell is an implementation of the IPython kernel protocol which allows you to use Haskell inside IPython frontends such as qtconsole and notebook.

The project works with the IPython shell:

IPython Console

As well as the IPython browser-based notebook interface:

IPython Notebook

Installation

Download the package from the Github repository:

git clone https://github.com/gibiansky/IHaskell

Install ZeroMQ:

sudo apt-get install libzmq3-dev # Ubuntu (Saucy only)
brew install zeromq # Macs with Homebrew

(For older versions of Ubuntu, you should be able to download the ZeroMQ3 source and install without much difficulty.)

Install the package:

cd IHaskell;
cabal install;

Create the IPython profile:

IHaskell setup

Run the notebook or console interface:

IHaskell notebook # Should open a browser window!
IHaskell console

There is a test notebook in the IHaskell directory.

Contributing

IHaskell is an extremely young project, and I'd love your help getting it to a stable and useful point. There's a lot to do, and if you'd like to contribute, feel free to get in touch with me via my email at andrew period gibiansky at gmail - although browsing the code should be enough to get you started, I'm more than happy to answer any questions myself.

Some ideas for improvements:

  • Type annotations. When a statement is evaluated, the GHC API returns the names of all bound variables. It should be possible to take those names and find the types of the variables, and display them in a table via the display_data message.
  • Implementing useful directives. Currently, support for GHCi-style ":"-initiated directives exist, but they do not do anything (and are instead just printed in green). Useful directives such as ":t" and ":i" and ":m [+-]" have yet to be implemented, and adding them would be a good way to get started with the codebase.
  • Parsing and viewing of formats via display_data and HTML:
    • aeson compatibility which displays JSON as syntax highlighted JSON code via HTML.
    • Support for repa or hmatrix vectors and matrices being displayed.
    • `A custom typeclass for displaying data types as HTML, similar to Show.

Take a look at the developer notes as well - they are sparse but may be helpful.

Developer Notes

Before diving in, you should read the brief description of IPython kernel architectures and read the complete messaging protocol specification.

Skim the rather-lacking Haddock documentation.

Module Quickstart:

  • Main: Argument parsing and basic messaging loop, using Haskell Chans to communicate with the ZeroMQ sockets.
  • IHaskell.Types: All message type definitions.
  • IHaskell.Eval.Evaluate: Wrapper around GHC API, exposing a single evaluate interface that runs a statement, declaration, import, or directive.
  • IHaskell.IPython: Shell scripting wrapper using Shelly for the notebook, setup, and console commands.
  • IHaskell.Message.Parser: Parsing messages received from IPython.
  • IHaskell.Message.UUID: UUID generator and data structure.
  • IHaskell.Message.Writer: ToJSON for Messages.
  • IHaskell.ZeroMQ: Low-level ZeroMQ communication wrapper. serveProfile starts listening on all necessary sockets, and returns a ZeroMQInterface record. This record exposes reading and writing Chan Message messages for all the necessary sockets, so then the rest of the application can simply use that interface.

ihaskell's People

Contributors

gibiansky avatar

Watchers

hamlet avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.