Re: How does GHC's testsuite work?

2017-10-30 Thread Edward Z. Yang
Excerpts from Sébastien Hinderer's message of 2017-10-30 16:39:24 +0100: > Dear Edward, > > Many thanks for your prompt response! > > Edward Z. Yang (2017/10/30 11:25 -0400): > > Actually, it's the reverse of what you said: like OCaml, GHC essentially > > has ~n

Re: How does GHC's testsuite work?

2017-10-30 Thread Edward Z. Yang
Actually, it's the reverse of what you said: like OCaml, GHC essentially has ~no unit tests; it's entirely Haskell programs which we compile (and sometimes run; a lot of tests are for the typechecker only so we don't bother running those.) The .T file is just a way of letting the Python driver

Re: How to get a heap visualization

2017-08-30 Thread Edward Z. Yang
Why not the plain old heap profiler? Edward Excerpts from Yitzchak Gale's message of 2017-08-30 18:34:05 +0300: > I need a simple heap visualization for debugging purposes. > I'm using GHC 8.0.2 to compile a large and complex yesod-based > web app. What's the quickest and easiest way? > >

Re: Profiling plugins

2017-06-11 Thread Edward Z. Yang
Hello M, Unfortunately, if you want detailed profiling, you will have to rebuild GHC with profiling. Note that you can basic heap profile information without rebuilding GHC. Edward Excerpts from M Farkas-Dyck's message of 2017-06-06 12:34:57 -0800: > How is this done? I am working on ConCat >

Re: Accessing the "original" names via GHC API

2017-01-25 Thread Edward Z. Yang
Hi Ranjit, Unfortunately you need more information to do this, since the set of modules which are available for import can vary depending on whether or not packages are hidden or not (not even counting whether or not a module is exposed or not!) The way GHC's pretty printer gives a good name is

FINAL CALL FOR TALKS (Aug 8 deadline): Haskell Implementors Workshop 2016, Sep 24, Nara

2016-08-01 Thread Edward Z. Yang
Deadline is in a week! Submit your talks! Call for Contributions ACM SIGPLAN Haskell Implementors' Workshop http://haskell.org/haskellwiki/HaskellImplementorsWorkshop/2016 Nara, Japan, 24 September, 2016 Co-located

Call for talks: Haskell Implementors Workshop 2016, Sep 24 (FIXED), Nara

2016-06-09 Thread Edward Z. Yang
Stegeman (ghcjs) * Niki Vazou (UCSD) * Stephanie Weirich (University of Pennsylvania) * Edward Z. Yang - chair (Stanford University) ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http

Call for talks: Haskell Implementors Workshop 2016, Aug 24, Nara

2016-06-09 Thread Edward Z. Yang
) * Stephanie Weirich (University of Pennsylvania) * Edward Z. Yang - chair (Stanford University) ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users

Re: idea: tool to suggest adding imports

2016-03-18 Thread Edward Z. Yang
Hello John, In my opinion, the big question is whether or not your Emacs extension should know how to build your Haskell project. Without this knowledge, (1) and (3) are non-starters, since you have to pass the right set of -package flags to GHC to get the process started. If you do assume you

Re: Discovery of source dependencies without --make

2015-12-13 Thread Edward Z. Yang
I missed context, but if you just want the topological graph, depanal will give you a module graph which you can then topsort with topSortModuleGraph (all in GhcMake). Then you can do what you want with the result. You will obviously need accurate targets but frontend plugins and guessTarget

Re: type error formatting

2015-10-23 Thread Edward Z. Yang
I think this is quite a reasonable suggestion. Edward Excerpts from Evan Laforge's message of 2015-10-23 19:48:07 -0700: > Here's a typical simple type error from GHC: > > Derive/Call/India/Pakhawaj.hs:142:62: > Couldn't match type ‘Text’ with ‘(a1, Syllable)’ > Expected type: [([(a1,

Re: [Haskell-cafe] The evil GADTs extension in ghci 7.8.4 (maybe in other versions too?)

2015-06-04 Thread Edward Z. Yang
it be better to decouple GADT and MonoLocalBinds? 2015년 06월 04일 20:31에 Edward Z. Yang 이(가) 쓴 글: This is because -XGADTs implies -XMonoLocalBinds. Edward Excerpts from Ki Yung Ahn's message of 2015-06-04 20:29:50 -0700: \y - let x = (\z - y) in x x is a perfectly fine there whose

Re: [Haskell-cafe] The evil GADTs extension in ghci 7.8.4 (maybe in other versions too?)

2015-06-04 Thread Edward Z. Yang
This is because -XGADTs implies -XMonoLocalBinds. Edward Excerpts from Ki Yung Ahn's message of 2015-06-04 20:29:50 -0700: \y - let x = (\z - y) in x x is a perfectly fine there whose type is a - a. (1) With no options, ghci infers its type correctly. (2) However, with -XGADTs, type check

Re: SRC_HC_OPTS in perf build

2015-05-26 Thread Edward Z. Yang
Sounds like an oversight to me! Submit a fix? Excerpts from Jeremy's message of 2015-05-25 06:44:10 -0700: build.mk.sample contains the lines: # perf matches the default settings, repeated here for comparison: SRC_HC_OPTS = -O -H64m However, in config.mk.in this is: SRC_HC_OPTS +=

Re: runghc and GhcWithInterpreter

2015-04-06 Thread Edward Z. Yang
No, it's not supposed to work, since runghc interprets GHC code. runghc itself is just a little shell script which calls GHC proper with the -f flag, so I suppose the build system was just not set up to not create this link in that case. Edward Excerpts from Jeremy's message of 2015-04-06

Re: Binary bloat in 7.10

2015-04-01 Thread Edward Z. Yang
Yes, this does seem like a potential culprit, although we did do some measurements and I didn't think it was too bad. Maybe we were wrong! Edward Excerpts from Jeremy's message of 2015-04-01 07:26:55 -0700: Carter Schonwald wrote How much of this might be attributable to longer linker symbol

Re: Found hole

2015-01-20 Thread Edward Z. Yang
Hello Volker, All identifiers prefixed with an underscore are typed holes, see: https://downloads.haskell.org/~ghc/7.8.3/docs/html/users_guide/typed-holes.html Edward Excerpts from Volker Wysk's message of 2015-01-20 10:36:09 -0800: Hello! What is a hole? This program fails to compile:

Re: GHC 7.10 regression when using foldr

2015-01-20 Thread Edward Z. Yang
it reduces the warning volume and if it somehow manages to introduce any new warnings. I hesitate to make such a proposal this late in the release candidate game, but if it worked it'd be pretty damn compelling. -Edward On Tue, Jan 20, 2015 at 6:27 PM, Edward Z. Yang ezy...@mit.edu wrote

Re: GHC 7.10 regression when using foldr

2015-01-20 Thread Edward Z. Yang
, the results of -ddump-minimal-imports would be er.. less minimal. On Tue, Jan 20, 2015 at 6:47 PM, Edward Z. Yang ezy...@mit.edu wrote: I like this proposal: if you're explicit about an import that would otherwise be implicit by Prelude, you shouldn't get a warning for it. If it is not already

Re: Compiling a cabal project with LLVM on GHC 7.10 RC1

2015-01-07 Thread Edward Z. Yang
...is there -dynamic in the -v output? Don't you also want --disable-shared? Excerpts from Brandon Simmons's message of 2015-01-07 12:21:48 -0800: I've tried: $ cabal install --only-dependencies -w /usr/local/bin/ghc-7.10.0.20141222 --enable-tests --enable-benchmarks --ghc-option=-fllvm

Re: GHC 7.4.2 on Ubuntu Trusty

2015-01-04 Thread Edward Z. Yang
For the latter two, I think this should be a perfectly acceptable point release. For transformers, we could also just ifdef the Alternative into the GHC sources. Edward Excerpts from Herbert Valerio Riedel's message of 2015-01-04 00:22:28 -0800: Hello Edward, On 2015-01-04 at 08:54:58 +0100, Edward Z

Re: GHC 7.4.2 on Ubuntu Trusty

2015-01-03 Thread Edward Z. Yang
, Edward Z. Yang wrote: Excerpts from Yitzchak Gale's message of 2014-10-28 13:58:08 -0700: How about this: Currently, every GHC source distribution requires no later than its own version of GHC for bootstrapping. Going backwards, that chops up the sequence of GHC versions into tiny

Re: ANNOUNCE: GHC 7.10.1 Release Candidate 1 - problem with latest cabal-install

2015-01-01 Thread Edward Z. Yang
If you still have your old GHC around, it will be much better to compile the newest cabal-install using the *old GHC*, and then use that copy to bootstrap a copy of the newest cabal-install. Edward Excerpts from George Colpitts's message of 2015-01-01 12:08:44 -0500: ​$ ​ cabal update

Re: ANNOUNCE: GHC 7.10.1 Release Candidate 1 - problem with latest cabal-install

2015-01-01 Thread Edward Z. Yang
/index.html On Thu, Jan 1, 2015 at 2:54 PM, Edward Z. Yang ezy...@mit.edu wrote: If you still have your old GHC around, it will be much better to compile the newest cabal-install using the *old GHC*, and then use that copy to bootstrap a copy of the newest cabal-install. Edward

Re: ANNOUNCE: GHC 7.10.1 Release Candidate 1

2014-12-27 Thread Edward Z. Yang
Hello lonetiger, I don't think any relevant logic changed in 7.10; however, this commit may be relevant: commit 8fb03bfd768ea0d5c666bbe07a50cb05214bbe92 Author: Ian Lynagh ig...@earth.li Sun Mar 18 11:42:31 2012 Committer: Ian Lynagh ig...@earth.li Sun Mar 18 11:42:31 2012

Re: Thread behavior in 7.8.3

2014-10-29 Thread Edward Z. Yang
I don't think this is directly related to the problem, but if you have a thread that isn't yielding, you can force it to yield by using -fno-omit-yields on your code. It won't help if the non-yielding code is in a library, and it won't help if the problem was that you just weren't setting

Re: Thread behavior in 7.8.3

2014-10-29 Thread Edward Z. Yang
. Is that understanding correct? (technically, doesn't it change to yielding after stack checks or something like that?) On Thu, Oct 30, 2014 at 8:24 AM, Edward Z. Yang ezy...@mit.edu wrote: I don't think this is directly related to the problem, but if you have a thread that isn't

Re: GHC 7.4.2 on Ubuntu Trusty

2014-10-28 Thread Edward Z. Yang
Excerpts from Yitzchak Gale's message of 2014-10-28 13:58:08 -0700: How about this: Currently, every GHC source distribution requires no later than its own version of GHC for bootstrapping. Going backwards, that chops up the sequence of GHC versions into tiny incompatible pieces - there is no

Re: optimizing StgPtr allocate (Capability *cap, W_ n)

2014-10-16 Thread Edward Z. Yang
Hi Bulat, This seems quite reasonable to me. Have you eyeballed the assembly GCC produces to see that the hotpath is improved? If you can submit a patch that would be great! Cheers, Edward Excerpts from Bulat Ziganshin's message of 2014-10-14 10:08:59 -0700: Hello Glasgow-haskell-users, i'm

Re: hmatrix

2014-08-24 Thread Edward Z . Yang
Hello Adrian, This sounds like a definite bug in Cabal, in that it should report accordingly if it is looking for both static and dynamic versions of the library, and only finds the static one. Can you file a bug report? Thanks, Edward Excerpts from Adrian Victor Crisciu's message of

Re: hmatrix-0.16.0.4 installation problem

2014-08-22 Thread Edward Z . Yang
Excerpts from Adrian Victor Crisciu's message of 2014-08-22 10:55:00 +0100: I tried the following command line: cabal install --enable-documentation --extra-include-dirs=/usr;local/include --extra-lib-dirs=/usr/local/lib hmatrix Is that semicolon a typo? Edward

Re: hmatrix-0.16.0.4 installation problem

2014-08-21 Thread Edward Z . Yang
Hello Adrian, Are the header files for blas and lapack on your system? (I'm not sure what the configure script for other software was checking for.) Edward Excerpts from Adrian Victor Crisciu's message of 2014-08-21 14:22:58 +0100: Sorry! This is the the failed cabal install command and its

Re: 'import ccall unsafe' and parallelism

2014-08-14 Thread Edward Z . Yang
I have to agree with Brandon's diagnosis: unsafePerformIO will take out a lock, which is likely why you are seeing no parallelism. Edward Excerpts from Brandon Allbery's message of 2014-08-14 17:12:00 +0100: On Thu, Aug 14, 2014 at 11:54 AM, Christian Höner zu Siederdissen

Re: cabal repl failing silently on missing exposed-modules

2014-08-08 Thread Edward Z . Yang
If you haven't already, go file a bug on https://github.com/haskell/cabal/issues Edward Excerpts from cheater00 .'s message of 2014-08-06 15:18:04 +0100: Hi, I have just spent some time trying to figure out why all of a sudden cabal repl silently exits without an error message. What helped

Re: Failure compiling ghc-mtl with ghc-7.8.{2,3}

2014-07-20 Thread Edward Z . Yang
The last time I saw this error, it was because the package database was messed up (there was an instance of MonadIO in scope, but it was for the wrong package.) However, I don't know what the source of the problem is here. Edward Excerpts from i hamsa's message of 2014-07-20 08:26:52 +0100: I

Re: Failure compiling ghc-mtl with ghc-7.8.{2,3}

2014-07-20 Thread Edward Z . Yang
I found the problem. package ghc-7.8.3 requires transformers-0.3.0.0 package mtl-2.2.1 requires transformers-0.4.1.0 package exceptions-0.6.1 requires transformers-0.4.1.0 I wonder how is this ever supposed to work :( On Sun, Jul 20, 2014 at 9:01 PM, Edward Z. Yang ezy...@mit.edu wrote

Re: Using mutable array after an unsafeFreezeArray, and GC details

2014-05-12 Thread Edward Z . Yang
Excerpts from Brandon Simmons's message of 2014-05-10 13:57:40 -0700: Another silly question: when card-marking happens after a write or CAS, does that indicate this segment maybe contains old-to-new generation references, so be sure to preserve (scavenge?) them from collection ? In my initial

Re: Using mutable array after an unsafeFreezeArray, and GC details

2014-05-09 Thread Edward Z . Yang
Hello Brandon, Excerpts from Brandon Simmons's message of 2014-05-08 16:18:48 -0700: I have an unusual application with some unusual performance problems and I'm trying to understand how I might use unsafeFreezeArray to help me, as well as understand in detail what's going on with boxed

Re: Using mutable array after an unsafeFreezeArray, and GC details

2014-05-09 Thread Edward Z . Yang
Excerpts from Carter Schonwald's message of 2014-05-09 16:49:07 -0700: Any chance you could try to use storable or unboxed vectors? Neither of those will work if, at the end of the day, you need to store pointers to heap objects Edward ___

Re: memory ordering

2013-12-31 Thread Edward Z . Yang
, and should do what I want. Assuming it works properly, of course. If I'm lucky it might even be optimized out. Thanks, John On Mon, Dec 30, 2013 at 6:04 AM, Edward Z. Yang ezy...@mit.edu wrote: Hello John, Here are some prior discussions (which I will attempt to summarize below

Re: memory ordering

2013-12-31 Thread Edward Z . Yang
Second, the optimizer is a bit more conservative when it comes to primop calls (internally referred to as unsafe foreign calls) Sorry, I need to correct myself here. Foreign primops, and most out-of-line primops, compile into jumps which end basic blocks, which constitute hard boundaries since

Re: memory ordering

2013-12-30 Thread Edward Z . Yang
Hello John, Here are some prior discussions (which I will attempt to summarize below): http://www.haskell.org/pipermail/haskell-cafe/2011-May/091878.html http://www.haskell.org/pipermail/haskell-prime/2006-April/001237.html

Re: blocking parallel program

2013-10-19 Thread Edward Z. Yang
, it doesn't seem to help. Facundo On Sat, Oct 19, 2013 at 8:47 PM, Edward Z. Yang ezy...@mit.edu wrote: Hello Facundo, The reason is that you have compiled the program to be multithreaded, but it is not running with multiple cores. Compile also with -rtsopts and then pass +RTS -N2

Re: Trying to compile ghc HEAD on xubuntu 13.04-x64

2013-10-04 Thread Edward Z. Yang
As a workaround, add this to your mk/build.mk HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO BUILD_DOCBOOK_PS = NO BUILD_DOCBOOK_PDF = NO This is a bug. Edward Excerpts from Nathan Hüsken's message of Fri Oct 04 13:55:01 -0700 2013: Hey, because I have touble with ghci and packages

Re: 7.8 Release Update

2013-09-14 Thread Edward Z. Yang
of Mon Sep 09 16:15:45 -0700 2013: That sounds terrible expensive to do on every `cabal build` and its a cost most users won't understand (what was broken before?). On Mon, Sep 9, 2013 at 4:06 PM, Edward Z. Yang ezy...@mit.edu wrote: If I am building some Haskell executable using 'cabal

Re: 7.8 Release Update

2013-09-09 Thread Edward Z. Yang
Excerpts from Kazu Yamamoto (山本和彦)'s message of Sun Sep 08 19:36:19 -0700 2013: % make show VALUE=GhcLibWays make -r --no-print-directory -f ghc.mk show GhcLibWays=v p dyn Yes, it looks like you are missing p_dyn from this list. I think this is a bug in the build system. When I

Re: 7.8 Release Update

2013-09-09 Thread Edward Z. Yang
I think Kazu is saying that when he builds something with profiling using cabal-install, it fails because cabal-install tries to build a dynamic version too. We don't want dyanmic/profiled libraries (there's no point, you can't load them into GHCi). Perhaps this is something that needs

Re: 7.8 Release Update

2013-09-09 Thread Edward Z. Yang
Hello Mikhail, It is a known issue that Template Haskell does not work with profiling (because GHCi and profiling do not work together, and TH uses GHCi's linker). [1] Actually, with the new linker patches that are landing soon we are not too far off from having this work. Edward [1]

Re: 7.8 Release Update

2013-09-09 Thread Edward Z. Yang
If I am building some Haskell executable using 'cabal build', the result should be *statically linked* by default. However, subtly, if I am building a Haskell library, I would like to be able to load the compiled version into GHCi. So it seems to me cabal should produce v, dyn (libs only, not

Re: 7.8 Release Update

2013-09-09 Thread Edward Z. Yang
, Sep 9, 2013 at 4:06 PM, Edward Z. Yang ezy...@mit.edu wrote: If I am building some Haskell executable using 'cabal build', the result should be *statically linked* by default. However, subtly, if I am building a Haskell library, I would like to be able to load the compiled version

Re: executable stack flag

2013-07-09 Thread Edward Z. Yang
I took a look at the logs and none mentioned 'Hey, so it turns out we need executable stack for this', and as recently as Sep 17, 2011 there are patches for turning off executable stack (courtesy Gentoo). So probably it is just a regression, someone added some code which didn't turn off

Re: executable stack flag

2013-07-09 Thread Edward Z. Yang
I've gone ahead and fixed it, and referenced the patches in the ticket. Cheers, Edward Excerpts from Jens Petersen's message of Mon Jul 08 21:36:42 -0700 2013: Hi, We noticed [1] in Fedora that ghc (7.4 and 7.6) are linking executables (again [2]) with the executable stack flag set. I

Re: Why is GHC so much worse than JHC when computing the Ackermann function?

2013-04-20 Thread Edward Z. Yang
I don't seem to get the leak on latest GHC head. Running the program in GC debug mode in 7.6.2 is quite telling; the program is allocating *a lot* of megablocks. We probably fixed it though? Edward Excerpts from Mikhail Glushenkov's message of Sat Apr 20 01:55:10 -0700 2013: Hi all, This

Re: mask, catch, myThreadId, throwTo

2013-04-16 Thread Edward Z. Yang
OK, I've updated the docus. Excerpts from Felipe Almeida Lessa's message of Mon Apr 15 13:34:50 -0700 2013: Thanks a lot, you're correct! The trouble is, I was misguided by the Interruptible operations note [1] which states that The following operations are guaranteed not to be

Re: mask, catch, myThreadId, throwTo

2013-04-15 Thread Edward Z. Yang
Sounds like those docs need to be fixed, in that case. Edward Excerpts from Felipe Almeida Lessa's message of Mon Apr 15 13:34:50 -0700 2013: Thanks a lot, you're correct! The trouble is, I was misguided by the Interruptible operations note [1] which states that The following

Re: Foreign.StablePtr: nullPtr double-free questions.

2013-03-13 Thread Edward Z. Yang
Excerpts from Remi Turk's message of Wed Mar 13 13:09:18 -0700 2013: Thanks for your quick reply. Could you elaborate on what a bit of overhead means? As a bit of context, I'm working on a small library for working with (im)mutable extendable tuples/records based on Storable and ForeignPtr,

RE: runghc -fdefer-type-errors

2013-03-11 Thread Edward Z. Yang
Excerpts from Simon Peyton-Jones's message of Mon Mar 11 16:04:31 -0700 2013: Aha. It is indeed true that ghc -fdefer-type-errors -w does not suppress the warnings that arise from the type errors; indeed there is no current way to do so. How to do that? To be kosher there should

Re: Foreign.StablePtr: nullPtr double-free questions.

2013-03-08 Thread Edward Z. Yang
Excerpts from Remi Turk's message of Fri Mar 08 18:28:56 -0800 2013: Good night everyone, I have two questions with regards to some details of the Foreign.StablePtr module. [1] 1) The documentation suggests, but does not explicitly state, that castStablePtrToPtr `liftM` newStablePtr x

RE: Cloud Haskell and network latency issues with -threaded

2013-02-07 Thread Edward Z. Yang
Hey folks, The latency changes sound relevant to some work on the scheduler I'm doing; is there a place I can see the changes? Thanks, Edward Excerpts from Simon Peyton-Jones's message of Wed Feb 06 10:10:10 -0800 2013: I (with help from Kazu and helpful comments from Bryan and Johan) have

Re: Cloud Haskell and network latency issues with -threaded

2013-02-07 Thread Edward Z. Yang
-arv/commits/push-work-exchange-squashed . -Andi On Fri, Feb 8, 2013 at 12:10 AM, Edward Z. Yang ezy...@mit.edu wrote: Hey folks, The latency changes sound relevant to some work on the scheduler I'm doing; is there a place I can see the changes? Thanks, Edward Excerpts from

Re: What is the scheduler type of GHC?

2013-01-16 Thread Edward Z. Yang
Excerpts from Magicloud Magiclouds's message of Wed Jan 16 00:32:00 -0800 2013: Hi, Just read a post about schedulers in erlang and go lang, which informed me that erlang is preemptive and go lang is cooperative. So which is used by GHC? From ghc wiki about rts, if the question is only

Re: Hoopl vs LLVM?

2012-12-10 Thread Edward Z. Yang
Hello Greg, Hoopl passes live in compiler/cmm; searching for DataflowLattice will turn up lattice definitions which are the core of the analyses and rewrites. Unfortunately, the number of true Hoopl optimizations was somewhat reduced when Simon Marlow did aggressive performance optimizations to

Re: Using DeepSeq for exception ordering

2012-11-08 Thread Edward Z. Yang
It looks like the optimizer is getting confused when the value being evaluated is an IO action (nota bene: 'evaluate m' where m :: IO a is pretty odd, as far as things go). File a bug? Cheers, Edward Excerpts from Albert Y. C. Lai's message of Thu Nov 08 10:04:15 -0800 2012: On 12-11-08 01:01

Re: Using DeepSeq for exception ordering

2012-11-07 Thread Edward Z. Yang
Hello Simon, I think the confusion here is focused on what exactly it is that the NFData class offers: class NFData a where rnf :: a - () rnf can be thought of a function which produces a thunk (for unit) which, when forced, fully evaluates the function. With this in hand, it's pretty

Re: [GHC Users] Dictionary sharing

2012-06-29 Thread Edward Z. Yang
Hello Jonas, Like other top-level definitions, these instances are considered CAFs (constant applicative forms), so these instances will in fact usually be evaluated only once per type X. import System.IO.Unsafe class C a where dflt :: a instance C Int where dflt =

Re: [GHC Users] Dictionary sharing

2012-06-29 Thread Edward Z. Yang
differently? Regards, Jonas On 29 June 2012 15:55, Edward Z. Yang ezy...@mit.edu wrote: Hello Jonas, Like other top-level definitions, these instances are considered CAFs (constant applicative forms), so these instances will in fact usually be evaluated only once per type X.    import

Re: Weird behavior of the NonTermination exception

2012-05-03 Thread Edward Z. Yang
Excerpts from Bas van Dijk's message of Thu May 03 11:10:38 -0400 2012: As can be seen, the putMVar is executed successfully. So why do I get the message: thread blocked indefinitely in an MVar operation? GHC will send BlockedIndefinitelyOnMVar to all threads involved in the deadlock, so it's

Re: containing memory-consuming computations

2012-04-20 Thread Edward Z. Yang
So, it would be pretty interesting if we could have an ST s style mechanism, where the data structure is not allowed to escape. But I wonder if this would be too cumbersome for anyone to use. Edward Excerpts from Simon Marlow's message of Fri Apr 20 06:07:20 -0400 2012: On 19/04/2012 11:45,

Re: containing memory-consuming computations

2012-04-20 Thread Edward Z. Yang
Excerpts from Brandon Allbery's message of Fri Apr 20 19:31:54 -0400 2012: So, it would be pretty interesting if we could have an ST s style mechanism, where the data structure is not allowed to escape. But I wonder if this would be too cumbersome for anyone to use. Isn't this what

Invariants for GHC.Event ensureIOManagerIsRunning

2012-04-13 Thread Edward Z. Yang
Hello all, I recently ran into a rather reproduceable bug where I would get this error from the event manager: /dev/null: hClose: user error (Pattern match failure in do expression at libraries/base/System/Event/Thread.hs:83:3-10) The program was doing some rather strange things: - It

Re: Interpreting the strictness annotations output by ghc --show-iface

2012-03-07 Thread Edward Z. Yang
Check out compiler/basicTypes/Demand.lhs Cheers, Edward Excerpts from Johan Tibell's message of Wed Mar 07 18:21:56 -0500 2012: Hi, If someone could clearly specify the exact interpretation of these LLSL(ULL) strictness/demand annotations shown by ghc --show-iface I'd like to try to write

Re: Interpreting the strictness annotations output by ghc --show-iface

2012-03-07 Thread Edward Z. Yang
This is the important bit of code in the file: instance Outputable Demand where ppr Top = char 'T' ppr Abs = char 'A' ppr Bot = char 'B' ppr (Defer ds) = char 'D' ppr ds ppr (Eval ds) = char 'U' ppr ds ppr (Box (Eval ds)) =

Re: Interpreting the strictness annotations output by ghc --show-iface

2012-03-07 Thread Edward Z. Yang
Arguably, what should happen is we redo the format for machine-parseability and use that in future versions of GHC. Edward Excerpts from Johan Tibell's message of Wed Mar 07 23:38:06 -0500 2012: Thanks Edward. I'll try to summarize this in human readable form and publish it on the wiki. --

Re: Is it true that an exception is always terminates the thread?

2012-01-23 Thread Edward Z. Yang
Excerpts from Heka Treep's message of Mon Jan 23 13:56:47 -0500 2012: adding the message queue (with Chan, MVar or STM) for each process will not help in this kind of imitation. Why not? Instead of returning a thread ID, send the write end of a Chan which the thread is waiting on. You can send

Re: Is it true that an exception is always terminates the thread?

2012-01-23 Thread Edward Z. Yang
Excerpts from Heka Treep's message of Mon Jan 23 15:11:51 -0500 2012: import Control.Monad.STM import Control.Concurrent import Control.Concurrent.STM.TChan spawn f = do mbox - newTChanIO forkIO $ f mbox

Re: Is it true that an exception is always terminates the thread?

2012-01-23 Thread Edward Z. Yang
Excerpts from Heka Treep's message of Mon Jan 23 16:20:51 -0500 2012: actor :: TChan String - IO () actor mbox = forever $ do putStrLn call to actor... msg - atomically $ do isEmpty - isEmptyTChan mbox if isEmpty then return Nothing else readTChan mbox = return . Just when

Re: Straight-line single assignment in C--

2012-01-21 Thread Edward Z. Yang
Excerpts from Edward Z. Yang's message of Fri Jan 20 23:44:02 -0500 2012: If multiple assignment is rare enough in straight line code, I might be able to take the conservative approach and just say a - used multiple times Which I don't think will cause any problems in the inlining step

Re: Runtime performance degradation for multi-threaded C FFI callback

2012-01-20 Thread Edward Z. Yang
Hello Sanket, What happens if you run this experiment with 5 threads in the C function, and have GHC run RTS with -N7? (e.g. five C threads + seven GHC threads = 12 threads on your 12-core box.) Edward Excerpts from Sanket Agrawal's message of Tue Jan 17 23:31:38 -0500 2012: I posted this

Straight-line single assignment in C--

2012-01-20 Thread Edward Z. Yang
Hello all, I was wondering if the following style of register assignment ever shows up in C-- code generated by GHC: a = R1 I32[a] = 1 a = R2 I32[a] = 2 That is to say, there are two disjoint live ranges of a: we could rename all instances of a in the first and second lines to

Re: Runtime performance degradation for multi-threaded C FFI callback

2012-01-17 Thread Edward Z. Yang
Hmm, this kind of sounds like GHC is assuming that it has control over all of the threads, and when this assumption fails bad things happen. (We use lightweight threads, and use the operating system threads that map to pthreads sparingly.) I'm sure Simon Marlow could give a more accurate

Re: log time instead of linear for case matching

2011-10-09 Thread Edward Z. Yang
Excerpts from Greg Weber's message of Sun Oct 09 12:39:03 -0400 2011: So first of all I am wondering if a sum type comparison does in fact scale linearly or if there are optimizations in place to make the lookup constant or logarithmic. Second, I as wondering (for the routing case) if Haskell

Re: Cheap and cheerful partial evaluation

2011-08-24 Thread Edward Z. Yang
I think it would be a pretty interesting project. :^) Edward Excerpts from Ryan Newton's message of Wed Aug 24 15:18:48 -0400 2011: Ah, and there's no core-haskell facility presently? Thanks. On Wed, Aug 24, 2011 at 12:14 AM, Edward Z. Yang ezy...@mit.edu wrote: Since most of GHC's

Re: Cheap and cheerful partial evaluation

2011-08-23 Thread Edward Z. Yang
at 8:48 AM, Edward Z. Yang ezy...@mit.edu wrote: I think this ticket sums it up very nicely! Cheers, Edward Excerpts from Max Bolingbroke's message of Mon Aug 22 04:07:59 -0400 2011: On 21 August 2011 19:20, Edward Z. Yang ezy...@mit.edu wrote: And no sooner do I send this email

Re: Cheap and cheerful partial evaluation

2011-08-22 Thread Edward Z. Yang
I think this ticket sums it up very nicely! Cheers, Edward Excerpts from Max Bolingbroke's message of Mon Aug 22 04:07:59 -0400 2011: On 21 August 2011 19:20, Edward Z. Yang ezy...@mit.edu wrote: And no sooner do I send this email do I realize we have 'inline' built-in, so I can probably

Re: Cheap and cheerful partial evaluation

2011-08-21 Thread Edward Z. Yang
And no sooner do I send this email do I realize we have 'inline' built-in, so I can probably experiment with this right now... Edward Excerpts from Edward Z. Yang's message of Sun Aug 21 14:18:23 -0400 2011: Hello all, It occurred to me that it might not be too difficult to use GHC's

Re: What are the preconditions of newArray#

2011-08-21 Thread Edward Z. Yang
stg_newArrayzh in rts/PrimOps.cmm doesn't appear to give any indication, so this might be a good patch to add. But I'm curious: what would allocating Array#s of size 0 do? Null pointers? That sounds dangerous... Edward Excerpts from Johan Tibell's message of Fri Aug 19 11:04:48 -0400 2011: Hi,

Re: GHCJS

2011-08-02 Thread Edward Z. Yang
Excerpts from Victor Nazarov's message of Tue Aug 02 19:12:55 -0400 2011: I can parse arguments myself and throw the rest of them to parseDynamicFlags, but GHC's flags are really complicated and I'm not aware of any argument parsing library that can be used to filter out some specified flags

Re: hsc2hs and #include

2011-07-30 Thread Edward Z. Yang
This is supposed to get defined as a command line argument to the preprocessor, see compiler/main/DriverPipeline.hs. Are you saying you don't see it when you run hsc2hs? Maybe someone else is calling a preprocessor but missing some of these arguments... Edward

Re: hsc2hs and #include

2011-07-30 Thread Edward Z. Yang
PM, Edward Z. Yang ezy...@mit.edu wrote: This is supposed to get defined as a command line argument to the preprocessor, see compiler/main/DriverPipeline.hs.  Are you saying you don't see it when you run hsc2hs? Maybe someone else is calling a preprocessor but missing some

Re: Understanding behavior of BlockedIndefinitelyOnMVar exception

2011-07-25 Thread Edward Z. Yang
Hello Brandon, The answer is subtle, and has to do with what references are kept in code, which make an object considered reachable. Essentially, the main thread itself keeps the MVar live while it still has forking to do, so that it cannot get garbage collected and trigger these errors. Here

Re: Understanding behavior of BlockedIndefinitelyOnMVar exception

2011-07-24 Thread Edward Z. Yang
Excerpts from Felipe Almeida Lessa's message of Sun Jul 24 22:02:36 -0400 2011: Does anything change if you somehow force a GC sometime after good2? Perhaps with some calculation generating garbage, perhaps with performGC. IIRC, the runtime detects BlockedIndefinitelyOnMVar on GC. But I'm

Re: memory statistics via an API ?

2011-07-19 Thread Edward Z. Yang
Not currently, but I am planning on adding this functionality in the near future. Excerpts from Tim Docker's message of Wed Jul 20 13:44:41 -0400 2011: The +RTS -s runtime arguments give some useful details the memory usage of a program on exit. eg: 102,536 bytes allocated in the

Re: Hoopl: Examples of wrapFR or wrapBR?

2011-06-25 Thread Edward Z. Yang
Hello Justin, If you grep Hoopl's source code for wrapFR and wrapBR, you can find uses of the methods. For example: thenFwdRw :: forall m n f. Monad m = FwdRewrite m n f - FwdRewrite m n f - FwdRewrite m n f -- @ end comb1.tex thenFwdRw

Re: Superclass equalities

2011-06-22 Thread Edward Z. Yang
Yay! This is very exciting :-) Edward Excerpts from Simon Peyton-Jones's message of Wed Jun 22 12:57:28 -0400 2011: Friends I have long advertised a plan to allow so-called superclass equalities. I've just pushed patches to implement them. So now you can write class (F a ~ b) = C a

Re: gitweb on darcs.haskell.org?

2011-06-21 Thread Edward Z. Yang
All of the GHC repos are mirrored to Github, which offers similar facilities. Of course, it wouldn't be too much work to setup gitweb on darcs.haskell.org, I don't think. Edward ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org

Re: MonoLocalBinds and hoopl

2011-06-17 Thread Edward Z. Yang
In case it wasn't clear, I'd very much be in favor of implementing this refinement. Cheers, Edward ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: MonoLocalBinds and hoopl

2011-06-14 Thread Edward Z. Yang
I ran into some more code like this, and I realized there was something pretty important: the majority of let-bindings do not have any free varaibles. They could very well be floated to the top level without having to make any source level changes. So maybe let should be generalized, if no free

Re: testsuite results

2011-05-15 Thread Edward Z. Yang
To chime in, latest validate for me on x86-32 had two fails: OVERALL SUMMARY for test run started at Sun May 15 16:16:28 BST 2011 2773 total tests, which gave rise to 10058 test cases, of which 0 caused framework failures 7598 were skipped 2377 expected passes 81

Re: Tracing idea

2011-05-12 Thread Edward Z. Yang
:46:01 -0500 2011: On 21/02/2011 01:08, Edward Z. Yang wrote: Excerpts from Tyson Whitehead's message of Sun Feb 20 07:14:56 -0500 2011: I believe a back trace on the actual call stack is generally considered not that useful in a lazy language as it corresponds to the evaluation sequence

Re: performance issues in simple arithmetic code

2011-04-28 Thread Edward Z. Yang
Excerpts from Denys Rtveliashvili's message of Thu Apr 28 04:41:48 -0400 2011: Well.. I found some places in C-- compiler which are supposed to convert division and multiplication by 2^n into shifts. And I believe these work sometimes. However in this case I am a bit puzzled because even if

  1   2   >