home.social

#ghc — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #ghc, aggregated by home.social.

  1. Saw someone at work referred to GitHub Copilot as "GHC" and I want to cry

    #haskell #ghc

  2. Might #GHC 9.14 be the first release that does not break anything (except for bounds bumps)? If you find anything, report it here:

    discourse.haskell.org/t/was-an

    #haskell

  3. "Compiler and runtime support for continuation marks" (PLDI 2020) dl.acm.org/doi/10.1145/3385412
    "Continuation marks enable dynamic binding and context inspection in a language with proper handling of tail calls and first-class, multi-prompt, delimited continuations."

    GHC proposal: "scoped thread-locals" github.com/ghc-proposals/ghc-p
    "efficient storage and lookup for immutable context
    attached to the current Haskell thread, which is inherited by child threads."

    #Haskell #ghc

  4. Packages like `text` reach into the unstable bowels of #GHC to avoid allocating intermediate structures when reading IO.

    But it is possible to do fusible lazy IO:

    ```
    produce :: IO [Char]
    produce = IO $ \s0 ->
    (# s0 , build $ \c n ->
    let go s = case runIO getChar s of
    (# s' , x #) -> c x (go s')
    in go s0
    #)
    ```

    Perhaps GHC could expose something like that and the text package could use it.

    #haskell

  5. TIL #GHC already has some functionality in place to check that a function is only used at a monomorphic type. Currently, I think it is only used for `tagToEnum#` but it would be useful to properly integrate it into the type system.

    #haskell

  6. An new proposal for passing implicit parameters to #Haskell functions: github.com/ghc-proposals/ghc-p

    Done the right way; as opposed to the existing ImplicitParams extension, which is practically useless.

    #GHC

  7. #Haskell New Year Resolutions
    discourse.haskell.org/t/haskel

    These are very useful advices!

    I learnt:
    - Generically and DerivingVia
    - StarIsType
    - DuplicateRecordFields, NoFieldSelectors, and OverloadedRecordDot

    I must admits that there are just too many extensions in #GHC...

    #NewYearResolution #newyear2026 #FP #Programming

  8. niklas-heer/speed-comparison: A repo which compares the speed of different programming languages.
    github.com/niklas-heer/speed-c

    This projects tries to compare the speed of different #programming languages. It uses an implementation of the Leibniz formula for π to do the comparison.

    Notably:
    - #Julia is the only dynamically-typed languages amoung the top tier, only ~28ms slower from #Cpp (#Clang).
    - #Rust got a huge boost with nightly compiler (it is said that hand-written SIMD is used?)
    - #Go tops in 3rd tier (very crowded 0.8s~1s)
    - #PyPy and #Haskell (#GHC) are very closed (~1s), preceding #Racket, beating #Python (#NumPy) by a lot (~1.2s)
    - The slowest is #CPython (~86s)

    #Math #ScientificComputing

  9. PSA: When using the #GHC API, the `setSessionDynFlags` function will modify the DynFlags, so be sure to discard the old DynFlags and use `getSessionDynFlags` if you need them again later.

    Thanks to Rodrigo Mesquita for helping me figure this out!

    #haskell

  10. While declaring peace and justice advocates are terrorist organizations, while outlawing international law authority of the United Nations, US profiteers’ recruitment increases to expand their presence in Gaza for trapping Palestinians next month. Happy Christmas. Great reporting from DropSite News.
    #Gaza #UGSolutions #NorthCarolina #GHC #CAIR

    open.substack.com/pub/dropsite

  11. PSA: RequiredTypeArguments, introduced in the upcoming #ghc 9.14 interacts strangely with ScopedTypeVariables. Can you guess what this program prints?

    data A s where
    A :: forall (s :: Symbol) -> KnownSymbol s => A "bar"

    instance Show (A s) where
    show (A s) = symbolVal (Proxy @s)

    main = print (A "foo")

    #haskell

  12. TIL: parallel sparks can take up to 20 ms to be scheduled, so you should not use them for small computations.

    gitlab.haskell.org/ghc/ghc/-/i

    #haskell #ghc