Skip to content

Using strict language extension #412

Description

@kazu-yamamoto

In my opinion, network programming in Haskell should use strict evaluation except atomicModifiyIORef', to avoid space leak. Strict and StrictData language extension are introduced in GHC 8.0 and it's days of GHC 8.6. So, it's good time to introduce them to network.

For this purpose, all undefined should be removed. It's very easy. But during this work, I experienced that undefined are evaluated even if they are removed from the source code. The reason is here: https://gitlab.haskell.org/ghc/ghc/issues/16810

When such inlinable functions are fixed in GHC 8.8, I would like to add the following to network.cabal:

  if impl(ghc >= 8.8)
      Default-Extensions:  Strict StrictData

Activity

  1. eborden commented on Jun 13, 2019

    @eborden
    Collaborator

    We should probably formulate some realistic benchmarks before introducing a change of this nature.

  2. kazu-yamamoto commented on Jun 14, 2019

    @kazu-yamamoto
    CollaboratorAuthor

    SPJ helped me to understand what's going on. This is not a bug of base. We can use these extensions for all versions of GHC 8 now.

    https://github.com/kazu-yamamoto/network/tree/strict

  3. added this to the 2019 Q4 Release milestone on Jun 20, 2019
  4. kazu-yamamoto commented on Jun 21, 2019

    @kazu-yamamoto
    CollaboratorAuthor

    warp, warp-tls, auto-update, wai-app-file-cgi and mighttpd2 have been released with Strict and StrictData enabled by default.

  5. kazu-yamamoto commented on Jun 21, 2019

    @kazu-yamamoto
    CollaboratorAuthor

    I should explain this. The purpose of this PR is to let us convinced that space leaks are not due to lazy evaluation when they occurs. This PR might not improve heap profiling but would save our souls very much. I'm very tired from finding sources of space leaks due to lazy evaluation for last 10 years.

  6. removed this from the 2019 Q4 Release milestone on May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions