Difference between revisions of "Yhc/Tutorial"
< Yhc
Jump to navigation
Jump to search
NeilMitchell (talk | contribs) |
NeilMitchell (talk | contribs) |
||
Line 1: | Line 1: | ||
+ | {{Yhc}} |
||
+ | |||
== Obtaining Yhc == |
== Obtaining Yhc == |
||
Revision as of 23:56, 15 January 2006
Part of Yhc |
Obtaining Yhc
Either download a binary distribution, or compile it from source (see Yhc/Building). A binary distribution is probably easier, but there aren't any yet until the first release.
Setting the Package Path
The easiest way to use Yhc is to first set the YHC_PACKAGE_PATH environment variable to the root of the packages. <say how to do this, give an example>
Compiling Hello World
Take a sample file, HelloWorld.hs
=========== File HelloWorld.hs ===============
module Main where
main = putStrLn "Hello, World!\n"
==============================================
$ yhc HelloWorld $ yhi HelloWorld Hello, World!
yhc
The yhc command takes a haskell source file, and generate a haskell bytecode file (extension, .hbc). The program always runs in make mode - so it will compile all requirements automatically.
yhi
The yhi command runs a haskell byte code file.
yhe
Yhe provides a Haskell 'command line' powered by Yhc. A gtk GUI also exists.