Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    winterland
    @winterland1989
    I saw your patch, let me see why the test fail
    zypeh
    @zypeh:matrix.org
    [m]
    Is there any active Z-Haskell community other than gitterIM?
    Is there any Z-HTTP roadmap available? eg is it going to be compatible with WAI?
    winterland
    @winterland1989
    1) We're stilling in the community building stage so current gitterIM is probably the only place to communicate
    2) Yes, it's basically on the Github's project tab, it's probably not going to be compatible with WAI I'm afraid since we use new bytes type and UTF8 text.
    mu
    @4eUeP
    github issue/discussions can be considered as our community ( at least for now 😊
    zypeh
    @zypeh:matrix.org
    [m]
    😼 Got it
    zypeh
    @zypeh:matrix.org
    [m]
    @winterland1989:
    do you mind explain what is the INCOHERENT rule?
    and the INLINE [1] comparePrimVector, what does the [1] means?
    winterland
    @winterland1989
    A INCOHERENT instance is, somewhat like a OVERLAPPABLE instance
    It means this instances is not COHERENT with others, let's say the Hashable Bytes
    It's already covered by the Prim a, Hashable a => Hashable (PrimVector a) instance
    But we want explictly change its behaviour
    This is somehow dangerous since depending on some part of code's existence, a program may change its behaviour
    INLINE [1] here means don't INLINE this binding untile phase 1
    1 reply
    GHC has a simplifier featuring a count down simplifing phase, usaully 2, 1, 0. ..
    If we write INLINE without [1], the binding may disappear with its body instead, which makes RULEs useless
    zypeh
    @zypeh:matrix.org
    [m]
    so in my understanding, the INCHOHERENT ruleset is to override the implementation of the overlapping instances.
    winterland
    @winterland1989
    since RULEs work by matching bindings

    so in my understanding, the INCHOHERENT ruleset is to override the implementation of the overlapping instances.

    Yes, that's it

    I used to use RULEs to write Bytes specialized functions
    But by change Bytes's Hashable to FNV-1a, it becames different with default PrimVector's one
    so It's better to use INCHOHERENT to mark the behaviour
    zypeh
    @zypeh:matrix.org
    [m]
    Got it. Appreciate that
    winterland
    @winterland1989
    You're welcomed
    zypeh
    @zypeh:matrix.org
    [m]
    😅 and I was thinking of writing pure haskell in this case, so how do you decide when to use C ffi and when do you use pure haskell implementation.
    winterland
    @winterland1989
    GHC has a really awful code emitter, i'd like to see this loop get optimized at least
    1 reply
    zypeh
    @zypeh:matrix.org
    [m]
    I read a blogpost that stated usage of unsafePerformIO/unsafeDupable.. this kind of api is defeating GHC's optimisations.
    winterland
    @winterland1989
    1) the char* iter use native register
    2) the multiple use imul
    Which is mostly what you get from a decent C compiler
    I'm not sure if GHC could do what i want, maybe some benchmark could be useful here
    winterland
    @winterland1989
    hs_fnv_hash_addr:
    mov eax, edx
    test esi, esi
    je .L1
    mov esi, esi
    lea rcx, [rdi+rsi]
    .L3:
    add rdi, 1
    movzx edx, BYTE PTR [rdi-1]
    xor eax, edx
    imul eax, eax, 16777619
    cmp rdi, rcx
    jne .L3
    .L1:
    ret
    3 replies
    GCC allocate eax and edx for looping
    GHC probably will not do this
    zypeh
    @zypeh:matrix.org
    [m]
    I am new at GHC internal. 😅
    ah I will take a look
    winterland
    @winterland1989
    Yes, that will be very welcomed
    zypeh
    @zypeh:matrix.org
    [m]
    oh hi chen
    zypeh
    @zypeh:matrix.org
    [m]
    @winterland1989 now I only saw your tech sharing video https://www.bilibili.com/video/BV1VU4y1h7QG
    winterland
    @winterland1989
    our internal class is still on the way, maybe next week, the very first class should be uploaded
    winterland
    @winterland1989

    Dear Haskellers:

    After hundreds of days working. I'm happy to announce that the very first version of Z-Botan is published, It's a new crypto lib built around the versatile botan C++ crypto lib. Currently, all crypto stuff exported by Botan FFI is implemented, i.e.:

    • Random number generators.
    • Block Cipher and symmetric cipher.
    • Hash.
    • MAC.
    • Key derivation functions.
    • Password hash.
    • Constant time multiple precision integers.
    • Public key creation, import and export.
    • Public key encryption/decryption
    • Diffie-Hellman key exchange.
    • Signature generation & signature verification.
    • X.509 certificates & X.509 certificate revocation lists.
    • One time password.
    • AES Key Wrapping
    • Format Preserving Encryption.

    We will continue to polish this work, e.g. build TLS upon it. If you have any crypto usage, please give it a try. as usual, we wish you happy hacking!

    Cheers~
    Dong
    2021.05.11

    zypeh
    @zypeh:matrix.org
    [m]
    Do we plan to have our IO manager support the new linux's io_uring?
    winterland
    @winterland1989

    Do we plan to have our IO manager support the new linux's io_uring?

    I think it's best to leave it to libuv side instead of doing anything from Haskell part, see libuv/libuv#1947

    zypeh
    @zypeh:matrix.org
    [m]
    Is there anyone who are working on a z-websocket kind of project?
    think I might need it, so I create one and start learning the BIO interface
    zypeh
    @zypeh:matrix.org
    [m]
    Or instead, should I implement the websocket on the Z-HTTP repo?
    zypeh
    @zypeh:matrix.org
    [m]
    @winterland1989: for Z-HTTP, the connection pool, should I implement a ring buffer in Haskell or using libuv to maintain network connections?
    I am new to libuv so I am not sure which is the best implementation for a connection pool.
    winterland
    @winterland1989

    @winterland1989: for Z-HTTP, the connection pool, should I implement a ring buffer in Haskell or using libuv to maintain network connections?

    sorry for the delays, Z-IO provide a resource pool for that purpose

    @zypeh:matrix.org you could checkout the doc here https://hackage.haskell.org/package/Z-IO-0.8.1.0/docs/Z-IO-Resource.html#g:2
    to see if it fits your purpose