RE: Thoughts on the design of External Core

2007-02-20 Thread Simon Peyton-Jones
Aaron,

I've digested your msg, and yes on balance I think you are probably right.  
Really the only disadvantages of the IfaceSyn route are:

* Need to take more care with errors
* The possiblity that the needs of interface files and the needs of External 
Core might not be identical.

On the up-side, using IfaceSyn guarantees that it'll stay up to date.


Concerning type checking, the IfaceSyn typechecker does not check that, say, in 
an application (f x) the type of f is compatible with the type of x.  I urge 
you *not* to make it check, because that'll make more work even when reading 
interface files.

Instead,
(1) run the existing tcIfaceExpr stuff (which really amounts to a kind of 
reader, turning the strings in IfaceSyn into the Ids and TyCons of Core),
(2) run CoreLint to check that the resulting terms are well-typed.

You may need to work on Core Lint's error messages a bit, but it does the right 
kind of thing.


Let me know how it goes.

Simon

| -Original Message-
| From: Aaron Tomb [mailto:[EMAIL PROTECTED]
| Sent: 15 February 2007 00:50
| To: GHC Users Mailing List
| Cc: Simon Peyton-Jones
| Subject: Thoughts on the design of External Core
|
| Over the last few days, I've put some more thought into the overall
| design of External Core. I looked through some of the GHC code some
| more, and I'm leaning toward a preference for using IfaceSyn
| throughout the whole External Core processing path.
|
| Simon, feel free to digest this at your leisure when you return.
|
| I also welcome feedback from anyone else. I don't assume that either
| of the following lists is complete or fully correct, and would like
| to hear any comments or criticism.
|
| Now, on to what I see as the pros and cons of using the Iface
| infrastructure for all aspects of External Core.
|
| Pros:
|
| * The input segment of this path is largely complete already. It
| needs a little fixing up (some of which I've already done), but the
| general design seems sound.
|
| * The code in HscMain that calls emitExternalCore is in the middle of
| the Iface processing pipeline. So, full Iface information is already
| available. If I understand things correctly, this means that all of
| the code of the current module is already in scope in IfaceSyn
| format. Maybe I'm wrong, though, and only type signatures are fully
| present?
|
| * Though I hear that the Iface typechecker generally assumes the
| absence of errors, the best long-term design decision might be to
| beef it up to the point where it can really tell you what's wrong
| when given ill-typed input. It is an external representation, after
| all. Currently, it's only likely to have come from GHC itself.
| Perhaps in the future other tools will also manipulate .hi files,
| however. Using IfaceSyn for External Core would encourage us to
| improve the typechecker, which would make interfacing with such tools
| more viable.
|
| * It looks like it would be straightforward to pretty-print IfaceSyn
| in ExternalCore format directly. It has almost exactly the same set
| of data constructors as (the old) ExternalCore does. The conversion
| from Core - Abstract ExternalCore - Concrete ExternalCore seems
| unnecessary. We could just do IfaceSyn - Concrete ExternalCore.
|
| Cons:
|
| * If the Iface typechecker is indeed less than helpful in the face of
| errors, it will need to be improved.
|
| * I may be missing complications that would make the picture less
| rosy than I've implied.
|
| * One approach to the architecture of GHC (which I had in mind
| originally) is that all source code, in whatever format, should
| somehow go through the HsSyn portion of the compiler. Thus, this part
| of the compiler does all of the real error checking, whereas the rest
| can assume certain correctness properties. Using IfaceSyn for
| External Core would violate this architectural assumption.
|
| Aaron

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: ghc 6.6 for mac os x (intel)

2007-02-20 Thread Ariel Apostoli

Hi Ian,

Thanks so much for trying to help out. You are right, that readline file 
is not there so I installed it from MacPorts and made a symbolic link to 
the installed location. Now everything is fine.


Thanks again!

Ariel


Ian Lynagh wrote:

Hi Ariel,

Sorry for the delayed response.

On Tue, Feb 06, 2007 at 12:07:46PM -0600, Ariel Apostoli wrote:
  

Are you using
   http://haskell.org/ghc/dist/6.6/ghc-6.6-i386-apple-darwin.tar.bz2
?
 
  

Yes.


I've just downloaded it, and it looks like the Makefile should run
post-install-script to put readline/* in the right place. Can you check
if that is happening correctly?
 
  
the post-install script is not exactly happy; here is what i get when it 
starts running:



[snipped]

I'm not sure what output is expected, but your earlier message
http://www.haskell.org/pipermail/glasgow-haskell-users/2007-February/011962.html
suggested that there is no file /opt/local/lib/libreadline.5.1.dylib
whereas post-install-script certainly looks like it will put something
there. Can you confirm whether or not the file is there, and whether you
are still getting the same error please?


Thanks
Ian
  

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: hasktags - small patch

2007-02-20 Thread Ian Lynagh

Hi Marc,

On Sat, Feb 17, 2007 at 05:12:13AM +0100, Marc Weber wrote:
 
 154c154
let wordlines = map words aslines
 ---
let wordlines = map mywords aslines
 161a162,174
-- my words is mainly copied from Data.List.
-- difference abc::def is split into three words instead of one.
mywords :: String - [String]
mywords (':':':':xs) = :: : mywords xs

I'm not familiar with the code, but this looks like it is just a quick
fix for this particular case, while a proper fix would involve something
like breaking lines into blocks of characters in the same class (i.e. a
weak form of lexing by the Haskell Report rules). Is that right, or does
it turn out that the :: case is the only thing we need to worry about?

Better still, of course, if anyone was interested in spending some time
on this, would be to either (portably) use Language.Haskell to do the
lexing or (GHC-only) use the GHC API to do the lexing. I think someone
might actually have been looking at doing the latter already?


Thanks
Ian

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: hasktags - small patch

2007-02-20 Thread Marc Weber
  154c154
 let wordlines = map words aslines
  ---
 let wordlines = map mywords aslines
  161a162,174
 -- my words is mainly copied from Data.List.
 -- difference abc::def is split into three words instead of one.
 mywords :: String - [String]
 mywords (':':':':xs) = :: : mywords xs
 
 I'm not familiar with the code, but this looks like it is just a quick
 fix for this particular case, 
Yes. It is only a quick fix for this particular case because I did need
it ;-)

I don't wont to spend more time on this right now but perhaps I will
after making my current project work..

Marc W.
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users