Re: Including libffi as a submodule

2017-09-26 Thread Ben Gamari
John Wiegley  writes:

>> "BG" == Ben Gamari  writes:
>
> BG> Note that under this scheme it will still be possible to link against the
> BG> system's libffi installation using ./configure's --enable-system-libffi
> BG> flag.
>
> Will distributions of GHC be using a system libffi which still has the bugs
> you mentioned?
>
My inclination would be to use the system libffi unless this option is
precluded due to bugs. By this standard I believe the only GHC HQ binary
distributions which would include an unreleased libffi would those for
ARM and AArch64.

Cheers,

- Ben


signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Including libffi as a submodule

2017-09-26 Thread Ben Gamari

Hello everyone,

As you may know, GHC carries a dependency on the libffi library. Libffi
is used on most platforms (notably not x86 and x86-64) for foreign
function invocation (see rts/Adjustor.c for details).

While libffi works well, it is unfortunately not particularly actively
maintained. In fact, it has been nearly three years since the last
official release. A lot can happen in three years and there is now at
least two bugs [1,2] present in the current release which makes it
impossible to build GHC in some configurations. These bugs have been
fixed upstream but these fixes are unreleased. Numerous attempts have
been made to get the libffi maintainers to cut a new release but sadly
no progress has been made in over six months of trying.

In light of this I propose that we begin treating libffi as a submodule
until a release is made. In particular, adding libffi as a submodule
will ease development on ARM and AArch64 (especially Apple) targets,
which have seen quite a bit of developer attention recently. Note that
under this scheme it will still be possible to link against the system's
libffi installation using ./configure's --enable-system-libffi flag.

Are there any strong objections to plan? If so please speak up.
If there is no objection by Saturday we will move ahead.

Cheers,

- Ben


[1] https://github.com/libffi/libffi/issues/191
[2] https://github.com/libffi/libffi/pull/263


signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: ghc-devs Digest, Vol 169, Issue 57

2017-09-26 Thread Michael Baikov
> I, too, have wished for the ability to have a separator in large number 
> literals.
>
> So a strong +1 from me.

more +1 here
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Review of CONTRIBUTORS.md

2017-09-26 Thread Ara Adkins
Hey Ben,

Looks good to me for the most part! I think that you should include a link to 
the Newcomers page [1] as a whole, even though it has some overlap with the 
quick start guide and you’ve included a link to the ‘Finding a Ticket’ 
subsection therein. 

I also think that a few more pointers on what is hoped for in a review (under 
‘Reviewing Patches’) could be helpful for those looking to get involved! Code 
review styles and expectations can vary greatly, so some more info here would 
be good. 

Best,
_ara

[1] https://ghc.haskell.org/trac/ghc/wiki/Newcomers

> On 26 Sep 2017, at 21:58, Ben Gamari  wrote:
> 
> Hello everyone,
> 
> Today I sat down and wrote a CONTRIBUTORS.md document for the ghc
> repository. This is recommended by GitHub to ensure that contributors
> can easily discover the first steps to contributing to the project.
> Moreover, it provided a nice blank slate to summarize the existing
> contributor documentation.
> 
> It would be greatly appreciated if you could give it [1] a read-through
> and leave your feedback.
> 
> Cheers,
> 
> - Ben
> 
> 
> [1] https://phabricator.haskell.org/D4037
>https://github.com/bgamari/ghc/blob/contributing/CONTRIBUTING.md
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Review of CONTRIBUTORS.md

2017-09-26 Thread Ben Gamari
Hello everyone,

Today I sat down and wrote a CONTRIBUTORS.md document for the ghc
repository. This is recommended by GitHub to ensure that contributors
can easily discover the first steps to contributing to the project.
Moreover, it provided a nice blank slate to summarize the existing
contributor documentation.

It would be greatly appreciated if you could give it [1] a read-through
and leave your feedback.

Cheers,

- Ben


[1] https://phabricator.haskell.org/D4037
https://github.com/bgamari/ghc/blob/contributing/CONTRIBUTING.md


signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: New primitive types?

2017-09-26 Thread Michal Terepeta
On Sun, Aug 27, 2017 at 7:49 PM Michal Terepeta 
wrote:

> > On Thu, Aug 3, 2017 at 2:28 AM Sylvain Henry  wrote:
> > Hi,
> >
> > I also think we should do this but it has a lot of ramifications:
> contant folding in Core, codegen, TH, etc.
> >
> > Also it will break codes that use primitive types directly, so maybe
> it's worth a ghc proposal.
>
> Ok, a short proposal sounds reasonable.
>

Just FYI: I've opened:
https://github.com/ghc-proposals/ghc-proposals/pull/74

Cheers,
Michal
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: RTS changes affect runtime when they shouldn’t

2017-09-26 Thread Ben Gamari
Bardur Arantsson  writes:

> I may be missing something since I have only quickly skimmed the thread,
> but...: Why not track all of these things and correlate them with
> individual runs? The Linux 'perf' tool can retrieve a *lot* of
> interesting numbers, esp. around cache hit rates, branch predicition hit
> rates, etc.
>
While it's not a bad idea, I think it's easy to drown in information. Of
course, it's also fairly easy to hide information that we don't care
about, so perhaps this is worth doing regardless.

Cheers,

- Ben


signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Underscore in binary literals

2017-09-26 Thread Takenobu Tani
Dear all,

Thank you very much for the response and kind explanation.
After studying, I will submit to ghc-proposals :)

Regards,
Takenobu



2017-09-26 22:56 GMT+09:00 Merijn Verstraaten :

> I, too, have wished for the ability to have a separator in large number
> literals.
>
> So a strong +1 from me.
>
> Cheers,
> Merijn
>
> > On 26 Sep 2017, at 15:43, Ben Gamari  wrote:
> >
> > Takenobu Tani  writes:
> >
> >> Hi Rahul,
> >>
> >> Thanks for the explanation.
> >> Hmm, Is not there much need...
> >>
> >> Thank you code example.
> >> I will also look at lexer for my study [1].
> >>
> > If you do want to try pursuing a language change do feel free to submit
> > a proposal [1]. I would also like the ability to break up large
> > literals. However, why limit it to BinaryLiterals? I would like the same
> > syntax for deciaml and hexadecimal literals as well.
> >
> > Cheers,
> >
> > - Ben
> >
> >
> > [1] https://github.com/ghc-proposals/ghc-proposals
> > ___
> > ghc-devs mailing list
> > ghc-devs@haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Underscore in binary literals

2017-09-26 Thread Merijn Verstraaten
I, too, have wished for the ability to have a separator in large number 
literals.

So a strong +1 from me.

Cheers,
Merijn

> On 26 Sep 2017, at 15:43, Ben Gamari  wrote:
> 
> Takenobu Tani  writes:
> 
>> Hi Rahul,
>> 
>> Thanks for the explanation.
>> Hmm, Is not there much need...
>> 
>> Thank you code example.
>> I will also look at lexer for my study [1].
>> 
> If you do want to try pursuing a language change do feel free to submit
> a proposal [1]. I would also like the ability to break up large
> literals. However, why limit it to BinaryLiterals? I would like the same
> syntax for deciaml and hexadecimal literals as well.
> 
> Cheers,
> 
> - Ben
> 
> 
> [1] https://github.com/ghc-proposals/ghc-proposals
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs



signature.asc
Description: Message signed with OpenPGP
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Underscore in binary literals

2017-09-26 Thread Ben Gamari
Takenobu Tani  writes:

> Hi Rahul,
>
> Thanks for the explanation.
> Hmm, Is not there much need...
>
> Thank you code example.
> I will also look at lexer for my study [1].
>
If you do want to try pursuing a language change do feel free to submit
a proposal [1]. I would also like the ability to break up large
literals. However, why limit it to BinaryLiterals? I would like the same
syntax for deciaml and hexadecimal literals as well.

Cheers,

- Ben


[1] https://github.com/ghc-proposals/ghc-proposals


signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Underscore in binary literals

2017-09-26 Thread Niklas Hambüchen
I'd find that quite useful for hex and binary.

It's useful for distinguishing e.g. 0x and 0xfff which when
confused accidentally and lead to big bugs.

Rust has exactly this feature for all numeric literals:

  https://rustbyexample.com/primitives/literals.html

On 26/09/17 14:40, Takenobu Tani wrote:
> GHC's BinaryLiterals extension is useful.
> (For example, x = 0b110111000101)
> 
> Is it difficult to include underscore(_) in the format like Verilog-HDL[1] ?
> (For example, x = 0b1101_1100_0101)
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Underscore in binary literals

2017-09-26 Thread Moritz Angermann
Hi,

I for one, would like to have this in more than just BinaryLiterals (which I 
find rather useful as well!)
I’d like to see `_` in any numeric literal being simply ignored, as I find it 
makes writing and reading
numbers in source code much easier.

let i =   1_000_000 :: Int
f =   1_123.456 :: Float
b = 0b1100_0011

And grouping (via underscore) might be very much domain specific. (One might 
want to denote magnitudes
or patterns.) I ended up writing a quite a bit of stupid boilerplate[1] to 
support readable binary
notation[2].

Cheers,
 Moritz
—
[1]: 
https://github.com/angerman/data-bitcode/blob/c9818debd3dae774967c0507882b6b3bec7f0ee4/test/BitcodeSpec.hs#L22-L83
[2]: 
https://github.com/angerman/data-bitcode/blob/c9818debd3dae774967c0507882b6b3bec7f0ee4/test/BitcodeSpec.hs#L146-L150

> On Sep 26, 2017, at 9:19 PM, Takenobu Tani  wrote:
> 
> Hi Rahul,
> 
> Thanks for the explanation.
> Hmm, Is not there much need...
> 
> Thank you code example.
> I will also look at lexer for my study [1].
> 
> [1]: https://phabricator.haskell.org/D22
> 
> Thank you :) ,
> Takenobu
> 
> 
> 2017-09-26 21:58 GMT+09:00 Rahul Muttineni :
> Implementation-wise, it's no so difficult to include - the lexer needs to be 
> tweaked. But it seems like a specialised use-case that will only affect a 
> minority of users is probably not worthwhile as an extension to the 
> language/compiler.
> 
> Maybe you can try using OverloadedStrings and implement this as a library?
> 
> ```
> newtype Binary = Binary Integer
>   deriving Num
> 
> instance IsString Binary where
>   fromString binaryLiteral = error "Code here to parse binary literal with 
> underscores"
> 
> binaryVal :: Binary
> binaryVal = "1101_1110_0101"
> ```
> 
> Hope that helps,
> Rahul
> 
> On Tue, Sep 26, 2017 at 8:40 AM, Takenobu Tani  wrote:
> Dear devs,
> 
> GHC's BinaryLiterals extension is useful.
> (For example, x = 0b110111000101)
> 
> Is it difficult to include underscore(_) in the format like Verilog-HDL[1] ?
> (For example, x = 0b1101_1100_0101)
> 
> [1]: https://inst.eecs.berkeley.edu/~cs150/fa06/Labs/verilog-ieee.pdf#page=20
> 
> Regards,
> Takenobu
> 
> 
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> 
> 
> 
> 
> -- 
> Rahul Muttineni
> 
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

— 
Moritz Angermann
+49 170 54 33 0 74
mor...@lichtzwerge.de

lichtzwerge GmbH
Raiffeisenstr. 8
93185 Michelsneukirchen

Amtsgericht Regensburg HRB 14723
Geschäftsführung: Moritz Angermann, Ralf Sangl
USt-Id: DE291948767

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail
ist nicht gestattet.
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the material in
this e-mail is strictly forbidden.

___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Underscore in binary literals

2017-09-26 Thread Takenobu Tani
Hi Rahul,

Thanks for the explanation.
Hmm, Is not there much need...

Thank you code example.
I will also look at lexer for my study [1].

[1]: https://phabricator.haskell.org/D22

Thank you :) ,
Takenobu


2017-09-26 21:58 GMT+09:00 Rahul Muttineni :

> Implementation-wise, it's no so difficult to include - the lexer needs to
> be tweaked. But it seems like a specialised use-case that will only affect
> a minority of users is probably not worthwhile as an extension to the
> language/compiler.
>
> Maybe you can try using OverloadedStrings and implement this as a library?
>
> ```
> newtype Binary = Binary Integer
>   deriving Num
>
> instance IsString Binary where
>   fromString binaryLiteral = error "Code here to parse binary literal with
> underscores"
>
> binaryVal :: Binary
> binaryVal = "1101_1110_0101"
> ```
>
> Hope that helps,
> Rahul
>
> On Tue, Sep 26, 2017 at 8:40 AM, Takenobu Tani 
> wrote:
>
>> Dear devs,
>>
>> GHC's BinaryLiterals extension is useful.
>> (For example, x = 0b110111000101)
>>
>> Is it difficult to include underscore(_) in the format like
>> Verilog-HDL[1] ?
>> (For example, x = 0b1101_1100_0101)
>>
>> [1]: https://inst.eecs.berkeley.edu/~cs150/fa06/Labs/verilog-ieee
>> .pdf#page=20
>>
>> Regards,
>> Takenobu
>>
>>
>> ___
>> ghc-devs mailing list
>> ghc-devs@haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>>
>>
>
>
> --
> Rahul Muttineni
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Underscore in binary literals

2017-09-26 Thread Rahul Muttineni
Implementation-wise, it's no so difficult to include - the lexer needs to
be tweaked. But it seems like a specialised use-case that will only affect
a minority of users is probably not worthwhile as an extension to the
language/compiler.

Maybe you can try using OverloadedStrings and implement this as a library?

```
newtype Binary = Binary Integer
  deriving Num

instance IsString Binary where
  fromString binaryLiteral = error "Code here to parse binary literal with
underscores"

binaryVal :: Binary
binaryVal = "1101_1110_0101"
```

Hope that helps,
Rahul

On Tue, Sep 26, 2017 at 8:40 AM, Takenobu Tani 
wrote:

> Dear devs,
>
> GHC's BinaryLiterals extension is useful.
> (For example, x = 0b110111000101)
>
> Is it difficult to include underscore(_) in the format like Verilog-HDL[1]
> ?
> (For example, x = 0b1101_1100_0101)
>
> [1]: https://inst.eecs.berkeley.edu/~cs150/fa06/Labs/verilog-
> ieee.pdf#page=20
>
> Regards,
> Takenobu
>
>
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
>


-- 
Rahul Muttineni
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Underscore in binary literals

2017-09-26 Thread Takenobu Tani
Dear devs,

GHC's BinaryLiterals extension is useful.
(For example, x = 0b110111000101)

Is it difficult to include underscore(_) in the format like Verilog-HDL[1] ?
(For example, x = 0b1101_1100_0101)

[1]:
https://inst.eecs.berkeley.edu/~cs150/fa06/Labs/verilog-ieee.pdf#page=20

Regards,
Takenobu
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs