• Software
  • Leadership
  • Agile
  • Events
  • Other Topics
    • Finance
    • Robotics & AI
    • System Administration
    • Books
    • Life Experiences
    • Environment
  • Write and Earn
  • About Us
    • About Us
    • Our Contributors
    • Contact Us
    • Article Submission Guidelines
    • Logo demystified
  • Follow @MeJaneve
    Janeve.Me
  • Categories

    Browse through following categories for articles written by professionals.
    • Agile
      4
    • Books
      5
    • Environment
      1
    • Events and Conferences
      7
    • Featured
      15
    • Finance
      1
    • Leadership
      5
    • Life Experiences
      8
    • Software
      30
    • System Administration
      2
  • Software
  • Leadership
  • Agile
  • Events
  • Other Topics
    • Finance
    • Robotics & AI
    • System Administration
    • Books
    • Life Experiences
    • Environment
  • Write and Earn
  • About Us
    • About Us
    • Our Contributors
    • Contact Us
    • Article Submission Guidelines
    • Logo demystified
Home » Software

Installing Haskell Platform

Janeve George Posted On February 28, 2012
0
2.3K Views


0
Shares
  • Share On Facebook
  • Tweet It

Installing the Haskell platform is pretty straight forward. You will have to first download the appropriate setup file from http://hackage.haskell.org/platform/.

Running the setup file will install Haskell compiler and runtime environments in your computer.

After installing the platform you may have to add the <GEC_HOME>/bin directory to the system path.

Running the first program – “Hello World”

Once installing Haskell platform, let’s see how we can run our first “Hello World” program. You can run a program in two ways:

  1. Using the Haskell interpreter for interactive processing (best option to learning Haskell)
  2. Compile and executing *.hs files

“Hello World” program using GHC interpreter

  1. Open terminal / command prompt of your system
  2. Type ‘ghci’ to get the GHC Interpreter terminal
  3. Just type in : “Hello, World!” and see what you get!!!
  4. Another alternative is to us the ‘putStrLn’ statement. Try typing : putStrLn “Hello, World!”

“Hello World” program using GHC compiler

  1. Create a source file helloworld.hs with content
    main = putStrLn "Hello, World!"
  2. Open terminal and go to the directory where the helloworld.hs file is saved.
  3. Compile helloworld.hs file using the command. This would create a helloworld.exe file
    ghc -o helloworld helloworld.hs
  4. Now you can run the executable file

Haskell Compilers and Interpreters

The Glasglow Haskell Compiler (GHC) is the most commonly used and the de-facto-standard compiler for Haskell. We have many other important Haskell compilers like:

  • Haskell User´s Gofer System (Hugs)
  • nhc98
  • York Haskell Compiler (YHC)
  • HBI  and HBC, Chalmers’ Haskell Interpreter and Compiler (Chalmers Haskell-B)
  • Utrecht Haskell Compiler (UHC)
  • JHC
  • LHC
  • Yale Haskell
  • Disciplined Disciple Compiler (DDC)

The following table tries to compare these compilers.

Comparison-of-Haskell-Compilers-and-Interpreters
Post Views: 2,294
0
Shares
  • Share On Facebook
  • Tweet It




Author

Janeve George

A Technology Leader, Software Engineer, and Agile Methodologies enthusiast. Currently, working as Lead Software Development with Zeta Suite. He has more than 1.6 decades of experience spanning different verticals predominated by hosting, cloud, and media delivery technologies.

Small Factorials Solution in Haskell
Read Next

Small Factorials Solution in Haskell

  • Follow @MeJaneve
    Janeve.Me
  • Categories

    Browse through following categories for articles written by professionals.
    • Agile
      4
    • Books
      5
    • Environment
      1
    • Events and Conferences
      7
    • Featured
      15
    • Finance
      1
    • Leadership
      5
    • Life Experiences
      8
    • Software
      30
    • System Administration
      2

  • Popular Posts

  • Recent Posts

    • Java Asynchronous Programming using CompletableFuture - Part 1
    • The Java Stream API
    • Functional Interfaces in Java
    • Online Webinar: Students & New Technology - 28th July 2020
  • Keep In Touch

    Follow us on social media to get latest articles on Programming, System Architecture, Agile Development Methodologies, Product and Project Management, Personal Development, BigData, Robotics, Upcoming Events and more...


Copyright © 2020 | Janeve.Me. All rights Reserved.
Press enter/return to begin your search