Code Monkey home page Code Monkey logo

ruby2haskell-tutorial's Introduction

From Ruby to Haskell: An Introduction

This repository contains the slides, notes and support materials for the presentation/tutorial From Ruby to Haskell: An Introduction, to be given in Tokyo on 2013-01-22. See the event page for event details.

Though it's not required, I encourage participants to work along with me through the examples given. (Feel free to do this in groups of two or three if you are missing software or Ruby expertise.) To do this, you will need the following software installed on your computer:

  • Git
  • A text editor
  • A Ruby implementation including an interpreter (version 1.8 or 1.9 of the original "Matz" ruby is fine)
  • The Glasgow Haskell Compiler (and interpreter)

You will also need to be familiar with using Git and and your editor.

Familiarity with Ruby is not strictly required, but will be quite useful. If you don't know Ruby, consider teaming up with someone else in the tutorial who does and can help you out with code and concepts you don't understand.

The examples and code given here were developed and tested under Ubuntu Linux, but should work just fine under other versions of Linux, MacOS and Windows (though under MacOS and Windows you will need to have a little bit of familarity with the command line interface).

Software Sources

Git

Git is typically available through the packging system used with your OS (except Windows); for example, the command sudo apt-get install git-core will install it on Ubuntu Linux systems. If it is not, you can download a client from here. If you typically use a GUI for file manipulation, you may also wish to download a GUI interface, such as TortoiseGit for Windows.

Ruby

Being a Rubyist, you should have Ruby already installed on your system. We use the Matz interpreter, which is the original Ruby implementation, but if you're more comfortable with another one, that will do as well. You will probably want the interactive ruby interpreter, irb, available as we use that in many of the early examples.

GHC

GHC (the Glasgow Haskell Compiler, which includes an interpreter) is also typically available as a package; sudo apt-get install ghc will install it under Ubuntu Linux. (Though it's often an older version, that's fine for this tutorial.) Under OSX, if you are using brew, you can use brew install haskell-platform.

If not available as a package, you can download the Haskell Platform from [5], which will give you both GHC and a wide set of commonly used libraries. GHC binaries are also available from the GHC home page if for some reason the Haskell Platform doesn't work for you.

Testing Your Installation

To test that the interpreter is working, type ghci at the command line prompt. You should see something resembling the following output:

GHCi, version 7.4.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude>

Typing :q at the GHCI prompt will quit back to the command line:

Prelude> :q
Leaving GHCi.

To test that the load-and-go compiler is properly installed, change to the directory containing this README file and type runghc Main.hs. (This command compiles the given soruce code file and then runs it.) It should print "Hello, world." and return you to the command line prompt. Feel free to change the string to something else and re-run the program to verify that you're comfortable with your edit/run cycle.

ruby2haskell-tutorial's People

Contributors

0cjs avatar pwim avatar

Watchers

Birkir A. Barkarson avatar James Cloos 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.