[GHC] #15646: ghci takes super long time to find the type of large fractional number
GHC
ghc-devs at haskell.org
Wed Nov 28 12:34:40 UTC 2018
#15646: ghci takes super long time to find the type of large fractional number
-------------------------------------+-------------------------------------
Reporter: Johannkokos | Owner:
| JulianLeviston
Type: bug | Status: new
Priority: normal | Milestone: 8.6.1
Component: GHCi | Version: 8.4.3
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: #5692 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by JulianLeviston):
So I tried to print out the values you suggested. I can't print out `litE`
and `litI` because they don't have a show instance for Core, but I tried
to print out the `Integer` values `fl_signi` and `fl_exp` that I use to
build those Core expressions with:
{{{
import IOEnv (liftIO)
...
HsRat _ fl _ -> case fl of
FL { fl_signi = fl_signi, fl_exp = fl_exp } ->
do
mkRational <- dsLookupGlobalId mkRationalName
litI <- mkIntegerExpr fl_signi
litE <- mkIntegerExpr fl_exp
-- temporary logging
liftIO $ putStrLn $ "fl_signi: " ++ show
fl_signi
liftIO $ putStrLn $ "fl_exp: " ++ show fl_exp
return ((Var mkRational) `App` litI `App`
litE)
}}}
That compiles, but unfortunately when I try to run it, it blows up with
the same interface file stuff. I guess this is because I renumbered
`RubbishLit` here: https://github.com/JulianLeviston/ghc/pull/1/files
#diff-78b3c572cf078eb00f09974b18f3eedfR214 — I'm really interested in
suggestions about a better way to do that. It didn't seem good to put it
after (it's out of order then). But I'm not sure what changes I need to
make if I'm going to adjust the interface file(s) as I seem to have done
by doing that? (bit lost there).
So... yeah, this is what happens when I run it:
{{{
itsy:ghc julianleviston$ ./inplace/bin/ghc-stage2 -e ":t 1e302"
1e302 :: Fractional p => p
itsy:ghc julianleviston$ ./inplace/bin/ghc-stage2 -e "1e302"
GHC error in desugarer lookup in Ghci1:
Can't find interface-file declaration for type constructor or class
mkRational
Probable cause: bug in .hi-boot file, or inconsistent .hi file
Use -ddump-if-trace to get an idea of which file caused the error
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15646#comment:59>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list