Re-compiling wired-in packages

2017-04-24 Thread Shao Cheng
sentations? Thank a lot. Cheers, Shao Cheng ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Re: Extracting representation from GHC

2018-01-19 Thread Shao Cheng
Hi, IIRC you can already use hscFrontendHook in the DynFlags hooks to retrieve TcGblEnv, and with a little bit of work, also HsParsedModule. Regards, Shao Cheng On Fri, Jan 19, 2018, 5:41 PM Matthew Pickering <matthewtpicker...@gmail.com> wrote: > I have too wanted this in the past

Re: Non-Reinstallable packages

2018-08-06 Thread Shao, Cheng
Hi, IIRC those packages can be "reinstalled", just build & register into a fresh package database and add it to the pkgdb stack, ghc can shadow the ones in the global pkgdb. Regards, Shao Cheng On Tue, Aug 7, 2018 at 10:39 AM, Moritz Angermann wrote: > Dear friends, > &g

cc1plus.exe of bundled mingw-w64 segfaults

2018-09-02 Thread Shao, Cheng
when configuring ghc? I notice there's an "--enable-distro-toolchain" flag, does it work with building a bindist? Thank you. Regards, Shao Cheng ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Custom ghcPrimIface for cross-compilation?

2018-03-15 Thread Shao Cheng
Hi all, is it possible for a 64-bit ghc to emit 32-bit code, if I supply a custom ghcPrimIface via Hooks and also modify the platform flags in DynFlags? The module does not import Prelude and has no dependencies other than GHC.Prim. ___ ghc-devs mailing

Re: Windows

2018-03-26 Thread Shao, Cheng
> > > Are you saying that I should run “C:\msys64\msys2_shell.cmd -mingw64 > -mintty" just once, after installing? Or repeatedly? Or that I should > somehow us it as my main shell? And what does that commend actually do? > > Sorry to be dense > > > > Simon

Re: Windows

2018-03-26 Thread Shao, Cheng
Hi Simon, If the build environment is managed by an MSYS2 installation, then the MinGW64 shell startup script automatically sets up "MSYSTEM" for you. It can be launched like "C:\msys64\msys2_shell.cmd -mingw64 -mintty". On Mon, Mar 26, 2018 at 5:46 PM, Simon Peyton Jones via ghc-devs <

Re: Proposal: Professionalizing GHC Development

2018-04-01 Thread Shao, Cheng
Compiling GHC on a blockchain may not be economical, but running GHC-compiled programs on a blockchain is definitely a great idea! I've even come up with a paper title: A Secure Decentralized Transactional Implementation of Spinless Tagless G-machine, aka Haskoin! Time to recruiting a few

Is "cml_cont" of CmmCall used in practice?

2018-03-17 Thread Shao, Cheng
Hi all, Is the "cml_cont" field of the CmmCall variant is really used in practice? I traversed the output of raw Cmm produced by ghc compiling the whole base package, but the value of cml_cont is always Nothing. Regards, Shao Cheng ___ ghc-de

Re: Does it sound a good idea to implement "backend plugins"?

2018-10-04 Thread Shao, Cheng
ks via a pile of hacks upon hacks in ghc-toolkit, and it's not good for reuse. * The newly added backend plugins shouldn't have visible correctness/performance impact if they're not used, and it's just a few local modifications in the ghc codebase. > On Thu, Oct 4, 2018 at 3:56 PM Shao, Che

Re: Does it sound a good idea to implement "backend plugins"?

2018-10-04 Thread Shao, Cheng
o be a home plugin to be compiled and used on the fly. A typical use case would be compiling/installing the plugin to a standalone pkgdb, then used to compile other packages. > > On 5 Oct 2018, at 1:52 AM, Shao, Cheng wrote: > > Adding "pluggable backends" to spin up ne

Does it sound a good idea to implement "backend plugins"?

2018-10-04 Thread Shao, Cheng
ure. Best, Shao Cheng ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Re: cc1plus.exe of bundled mingw-w64 segfaults

2018-09-02 Thread Shao, Cheng
, or something else has gone wrong? Thank you. __ On Sun, Sep 2, 2018 at 10:06 PM, Shao, Cheng wrote: > Hi folks, > > I'm building a Haskell/C++ hybrid project with a recent revision of > ghc on Windows, and noticed that cc1plus.exe always segfaults. The > same code builds fine on A

Re: MutVar# and GC

2019-01-17 Thread Shao, Cheng
Hi, I believe it's mentioned here: https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/GC/RememberedSets Regards, Shao Cheng On Fri, Jan 18, 2019, 12:34 PM chessai . wrote: > Ryan, > > That makes perfect sense, thanks. Is that documented explicitly anywhere? > If n

Re: GHC (API?) question: GHC Core for Base libraries

2018-12-04 Thread Shao, Cheng
Indeed, the boot.sh script is likely what you are looking for. To compile `base` and retrieve Core for it, you just need to set up an empty package database, use the Setup.hs script in base to compile it, and load your plugin via "--ghc-option=.." provided to `Setup configure`. On Wed, Dec 5, 2018

Re: GHC (API?) question: GHC Core for Base libraries

2018-12-03 Thread Shao, Cheng
Hi, Joachim Breitner's veggies(https://github.com/nomeata/veggies) project is a good example of using a vanilla ghc installation to compile standard libraries like base. On Tue, Dec 4, 2018, 10:11 AM Bill Hallahan wrote: > Hi, > > I'm writing a program analyzer that operates on GHC Core.

Cmm code of `id` function referring to `breakpoint`?

2019-02-05 Thread Shao, Cheng
upd: 8; } base_GHCziBase_breakpoint_entry() // [R2] { [] } {offset chvW: // global R1 = R2; call stg_ap_0_fast(R1) args: 8, res: 0, upd: 8; } ``` This looks suspicious. I'm curious if this is intended behavior of ghc. Regards, Shao

Blocking MVar# primops not performing stack checks?

2020-02-26 Thread Shao, Cheng
Hi all, When an MVar# primop blocks, it jumps to a function in HeapStackCheck.cmm which pushes a RET_SMALL stack frame before returning to the scheduler (e.g. the takeMVar# primop jumps to stg_block_takemvar for stack adjustment). But these functions directly bump Sp without checking for possible

Re: How to turn LHExpr GhcPs into CoreExpr

2020-01-23 Thread Shao, Cheng
How about using `hscCompileCoreExprHook` to intercept the `CoreExpr` from the ghci pipeline? There exist GHC API to evaluate a String to a ForeignHValue iirc; we are not interested in the final ForeignHValue in this case, we just want the CoreExpr, and the logic of generating and linking BCO can

Re: How to use the compact regions API to write a compact to a file?

2020-05-22 Thread Shao, Cheng
Hi Matthew, It's possible to use Data.Compact.Serialize to write a compact to a file or read it back. Directly serializing via ByteStrings has also been discussed before, see link below. Hope this helps! https://hackage.haskell.org/package/compact https://github.com/ezyang/compact/issues/3 On