Steps to propose a new primop in GHC

Mitsutoshi Aoe maoe at foldr.in
Mon May 28 07:23:44 UTC 2018


Hi devs,

I'm thinking to add a primop in GHC but not sure how I should proceed. The
primop I have in mind is something like:

  traceEventBinary# :: Addr# -> Int# -> State# s -> State# s

This function is similar to the existing traceEvent# but it takes a chunk
of bytes rather than a null-terminated string. It is useful to trace custom
user events (e.g. network packet arrival timestamps in an network
application) in eventlogs. At library level, it is supposed to be used like
the tracing functions in Debug.Trace but with ByteString argument:

  traceEventBinary :: ByteString -> a -> a
  traceEventBinaryIO :: ByteString -> IO ()

Note that this can't live in base because of the dependency on bytestring.

So how should I proceed from here? Am I supposed to submit a GHC proposal
or should I ask on the libraries list? This is not a prominently visible
change in GHC. It rather affects only ghc-prim and no effects in base.

Thanks,
Mitsutoshi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20180528/23d264a0/attachment.html>


More information about the ghc-devs mailing list