[GHC] #1338: base package breakup
GHC
trac at galois.com
Tue Aug 25 23:47:57 EDT 2009
#1338: base package breakup
---------------------------------+------------------------------------------
Reporter: simonmar | Owner:
Type: task | Status: new
Priority: normal | Milestone: 6.12 branch
Component: libraries/base | Version: 6.6.1
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Comment (by mokus):
Replying to [comment:33 duncan]:
> I would suggest an approach using a combination of annotations and
analysis. Certainly a package that contains only pure functions and
depends only on other packages you've deemed to be ok, is itself ok. That
requires no annotation, just analysis. Your problem of course is packages
that either exports genuinely unsafe things or that uses unsafe things to
export safe abstractions. My suggestion here is to annotate the things
that are safe but use unsafe things internally. Of course you then need to
"believe" the annotations, so you would want a way to specify a list of
packages where you will trust the annotations to be correct. You don't
need to annotate things as unsafe since all primitives are considered
unsafe unless marked safe.
>
> The point is you do not need to conflate the safe/unsafe distinction
with package boundaries.
I agree with this in principle, however I believe that it introduces an
unnecessary level of indirection. The type system in Haskell, and GHC in
particular, is already a very powerful annotation system which under
normal circumstances automatically tracks exactly the kind of safety
information I need, and automatically infers it at the expression level.
Any annotation system I implement in addition to that would be likely be a
large amount of wasted effort to provide essentially a very course-grained
and primitive supplemental type system. What I'm doing now is essentially
what you suggest, but using types as the "annotations". If I could
include the base package among those packages for which I can trust the
annotations, it would greatly simplify certain aspects of my
implementation.
As far as conflating safety distinctions with package boundaries, I can
see how I gave that impression but I don't believe that's what I'm doing.
Ultimately, trust is what I am delimiting with package boundaries. As
packages are the basic units of code deployment I believe this is a very
natural boundary.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1338#comment:34>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list