Re: GHC 9.6.1 rejects previously working code

2023-04-12 Thread Harendra Kumar
regardless of `MonadTrans` > > Good luck! > Rodrigo > > On 12 Apr 2023, at 10:10, Tom Ellis < > tom-lists-haskell-cafe-2...@jaguarpaw.co.uk> wrote: > > On Wed, Apr 12, 2023 at 02:32:43PM +0530, Harendra Kumar wrote: > > instance MonadIO m => Monad (T m) where &g

GHC 9.6.1 rejects previously working code

2023-04-12 Thread Harendra Kumar
The following code compiles with older compilers but does not compile with GHC 9.6.1: {-# LANGUAGE KindSignatures #-} module A () where import Control.Monad.IO.Class import Control.Monad.Trans.Class data T (m :: * -> *) a = T instance Functor (T m) where fmap f T = undefined instance

Re: Performance of small allocations via prim ops

2023-04-07 Thread Harendra Kumar
On Fri, 7 Apr 2023 at 02:18, Carter Schonwald wrote: > That sounds like a worthy experiment! > > I guess that would look like having an inline macro’d up path that checks > if it can get the job done that falls back to the general code? > > Last I checked, the overhead for this sort of c call

Re: Performance of small allocations via prim ops

2023-04-07 Thread Harendra Kumar
ent nursery block. So why have this option? Why not fix this to LARGE_OBJECT_THRESHOLD? Maybe I am missing something. -harendra On Fri, 7 Apr 2023 at 15:45, Harendra Kumar wrote: > > > On Fri, 7 Apr 2023 at 12:57, Simon Peyton Jones < > simon.peytonjo...@gmail.com> wrote: > >

Re: Performance of small allocations via prim ops

2023-04-07 Thread Harendra Kumar
On Fri, 7 Apr 2023 at 12:57, Simon Peyton Jones wrote: > > We are emitting a more efficient code when the size of the array is > smaller. And the threshold is governed by a compiler flag: > > It would be good if this was documented. Perhaps in the Haddock for > `newByteArray#`? Or where? >

Re: Performance of small allocations via prim ops

2023-04-07 Thread Harendra Kumar
y original question now applies only to the case when the array size is bigger than this configurable threshold, which is a little less motivating. And Ben says that the call is not expensive, so we can leave it there. -harendra On Fri, 7 Apr 2023 at 11:08, Harendra Kumar wrote: > Ah, some othe

Re: Performance of small allocations via prim ops

2023-04-06 Thread Harendra Kumar
r 2023 at 10:49, Harendra Kumar wrote: > Thanks Ben and Carter. > > I compiled the following to Cmm: > > {-# LANGUAGE MagicHash #-} > {-# LANGUAGE UnboxedTuples #-} > > import GHC.IO > import GHC.Exts > > data M = M (MutableByteArray# RealWorld) > > main =

Re: Performance of small allocations via prim ops

2023-04-06 Thread Harendra Kumar
improvement in this. -harendra On Fri, 7 Apr 2023 at 03:32, Ben Gamari wrote: > Harendra Kumar writes: > > > I was looking at the RTS code for allocating small objects via prim ops > > e.g. newByteArray# . The code looks like: > > > > stg_newByteArrayzh ( W_ n ) >

Performance of small allocations via prim ops

2023-04-04 Thread Harendra Kumar
I was looking at the RTS code for allocating small objects via prim ops e.g. newByteArray# . The code looks like: stg_newByteArrayzh ( W_ n ) { MAYBE_GC_N(stg_newByteArrayzh, n); payload_words = ROUNDUP_BYTES_TO_WDS(n); words = BYTES_TO_WDS(SIZEOF_StgArrBytes) + payload_words;

Re: GHC API documentation

2023-03-14 Thread Harendra Kumar
Thanks Ben. The link is broken in GHC 9.4.4 as well. But works in 9.2.x . On Tue, 14 Mar 2023 at 23:19, Ben Gamari wrote: > Harendra Kumar writes: > > > Hi, > > > > > > There used to be a GHC API documentation along with other documentation > in > > th

GHC API documentation

2023-03-14 Thread Harendra Kumar
Hi, There used to be a GHC API documentation along with other documentation in the GHC release. But I cannot find it any more. For example, in GHC 9.6.1 this link - https://downloads.haskell.org/ghc/9.6.1/docs/libraries/ghc/index.html is broken. What happened to this? Is this now available at

Instructions to build GHC

2022-08-26 Thread Harendra Kumar
Hi, I used to follow the instructions in INSTALL.md and README.md in the root of the repo, and they always worked until recently. I am aware that the make based system has been replaced by Hadrian. But it seems these files are not updated with the new build instructions. 1. Either these files

Re: Wiki page for WebAssembly support in GHC

2022-03-03 Thread Harendra Kumar
This is exciting news. Thank you Cheng and Norman, and Tweag! With both GHCJS and WASM officially supported in GHC, Haskell will now have first class support for JS. I am looking forward to GHC 9.6. -harendra On Thu, 3 Mar 2022 at 19:42, Cheng Shao wrote: > > Hi all, > > We're planning to add

Re: downloading ghc head version

2022-02-01 Thread Harendra Kumar
> > https://gitlab.haskell.org/ghc/ghc/-/commit/871ce2a300ed35639a39a86f4c85fbcb605c5d7d > > Is your problem sorted now? > > Matt > > On Tue, Feb 1, 2022 at 12:09 AM Harendra Kumar > wrote: > > > > I replaced deb9 with deb10 in the URL that ghcup install was

Re: downloading ghc head version

2022-01-31 Thread Harendra Kumar
It seems the latest artifacts download link (https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/...) at GHC gitlab is not working. If this is not the right place to ask this, can someone point me to the right place? -harendra On Wed, 26 Jan 2022 at 18:38, Harendra Kumar wrote: > > Hi,

downloading ghc head version

2022-01-26 Thread Harendra Kumar
Hi, I am trying to set up a CI for ghc head version. I am not sure what is the official supported method to install a nightly/head version of GHC. haskell/actions/setup on github seems to support it via ghcup. But it almost always fails, I saw it succeeding once till now. It tries to download it

Measuring thread cpu time (using bound threads)

2021-12-28 Thread Harendra Kumar
Hi GHC devs, I want to measure the CPU time spent in a particular Haskell thread across thread yield points. I am assuming Haskell threads do not keep track of per thread cpu time. Therefore, to measure it I have to use the thread cpu clock (CLOCK_THREAD_CPUTIME_ID) provided by the OS (Linux).

Compiling "primitive" with ghc head

2021-11-26 Thread Harendra Kumar
Forgot to add subject in the previous email. On Sat, 27 Nov 2021 at 01:01, Harendra Kumar wrote: > Hi GHC devs, > > While compiling the primitive package using ghc head I ran into the > following error: > > Data/Primitive/Types.hs:265:870: error: > • Couldn't match type

[no subject]

2021-11-26 Thread Harendra Kumar
Hi GHC devs, While compiling the primitive package using ghc head I ran into the following error: Data/Primitive/Types.hs:265:870: error: • Couldn't match type ‘Word64#’ with ‘Word#’ Expected: Word64_# Actual: Word64# • In the fourth argument of ‘setWord64Array#’, namely

Re: Question about specialization

2021-09-06 Thread Harendra Kumar
es not, specialise the > function? > > > > File it as a ticket … to me it looks like a bug. > > > > Thanks > > > > Simon > > > > *From:* ghc-devs *On Behalf Of *Harendra > Kumar > *Sent:* 06 September 2021 14:11 > *To:* ghc-devs@haskell.org

Question about specialization

2021-09-06 Thread Harendra Kumar
Hi GHC devs, I have a simple program using the streamly library, as follows, the whole code is in the same module: {-# INLINE iterateState #-} {-# SPECIALIZE iterateState :: Int -> SerialT (StateT Int IO) Int #-} iterateState :: MonadState Int m => Int -> SerialT m Int iterateState n = do x

Re: Breaking changes to the base library

2021-06-20 Thread Harendra Kumar
from > Data.List is the humble 'sort', which doesn't conflict. > > -Edward > > On Sun, Jun 20, 2021 at 4:45 AM Chris Smith wrote: > >> Yikes, this is going to break nearly everything. Definitely good to let >> people know. >> >> On Sun, Jun 20, 2021 at 7:4

Breaking changes to the base library

2021-06-20 Thread Harendra Kumar
I see the following errors when compiling with ghc head version: $ ghc-stage2 --version The Glorious Glasgow Haskell Compilation System, version 9.3.20210608 $ cabal build --with-compiler ghc-stage2 --allow-newer Data/Colour/CIE.hs:80:12: error: Ambiguous occurrence ‘sum’ It could refer

GHC head, profiling with -O2 does not work

2021-05-23 Thread Harendra Kumar
Hi, I am trying to build a small program with profiling using a ghc built from haskell gitlab master branch. When I use -O2 I run into: $ ghc/inplace/bin/ghc-stage2 --make -O2 -prof -fprof-auto -rtsopts Main.hs Linking Main ... ./StreamD.o(.text+0x1b9f2): error: undefined reference to

Re: perf regression with TypeFamilies

2020-07-02 Thread Harendra Kumar
I opened a GHC ticket (https://gitlab.haskell.org/ghc/ghc/-/issues/18414) with full details. -harendra On Tue, 30 Jun 2020 at 18:25, Harendra Kumar wrote: > Hi Richard, > > I am glad that you are interested in it. It is the runtime performance > that degrades, and yes it is fully

Re: perf regression with TypeFamilies

2020-06-30 Thread Harendra Kumar
Hi Richard, I am glad that you are interested in it. It is the runtime performance that degrades, and yes it is fully reproducible and publicly shareable, the library is open source so anyone can run these benchmarks. I had postponed the problem raising an issue to investigate it further here

Re: Fusing loops by specializing on functions with SpecConstr?

2020-04-01 Thread Harendra Kumar
On Wed, 1 Apr 2020 at 02:49, Alexis King wrote: > > I’ve been trying to figure out if it would be possible to help the > optimizer out by annotating the program with special combinators like the > existing ones provided by GHC.Magic. However, I haven’t been able to come > up with anything yet

Re: Random crashes with memory corruption symptoms

2020-02-03 Thread Harendra Kumar
95 > > (GHC version 8.11.0.20200201 for x86_64_unknown_linux) > Please report this as a GHC bug: > https://www.haskell.org/ghc/reportabug > > In non-debug runtime it works fine maybe half of the time, in others I get > a > panic in the GC. > > Ömer > >

Re: Random crashes with memory corruption symptoms

2020-02-02 Thread Harendra Kumar
our program with `-debug` and run it with `+RTS -DS` and see if > the > error message changes. > > But really you should try with 8.8.2 as first thing. It's possible that > this is > another manifestation of #17088. > > Ömer > > Harendra Kumar , 3 Şub 2020 Pzt, 01:26 > ta

Random crashes with memory corruption symptoms

2020-02-02 Thread Harendra Kumar
Hi, While running a test-suite for the streaming library streamly I am encountering a crash which seems to happen at random places at different times. The common messages are: * Segmentation fault: 11 * internal error: scavenge_mark_stack: unimplemented/strange closure type 24792696 @

Re: Hitting RTS bug on GHC 8.0.2

2018-10-30 Thread Harendra Kumar
Hit it only once. Cannot reproduce it after that. I will update if I hit it again. -harendra On Tue, 30 Oct 2018 at 18:59, Simon Marlow wrote: > Looking at the code I can't see how that assertion could possibly fail. > Is it reproducible? > > On Tue, 30 Oct 2018 at 08:38, Ha

Hitting RTS bug on GHC 8.0.2

2018-10-30 Thread Harendra Kumar
Hi, I got the following crash in one of my CI tests ( https://travis-ci.org/composewell/streamly/jobs/448112763): test: internal error: RELEASE_LOCK: I do not own this lock: rts/Messages.c 54 (GHC version 8.0.2 for x86_64_unknown_linux) Please report this as a GHC bug:

clonetype

2018-09-24 Thread Harendra Kumar
Often, we need to create a newtype that is equivalent to a given type for safety reasons. Using type synonym is useless from type safety perspective. With newtype, we have to add a "deriving" clause to it for deriving the required instances, to make it practically useful. Does it make sense, and

Re: DoAndIfThenElse

2018-02-08 Thread Harendra Kumar
e lines, > the "then" and "else" must be indented farther than the "if" or layout will > consider them distinct new expressions (and thereby syntax errors). > > On Thu, Feb 8, 2018 at 9:24 PM, Harendra Kumar <harendra.ku...@gmail.com> > wrote: > >>

DoAndIfThenElse

2018-02-08 Thread Harendra Kumar
Hi, I recently found a mention of DoAndIfThenElse extension somewhere. I looked inside the ghc user guide and could not find any such extension. Then I looked in the ghc man page, no mention. I googled and found a very sparse references to it here and there. Then I tried using the extension with

Re: [Haskell-cafe] rolling span and groupBy for lists

2018-02-05 Thread Harendra Kumar
On 6 February 2018 at 00:33, Sergiu Ivanov <siva...@colimite.fr> wrote: > Thus quoth Harendra Kumar on Mon Feb 05 2018 at 18:30 (+0100): > > Yes, Hayoo seems to be giving better results, I found more variants > having > > the behavior I want, it seems this variant is

Re: rolling span and groupBy for lists

2018-02-05 Thread Harendra Kumar
suddenly catch a whiff of https://xkcd.com/927/ ? > > On Mon, Feb 5, 2018 at 1:13 PM, Harendra Kumar <harendra.ku...@gmail.com> > wrote: > >> According to hayoo there seem to be 7 different implementations of this >> same function. Yours is 8th and mine is 9th and oth

Re: rolling span and groupBy for lists

2018-02-05 Thread Harendra Kumar
nto Data.List, every person has a > slightly different idea of what it should be. > > On Sun, Feb 4, 2018 at 7:50 PM, Harendra Kumar <harendra.ku...@gmail.com> > wrote: > > Hi, > > > > For a small problem, I was looking for a groupBy like function that

Re: [Haskell-cafe] rolling span and groupBy for lists

2018-02-05 Thread Harendra Kumar
, Sergiu Ivanov <siva...@colimite.fr> wrote: > Hello Harendra, > > Thus quoth Harendra Kumar on Mon Feb 05 2018 at 16:43 (+0100): > > > > The irony is that theoretically you can find a Haskell package or > > implementation of whatever you can imagine but quite often i

Re: rolling span and groupBy for lists

2018-02-05 Thread Harendra Kumar
asking to consider having it in base alongside groupBy. It seems more useful, general and intuitive than the existing groupBy. -harendra > > On Sun, Feb 4, 2018 at 7:50 PM, Harendra Kumar <harendra.ku...@gmail.com> > wrote: > > Hi, > > > > For a small problem,

Re: rolling span and groupBy for lists

2018-02-04 Thread Harendra Kumar
2018 at 09:53, David Feuer <da...@well-typed.com> wrote: > This is the wrong list. You probably meant to email haskell-cafe or > perhaps librar...@haskell.org. > > > > David Feuer > Well-Typed, LLP > > Original message > From: Harendra Kumar &l

rolling span and groupBy for lists

2018-02-04 Thread Harendra Kumar
Hi, For a small problem, I was looking for a groupBy like function that groups based on a predicate on successive elements but I could not find one. I wrote these little functions for that purpose: -- | Like span, but with a predicate that compares two successive elements. The -- span ends when

Re: How to load & parse an HI (interface) file?

2017-12-02 Thread Harendra Kumar
Also, "-ddump-hi" dumps the same information at compile time. -harendra On 3 December 2017 at 01:50, Harendra Kumar <harendra.ku...@gmail.com> wrote: > GHC has a "--show-iface" option which pretty prints the ".hi" file. Not > sure if it works for y

Re: How to load & parse an HI (interface) file?

2017-12-02 Thread Harendra Kumar
GHC has a "--show-iface" option which pretty prints the ".hi" file. Not sure if it works for your use-case but it may be easier to parse the text displayed by this option. -harendra On 2 December 2017 at 21:29, Saurabh Nanda wrote: > (GHC newbie alert -- is this the

Re: Dynamically choosing the main function

2017-11-12 Thread Harendra Kumar
On 13 November 2017 at 03:47, Ben Gamari <b...@smart-cactus.org> wrote: > Harendra Kumar <harendra.ku...@gmail.com> writes: > > > On 12 November 2017 at 23:18, Ben Gamari <b...@smart-cactus.org> wrote: > > > >> In general it's not easy

Re: Dynamically choosing the main function

2017-11-12 Thread Harendra Kumar
On 13 November 2017 at 00:29, Saurabh Nanda wrote: > > In fact I have been using dlopen to implement Haskell plugins but did > not think of using it for this use case. > > Absolutely OT. Is this technique different from what facebook/simonmar > have recently open-sourced?

Re: Dynamically choosing the main function

2017-11-12 Thread Harendra Kumar
On 12 November 2017 at 23:18, Ben Gamari <b...@smart-cactus.org> wrote: > Harendra Kumar <harendra.ku...@gmail.com> writes: > > > Hi, > > > > GHC allows choosing a main function at link time using the "-main-is" > > option. I was wondering if th

Re: Dynamically choosing the main function

2017-11-12 Thread Harendra Kumar
time. I am just giving a general idea here without going into specifics. -harendra On 12 November 2017 at 21:58, Shea Levy <s...@shealevy.com> wrote: > What would you be able to achieve with this that you couldn't achieve > with branching in a fixed custom main function? > >

Dynamically choosing the main function

2017-11-12 Thread Harendra Kumar
Hi, GHC allows choosing a main function at link time using the "-main-is" option. I was wondering if there is a possibility to choose the main function at runtime. Or even better, if something equivalent to "ghc -e" is somehow possible in a linked binary executable. If not, are there any plans to

Re: GHC 8.2 GC time stats going negative

2017-11-09 Thread Harendra Kumar
at 00:12, Harendra Kumar <harendra.ku...@gmail.com> wrote: > Hi Ben, > > Yes, there are FFI calls between the two getRTSStats calls. FFI calls are > C APIs to get some OS stats like clock time or cpu time etc. Now I know > that this is not expected, let me try to minimize the

Re: GHC 8.2 GC time stats going negative

2017-11-09 Thread Harendra Kumar
On 9 November 2017 at 23:49, Ben Gamari <b...@well-typed.com> wrote: > Harendra Kumar <harendra.ku...@gmail.com> writes: > > > Hi, > > > > I am trying to use the mutator_cpu_ns and mutator_elapsed_ns from GHC 8.2 > > RTSStats structure retrieved using g

GHC 8.2 GC time stats going negative

2017-11-09 Thread Harendra Kumar
Hi, I am trying to use the mutator_cpu_ns and mutator_elapsed_ns from GHC 8.2 RTSStats structure retrieved using getRTSStats API documented here - https://hackage.haskell.org/package/base-4.10.0.0/docs/GHC-Stats.html . I am seeing that the values of these stats retrieved about 30 ms later are

Re: GHC 8.2.1 release commit

2017-09-11 Thread Harendra Kumar
It seems I had only the master branch in my tree. A git fetch showed all the branches including 8.2.1. -harendra On 11 September 2017 at 11:13, Harendra Kumar <harendra.ku...@gmail.com> wrote: > Hi, > > In the GHC git repo how do I figure out which commit belongs to release &g

GHC 8.2.1 release commit

2017-09-10 Thread Harendra Kumar
Hi, In the GHC git repo how do I figure out which commit belongs to release 8.2.1. I cannot find 8.2.1 in "git tag" output. I tried "git log" and searching for 8.2.1 but there seems to be no definitive comment marking 8.2.1. -harendra ___ ghc-devs

Re: Semigroup repeat (base package)

2017-09-10 Thread Harendra Kumar
On 11 September 2017 at 02:46, Wolfgang Jeltsch wrote: > Am Sonntag, den 10.09.2017, 10:39 +0200 schrieb Herbert Valerio Riedel: > > What you seem to be searching for looks more like what we know as > > `cycle :: [a] -> [a]`, and in fact there is its generalisation at >

Re: Semigroup repeat (base package)

2017-09-10 Thread Harendra Kumar
wrote: > Hi, > > On Sun, Sep 10, 2017 at 9:24 AM, Harendra Kumar > <harendra.ku...@gmail.com> wrote: > > I could not find a function that repeats a value using a semigroup > append. I > > am looking for something like this: > > > > srepeat :: Semigrou

Semigroup repeat (base package)

2017-09-10 Thread Harendra Kumar
Hi, I am sending this question here since base ships with ghc, let me know if this is not the right forum for this. I could not find a function that repeats a value using a semigroup append. I am looking for something like this: srepeat :: Semigroup a => a -> a srepeat x = xs where xs = x <> xs

Re: Performance degradation when factoring out common code

2017-09-09 Thread Harendra Kumar
Ok, I filed a ticket for the inlining issue as well - https://ghc.haskell.org/trac/ghc/ticket/14211. The reproduction test case is in the same repo on the "inlining-issue" branch, here - https://github.com/harendra-kumar/ghc-perf/tree/inlining-issue . Performance with manually inlining

Re: Performance degradation when factoring out common code

2017-09-09 Thread Harendra Kumar
/harendra-kumar/ghc-perf to reproduce the issue. Readme file in the repo has instructions to reproduce. The issue seems to occur when the code is placed in a different module. When all the code is in the same module the problem does not occur. In that case -O2 is faster than -O0. However, when

Re: Performance degradation when factoring out common code

2017-09-09 Thread Harendra Kumar
The code is at: https://github.com/harendra-kumar/asyncly. The benchmark code is in "benchmark/Main.hs". The relevant function is "asyncly_basic". If you want to run it, you can use the following steps to reproduce the behavior I reported below: 1) Run "stack bu

Re: Performance degradation when factoring out common code

2017-09-08 Thread Harendra Kumar
is a lot and this is the case with -O1 as well which should be relatively safer than -O2 in general. Worst of all runghc is significantly faster than ghc. What's going on? -harendra On 8 September 2017 at 18:49, Harendra Kumar <harendra.ku...@gmail.com> wrote: > I will try creating

Re: Performance degradation when factoring out common code

2017-09-08 Thread Harendra Kumar
mon > > > > *From:* ghc-devs [mailto:ghc-devs-boun...@haskell.org] *On Behalf Of *Harendra > Kumar > *Sent:* 08 September 2017 13:50 > *To:* Mikolaj Konarski <mikolaj.konar...@gmail.com> > *Cc:* ghc-devs@haskell.org > *Subject:* Re: Performance degradation when fa

Re: Performance degradation when factoring out common code

2017-09-08 Thread Harendra Kumar
gt; > Good luck > Mikolaj > > > > On Fri, Sep 8, 2017 at 11:21 AM, Harendra Kumar > <harendra.ku...@gmail.com> wrote: > > Hi, > > > > I have this code snippet for the bind implementation of a Monad: > > > > AsyncT m >>= f = AsyncT $

Re: Performance degradation when factoring out common code

2017-09-08 Thread Harendra Kumar
or some other ticket. -harendra On 8 September 2017 at 17:34, Harendra Kumar <harendra.ku...@gmail.com> wrote: > Thanks Mikolaj! I have seen some surprising behavior quite a few times > recently and I was wondering whether GHC should do better. In one case I > had to use SPECIALIZE ve

Re: Performance degradation when factoring out common code

2017-09-08 Thread Harendra Kumar
t; > ghc-options: -fexpose-all-unfoldings -fspecialise-aggressively > > to get most the GHC subtlety and shyness out of the way > when experimenting. > > Good luck > Mikolaj > > > > On Fri, Sep 8, 2017 at 11:21 AM, Harendra Kumar > <harendra.ku...@gm

Performance degradation when factoring out common code

2017-09-08 Thread Harendra Kumar
Hi, I have this code snippet for the bind implementation of a Monad: AsyncT m >>= f = AsyncT $ \_ stp yld -> let run x = (runAsyncT x) Nothing stp yld yield a _ Nothing = run $ f a yield a _ (Just r) = run $ f a <> (r >>= f) in m Nothing stp yield I

Re: Where to raise an issue for the stm library

2017-08-25 Thread Harendra Kumar
Thanks Ben! You rock! On 26 August 2017 at 09:15, Ben Gamari <b...@smart-cactus.org> wrote: > Harendra Kumar <harendra.ku...@gmail.com> writes: > > > Ok. So I got the bug tracker link from the hackage page which I missed > > earlier. It will be great if the sourc

Re: Where to raise an issue for the stm library

2017-08-25 Thread Harendra Kumar
BTW, this is the bug tracker link I got from the hackage https://ghc.haskell.org/trac/ghc/newticket?component=libraries%20%28other%29=stm . On 26 August 2017 at 00:45, Harendra Kumar <harendra.ku...@gmail.com> wrote: > Ok. So I got the bug tracker link from the hackage page which

Re: Where to raise an issue for the stm library

2017-08-25 Thread Harendra Kumar
tracker as well (e.g. for github repos). Also, it may be good to have it as libraries/stm instead of libraries/other in the ghc trac ticket page. -harendra On 26 August 2017 at 00:36, Harendra Kumar <harendra.ku...@gmail.com> wrote: > Can someone tell me where to raise an issue for the st

Where to raise an issue for the stm library

2017-08-25 Thread Harendra Kumar
Can someone tell me where to raise an issue for the stm library? The hackage link sends me here http://git.haskell.org/packages/stm.git. But this page provides no clue on raising issues. I wondered if GHC trac itself is used for this library. I saw some other libraries in the drop down list but

Re: GHC 8.2 generated code faster than 8.0 but slower than 7.10

2017-08-01 Thread Harendra Kumar
d explain carefully how to > reproduce your results? > > > > Surely 8.4 should be faster than 7.10! > > > > Simon > > > > *From:* ghc-devs [mailto:ghc-devs-boun...@haskell.org] *On Behalf Of *Harendra > Kumar > *Sent:* 01 August 2017 10:46 > *To:* ghc-devs@ha

GHC 8.2 generated code faster than 8.0 but slower than 7.10

2017-08-01 Thread Harendra Kumar
Unicode normalization library ( https://github.com/harendra-kumar/unicode-transforms) shows around 10% improvement with GHC 8.2.1 when compared to GHC 8.0.1, across most benchmarks. However, it is still somewhat slower when compared to GHC 7.10.3. Here are some results: GHC 7.10.3: benchmarking

Re: Building GHC reference manual?

2017-07-11 Thread Harendra Kumar
Its well documented here: https://ghc.haskell.org/trac/ghc/wiki/Building/Docs. -harendra On 11 July 2017 at 21:37, Iavor Diatchki wrote: > Hello, > > is it possible to build just the HTML for the GHC reference manual, > without building the whole of GHC, and if so how

Extensible records & mandatory/optional record fields

2017-02-14 Thread Harendra Kumar
In my application, I want some of the fields in a record to have default values while others must always be specified by the user. I can implement this using the rawr records library (http://hackage.haskell.org/package/rawr) like so: def :: ("b" := String) -> R ("a" := Int, "b" := String) def t

Lexical error in string continuation

2017-01-07 Thread Harendra Kumar
Hi devs, I am making a change in runghc on the ghc master branch. When compiling the following code (edited/new code in utils/runghc): 208 splitGhcNonGhcArgs :: [String] -> IO ([String], [String]) 209 splitGhcNonGhcArgs args = do 210let (ghc, other) = break notAFlag args 211when

Re: Competing with C in a simple loop

2016-12-23 Thread Harendra Kumar
On 23 December 2016 at 03:23, Christopher Done wrote: > > But if you scroll down the README to the 182kb file example, you see that > hexml takes 33us and xeno takes 111us. That's surprising to me because I'm > doing just a walk across a string and hexml is doing a full

Re: data families syntax

2016-11-13 Thread Harendra Kumar
'data family List :: * -> *' is actually already supported as an alternative. -harendra On 13 November 2016 at 16:10, Harendra Kumar <harendra.ku...@gmail.com> wrote: > I am curious about why the data families syntax was chosen to be the way > it is. For example a list can be def

data families syntax

2016-11-13 Thread Harendra Kumar
I am curious about why the data families syntax was chosen to be the way it is. For example a list can be defined as follows: data family List a data instance List Char = Empty | Cons Char (List Char) data instance List () = Count Int Instead why not define it as: data List :: * -> * data

Re: Improving GHC GC for latency-sensitive networked services

2016-10-18 Thread Harendra Kumar
It will be awesome if we can spread the GC work instead of stopping the world for too long. I am a new entrant to the Haskell world but something similar to this was the first real problem (other than lazy IO) that I faced with GHC. While I was debugging I had to learn how the GC works to really

Re: Notes from Ben's "contribute to ghc" discussion

2016-09-25 Thread Harendra Kumar
On 25 September 2016 at 12:48, Joachim Breitner wrote: > Hi, > > > It will be great to have something like that. Something that you > > figure out digging at ghc trac wiki pages, mailing lists, google > > search etc will be a few minutes job for a mentor. It may be a

Re: Notes from Ben's "contribute to ghc" discussion

2016-09-25 Thread Harendra Kumar
It will be great to have something like that. Something that you figure out digging at ghc trac wiki pages, mailing lists, google search etc will be a few minutes job for a mentor. It may be a bit taxing on the mentors but they can limit how many newbies they are mentoring and also breed new

Re: Errors when building users guide

2016-08-23 Thread Harendra Kumar
BUILD_DIRS)) This results in an inconsistent state of the doc targets being available but not the mkUserGuidePart rules. So even though I was able build the docs partially I was getting these errors. -harendra On 23 August 2016 at 22:31, Harendra Kumar <harendra.ku...@gmail.com> wrote: > &g

Re: Errors when building users guide

2016-08-23 Thread Harendra Kumar
Well, I tried 'make' and 'make all' (I suppose they are both same) but that did not make any difference. -harendra On 23 August 2016 at 21:37, Ben Gamari <b...@smart-cactus.org> wrote: > Harendra Kumar <harendra.ku...@gmail.com> writes: > > > I see errors like th

Errors when building users guide

2016-08-23 Thread Harendra Kumar
I see errors like this when using 'make html' in the topdir of the ghc repo: /vol/hosts/cueball/workspace/github/ghc/docs/users_guide/flags.rst:15: SEVERE: Problems with "include" directive path: InputError: [Errno 2] No such file or directory: 'docs/users_guide/flags-verbosity.gen.rst'.

Re: Style or bug in user manual?

2016-08-22 Thread Harendra Kumar
Thanks! I fixed it. On 22 August 2016 at 21:29, Ben Gamari <b...@smart-cactus.org> wrote: > Harendra Kumar <harendra.ku...@gmail.com> writes: > > > I was working to fix some documentation and noticed that the user manual > > lists options like this: > &

Style or bug in user manual?

2016-08-22 Thread Harendra Kumar
I was working to fix some documentation and noticed that the user manual lists options like this: -package⟨pkg⟩ Notice that there is no space between the argument and the option. Should this be fixed? All options on this page seem to be similarly formatted which makes me wonder whether its by

Using stringize and string concatenation in ghc preprocessing

2016-08-20 Thread Harendra Kumar
Hi, To reduce boilerplate code in an FFI implementation file I am trying to use the stringizing and string concatenation features of the C preprocessor. Since ghc passes '-traditional' to the preprocessor which disables these features I thought I can pass my own flags to the preprocessor like

Re: ghc command line arguments parsing

2016-08-19 Thread Harendra Kumar
On 19 August 2016 at 14:42, Sven Panne wrote: > > Hmmm, do we need '--ghc-args=' at all when we have '--' as the border > between the 2 "argument worlds"? Without thinking too much about it, :-} I > guess we don't. This would be consistent with how e.g. "stack exec" or >

Re: ghc command line arguments parsing

2016-08-19 Thread Harendra Kumar
On 19 August 2016 at 12:31, Sven Panne <svenpa...@gmail.com> wrote: > 2016-08-18 19:59 GMT+02:00 Harendra Kumar <harendra.ku...@gmail.com>: > >> [...] It only parses a flag which takes an argument. [...] >> > > o_O AFAICT, this is even more non-standard

Re: ghc command line arguments parsing

2016-08-18 Thread Harendra Kumar
On 18 August 2016 at 20:51, Sven Panne <svenpa...@gmail.com> wrote: > 2016-08-17 16:37 GMT+02:00 Harendra Kumar <harendra.ku...@gmail.com>: > >> ghc accepts a flag and its argument as a single quoted or escaped >> argument as well. For example all of the follo

ghc command line arguments parsing

2016-08-17 Thread Harendra Kumar
Hi, ghc accepts a flag and its argument as a single quoted or escaped argument as well. For example all of the following are equivalent: ghc -package foo ghc "-package foo" ghc -package\ foo Is this by design or accidental? This has a nice side effect to make passing ghc arguments via rughc

Behavior of GHC_PACKAGE_PATH

2016-08-16 Thread Harendra Kumar
Hi, As per the GHC manual (https://downloads.haskell. org/~ghc/master/users-guide/packages.html#the-ghc-package- path-environment-variable), packages which come earlier in the GHC_PACKAGE_PATH supersede the ones which come later. But that does not seem to be the case always. I am dealing with a

Re: CMM-to-ASM: Register allocation wierdness

2016-06-25 Thread Harendra Kumar
on ghc trac and raised two tickets: #12231 & #12232. Yay! I also added the code branch to reproduce this on github ( https://github.com/harendra-kumar/unicode-transforms/tree/ghc-trac-12231). -harendra ___ ghc-devs mailing list ghc-devs@haskell.org

Re: Force GC calls out of the straight line execution path

2016-06-17 Thread Harendra Kumar
On 17 June 2016 at 17:30, Ben Gamari wrote: > > > [1] https://phabricator.haskell.org/D2339 Awesome! -harendra ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Re: CMM-to-ASM: Register allocation wierdness

2016-06-17 Thread Harendra Kumar
ted CMM or the generation of CMM itself. > > > Very interesting, thanks for writing this down! Indeed if these checks > really are redundant then we should try to avoid them. Do you have any > code you could share that demosntrates this? > The gist that I provided in this email thread e

Re: CMM-to-ASM: Register allocation wierdness

2016-06-16 Thread Harendra Kumar
. That will be entirely free since it can be done at the llvm level. My point is that it will pay off in things like that if we invest in integrating llvm better. -harendra On 16 June 2016 at 16:48, Karel Gardas <karel.gar...@centrum.cz> wrote: > On 06/16/16 12:53 PM, Harendra Kumar wrote: > >> A

Re: CMM-to-ASM: Register allocation wierdness

2016-06-16 Thread Harendra Kumar
On 16 June 2016 at 13:59, Ben Gamari wrote: > > It actually came to my attention while researching this that the > -fregs-graph flag is currently silently ignored [2]. Unfortunately this > means you'll need to build a new compiler if you want to try using it. Yes I did try

Re: Force GC calls out of the straight line execution path

2016-06-13 Thread Harendra Kumar
ly? It's hard to tell if this is an easy case. > > Also, just to make sure, you're using -O, right? (I'm not sure if we have a > related transformation enabled with -O but just to make sure...) > > 2016-06-13 7:23 GMT-04:00 Harendra Kumar <harendra.ku...@gmail.com>: > > Hi, > > >

Force GC calls out of the straight line execution path

2016-06-13 Thread Harendra Kumar
Hi, I noticed in the generated code (llvm as well as native) that in some cases the GC calls are in the straight path and the regular code is out of the straight line path. Like this: => 0x408fc0: lea0x30(%r12),%rax => 0x408fc5: cmp0x358(%r13),%rax => 0x408fcc: jbe0x408fe9

Re: CMM-to-ASM: Register allocation wierdness

2016-06-13 Thread Harendra Kumar
with the 8.0.1 trace: https://gist.github.com/harendra-kumar/7d34c6745f604a15a872768e57cd2447 thanks, harendra On 13 June 2016 at 00:08, Harendra Kumar <harendra.ku...@gmail.com> wrote: > Hi, > > I am implementing unicode normalization in Haskell. I challenged myself to > mat

  1   2   >