Opened 11 years ago

Closed 10 years ago

Last modified 9 years ago

#1462 closed bug (fixed)

runghc is undocumented

Reported by: Isaac Dupree Owned by: igloo
Priority: high Milestone: 6.8.1
Component: Documentation Version: 6.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

make install installs runghc, which is not mentioned anywhere in the user's guide.

So I didn't know whether it was a bug that runghc doesn't work when ghc is compiled without interactive(ghci) support. Also I need to pass --make to runghc in a multi-module program to make runghc work. Also I don't know if there's any GHC flag like ghc --run the way there is ghc --interactive for ghci (should there be? or is the syntax different enough that it would be troublesome?). Also #1312 and #1281 are about runghc's behavior...

At least runghc and runghc --help produce runghc: syntax: runghc [-f GHCPATH] [GHC-ARGS] FILE ARG... which is clear enough about the syntax, but not exactly the meaning.

Change History (8)

comment:1 Changed 11 years ago by sorear

runghc is implemented by calling GHCi, loading your module, and invoking 'main'. I'm extremely suprised that there is any situation where --make is required! So you can just run ghc -e main Main.hs, (approximately - runghc has other magic that is only sometimes useful. Read the source for details, it's <100 lines). Runghc is *primarily* intended for use as a #! interpreter, and is installed with a runhaskell symlink.

comment:2 Changed 11 years ago by Isaac Dupree

Odd, I can't seem to reproduce needing --make, but I'm sure adding --make to runghc has been necessary for it to work for me more than once... maybe has something to do with some combination of .hi/.o files some of which are up to date for some modules? (observed on powerpc, whose ghci is not entirely perfect anyway it seems)

comment:3 Changed 11 years ago by igloo

Milestone: 6.8
Priority: normalhigh

We should document runghc for 6.8.

comment:4 Changed 10 years ago by igloo

Owner: set to igloo

comment:5 Changed 10 years ago by igloo

Resolution: fixed
Status: newclosed

I've added some basic docs.

comment:6 Changed 10 years ago by igloo

Milestone: 6.8 branch6.8.1

comment:7 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:8 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.