• nipafx Profile Picture

    Nicolai Parlog 🇺🇦🕊️ @nipafx

    5 years ago

    Do you dream of "value types" in Java? So do I! Hence I was thrilled to see that Project Valhalla is slowly coming out of exploration with two draft JEPs. Here's what they currently propose. 🧵👇🏾 (If you prefer video: https:/www.youtube.com/watch?v=WBvTilbh8S0&t=344s) 1/10

    3 24 85 0 8
  • nipafx Profile Picture

    Nicolai Parlog 🇺🇦🕊️ @nipafx

    5 years ago

    First, why value types? To bridge the divide between * primitives (fast, no memory overhead) and * reference types (abstraction, safety, identity) As is, we sometimes have to choose between performance and design. And we often choose wrongly. 2/10

    1 2 4 0 0
  • nipafx Profile Picture

    Nicolai Parlog 🇺🇦🕊️ @nipafx

    5 years ago

    Draft JEP openjdk.java.net/jeps/8251554 proposes new terminology and JVM rules: 1. Interface `IdentityObject` (the boring part): * for reference types * called "identity classes" * instances are "identity objects" For identity classes / reference types everything stays as is. 3/10

    1 1 3 0 0
  • nipafx Profile Picture

    Nicolai Parlog 🇺🇦🕊️ @nipafx

    5 years ago

    2. Interface `PrimitiveObject` (the exciting part): * for a new kind of type * called "primitive classes" * instances are "primitive objects" "JVMs may freely duplicate and re-encode them in an effort to improve computation time, memory footprint, and garbage collection" 4/10

    1 1 5 0 0
  • nipafx Profile Picture

    Nicolai Parlog 🇺🇦🕊️ @nipafx

    5 years ago

    Primitive classes want to make good on Valhalla's promise: "Codes like a class, works like an int." See strawman code attached. Details: * class and fields are implicitly final * no circular dependency on itself * no synchronized methods * more in the JEP 5/10

    nipafx tweet picture

    1 2 5 0 0
    Download Image
  • nipafx Profile Picture

    Nicolai Parlog 🇺🇦🕊️ @nipafx

    5 years ago

    A bit more terminology on primitive classes: * `Point p` is a "primitive value" * `Point.ref p` is a "primitive reference" Primitive values will be like today's primitives (no `null`, no memory indirection/overhead), primitive references like their wrapper types. 6/10

    nipafx tweet picture

    2 2 6 0 0
    Download Image
  • nipafx Profile Picture

    Nicolai Parlog 🇺🇦🕊️ @nipafx

    5 years ago

    But this doesn't cleanly map to today's situation because if `Integer` were a primitive class, `Integer i` would be a non-nullable primitive value and `Integer.ref i` the primitive reference. To fix that mismatch, the JEP proposes "reference-favoring primitive classes"… 7/10

    1 1 3 0 0
  • Albozdroid Profile Picture

    Alboz @Albozdroid

    5 years ago

    @nipafx This feels better and more natural than what comes in the next tweet.

    1 0 0 0 0
  • Download Image
    • Privacy
    • Term and Conditions
    • About
    • Contact Us
    • TwStalker is not affiliated with X™. All Rights Reserved. 2024 www.instalker.org

    twitter web viewer x profile viewer bayigram.com instagram takipçi satın al instagram takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al sosyalgram takipçi satın al instagram ücretsiz takipçi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al metin2 metin2 wiki metin2 ep metin2 dragon coins metin2 forum metin2 board popigram instagram takipçi satın al takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al buyfans buy instagram followers buy instagram likes buy instagram views buy tiktok followers buy tiktok likes buy tiktok views buy twitter followers buy telegram members Buy Youtube Subscribers Buy Youtube Views Buy Youtube Likes forstalk postegro web postegro x profile viewer