#1409: Allow recursively dependent modules transparently (without .hs-boot or
anything)
---------------------------------+------------------------------------------
    Reporter:  Isaac Dupree      |        Owner:              
        Type:  feature request   |       Status:  new         
    Priority:  normal            |    Milestone:  _|_         
   Component:  Compiler          |      Version:  6.10.2      
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:  Unknown     
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by simonpj):

 Another thread has started on Haskell Cafe about this ticket.   I thought
 it worth jotting down how I'd approach implementing the feature.

 If we wanted to support mutually recursive modules transparently, which is
 a reasonable goal, then the Right Thing is surely to identify the
 strongly-connected components and compile each SCC all together, as if it
 were all in a single module.

 From a design point of view, here are some thing to consider
  * Doing so would make each SCC all or nothing. If you make a change to
 any module, all get recompiled.  With `hs-boot` files, the recompilation
 checker is more discriminating.

  * Would we expect to generate one `.o` and `.hi` file for the SCC, or one
 for each original module?  Currently lots of built-system and GHC-internal
 stuff expects one-per-module.  But that would mean splitting up the mixed-
 together definitions after compilation.  (Not as trivial as it sounds: we
 might have done CSE across modules by that time.)

  * What to do in "batch mode", when you say `ghc Foo.hs` without `--make`?
 (To identify the SCC you need to do `--make`.)

  * Since we already have the `hs-boot` we'd need to figure out how it
 inter-operates with the new mehanism.

 From an implementation point of view
  * The main compilation pipeline would have to be taught about reading
 several source files for one compilation run.

  * GHC does not currently expect to be compiling definitions from several
 modules at once. In principle there should be no difficulty here, but when
 you break a long-standing assumption there are ''always'' difficulties.
 Hard to know just what.

 I think all of this is do-able.  But it's a significant task.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1409#comment:37>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to