Skip to content
By using Twitter’s services you agree to our Cookies Use. We and our partners operate globally and use cookies, including for analytics, personalisation, and ads.
  • Home Home Home, current page.
  • About

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @
  • Language: English
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English UK
    • Español
    • Filipino
    • Français
    • Hrvatski
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Ελληνικά
    • Български език
    • Русский
    • Српски
    • Українська мова
    • עִבְרִית
    • العربية
    • فارسی
    • मराठी
    • हिन्दी
    • বাংলা
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • Have an account? Log in
    Have an account?
    · Forgot password?

    New to Twitter?
    Sign up
withoutboats's profile
without butts, dreams dry up
without butts, dreams dry up
without butts, dreams dry up
@withoutboats

Tweets

without butts, dreams dry up

@withoutboats

we carry a new world here, in our hearts

Joined March 2015

Tweets

  • © 2018 Twitter
  • About
  • Help Center
  • Terms
  • Privacy policy
  • Cookies
  • Ads info
Dismiss
Previous
Next

Go to a person's profile

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @

Promote this Tweet

Block

  • Tweet with a location

    You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more

    Your lists

    Create a new list


    Under 100 characters, optional

    Privacy

    Copy link to Tweet

    Embed this Tweet

    Embed this Video

    Add this Tweet to your website by copying the code below. Learn more

    Add this video to your website by copying the code below. Learn more

    Hmm, there was a problem reaching the server.

    By embedding Twitter content in your website or app, you are agreeing to the Twitter Developer Agreement and Developer Policy.

    Preview

    Why you're seeing this ad

    Log in to Twitter

    · Forgot password?
    Don't have an account? Sign up »

    Sign up for Twitter

    Not on Twitter? Sign up, tune into the things you care about, and get updates as they happen.

    Sign up
    Have an account? Log in »

    Two-way (sending and receiving) short codes:

    Country Code For customers of
    United States 40404 (any)
    Canada 21212 (any)
    United Kingdom 86444 Vodafone, Orange, 3, O2
    Brazil 40404 Nextel, TIM
    Haiti 40404 Digicel, Voila
    Ireland 51210 Vodafone, O2
    India 53000 Bharti Airtel, Videocon, Reliance
    Indonesia 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    Italy 4880804 Wind
    3424486444 Vodafone
    » See SMS short codes for other countries

    Confirmation

     

    Welcome home!

    This timeline is where you’ll spend most of your time, getting instant updates about what matters to you.

    Tweets not working for you?

    Hover over the profile pic and click the Following button to unfollow any account.

    Say a lot with a little

    When you see a Tweet you love, tap the heart — it lets the person who wrote it know you shared the love.

    Spread the word

    The fastest way to share someone else’s Tweet with your followers is with a Retweet. Tap the icon to send it instantly.

    Join the conversation

    Add your thoughts about any Tweet with a Reply. Find a topic you’re passionate about, and jump right in.

    Learn the latest

    Get instant insight into what people are talking about now.

    Get more of what you love

    Follow more accounts to get instant updates about topics you care about.

    Find what's happening

    See the latest conversations about any topic instantly.

    Never miss a Moment

    Catch up instantly on the best stories happening as they unfold.

    without butts, dreams dry up‏ @withoutboats Aug 9

    MONADS AND RUST A THREAD - or - why async/await instead of do notation

    4:45 PM - 9 Aug 2018
    • 93 Retweets
    • 298 Likes
    • Mike Potanin Chase Rubén Durá Tarí GURPREET SINGH🦁 simple complex Lie algebra Darsstar vacationing, longly, quite comfortably Michael Snoyman Luke Wiklendt
    7 replies 93 retweets 298 likes
      1. New conversation
      2. without butts, dreams dry up‏ @withoutboats Aug 9

        Let's start with borrowing across yield points. We've solved this problem for real yield points with pin, I have no idea how to solve it using a function interface like >>=

        2 replies 4 retweets 19 likes
        Show this thread
      3. without butts, dreams dry up‏ @withoutboats Aug 9

        So that means borrows across statements in do notation are just out of the picture. That's extremely limiting.

        2 replies 3 retweets 15 likes
        Show this thread
      4. without butts, dreams dry up‏ @withoutboats Aug 9

        Rust's imperative control flow statements like `return` and `break` inside of do notation also doesn't make sense, because we do not have TCP preserving closures.

        3 replies 3 retweets 15 likes
        Show this thread
      5. without butts, dreams dry up‏ @withoutboats Aug 9

        So we only know how to have do notation without early return or borrowing. People say this is an open research question, but IMO its just not possible within our runtime constraints.

        2 replies 3 retweets 13 likes
        Show this thread
      6. without butts, dreams dry up‏ @withoutboats Aug 9

        Getting beyond that, this is assuming that "future" implements "monad," so if we could just add HKT to have a Monad trait, everything would be hunkydory. That's not true!

        1 reply 6 retweets 15 likes
        Show this thread
      7. without butts, dreams dry up‏ @withoutboats Aug 9

        the signature of >>= is `m a -> (a -> m b) -> m b` the signature of Future::and_then is roughly `m a -> (a -> m b) -> AndThen (m a) b`

        2 replies 3 retweets 20 likes
        Show this thread
      8. without butts, dreams dry up‏ @withoutboats Aug 9

        That is, in order to reify the state machine of their control flow for optimization, both Future and Iterator return a new type from their >>= op, not "Self<U>"

        2 replies 3 retweets 14 likes
        Show this thread
      9. without butts, dreams dry up‏ @withoutboats Aug 9

        Also, our functions are not a `->` type constructor; they come in 3 different flavors, and many of our monads use different ones (FnOnce vs FnMut vs Fn).

        2 replies 3 retweets 19 likes
        Show this thread
      10. without butts, dreams dry up‏ @withoutboats Aug 9

        Okay, so Monad can't abstract over Future, but still let's have Monad. Problem: we don't have higher kinded polymorphism, and probably never will.

        1 reply 3 retweets 17 likes
        Show this thread
      11. without butts, dreams dry up‏ @withoutboats Aug 9

        The problem is that without currying at the type level, higher kinded polymorphism makes type inference trivially undecidable. We have no currying.

        2 replies 4 retweets 16 likes
        Show this thread
      12. without butts, dreams dry up‏ @withoutboats Aug 9

        In order to add higher kinded polymorphism, we'd have to restrict the sorts of types you could use in a way that would feel very arbitrary to users.

        1 reply 3 retweets 13 likes
        Show this thread
      13. without butts, dreams dry up‏ @withoutboats Aug 9

        In contrast, generic associated types don't have this problem, and directly solve the expressiveness problems we do have, like Iterable (abstracting over everything with a `.iter(&self)` method)

        1 reply 3 retweets 18 likes
        Show this thread
      14. without butts, dreams dry up‏ @withoutboats Aug 9

        (Don't get me wrong, you can write something to abstract over some monads like Option and Result using generic associated types. But its much less ergonomic than Monad in Haskell, even for those).

        1 reply 3 retweets 16 likes
        Show this thread
      15. without butts, dreams dry up‏ @withoutboats Aug 9

        IN CONCLUSION: a design that works in a pure FP which lazily evaluates and boxes everything by default doesn't necessarily work in an eager imperative language with no runtime.

        5 replies 18 retweets 99 likes
        Show this thread
      16. without butts, dreams dry up‏ @withoutboats Aug 9

        This comes up a lot, please link this thread liberally.

        3 replies 5 retweets 53 likes
        Show this thread
      17. End of conversation
      1. New conversation
      2. Momcubus (she/her)‏ @FairlyLip Aug 9
        Replying to @withoutboats

        oh wait, this is programming, not gnosticism, okay, was confused for a little bit

        1 reply 1 retweet 7 likes
      3. without butts, dreams dry up‏ @withoutboats Aug 9
        Replying to @FairlyLip

        i was too but now im stuck send help!

        0 replies 0 retweets 5 likes
      4. End of conversation
      1. Who ordered *that*?‏ @ManishEarth Aug 9
        Replying to @withoutboats

        thank you so much for this 💛💛

        0 replies 0 retweets 14 likes
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo
      1. New conversation
      2. Alex Nedelcu‏ @alexelcu Aug 21
        Replying to @withoutboats

        An informative thread. Would be cool to know more about it and I don't think Twitter is OK for such explanations; would be nice if Rust had like official documents explaining such decisions at length that you could point to.

        1 reply 0 retweets 5 likes
      3. Alex Nedelcu‏ @alexelcu Aug 21
        Replying to @alexelcu @withoutboats

        For example I might misunderstand the need for type currying. I know that types of multiple type parameters wouldn't work well with Monad, which has a single type parameter, but you can usually work around it (type aliases?) and most types have a single type parameter anyway.

        2 replies 0 retweets 0 likes
      4. Alex Nedelcu‏ @alexelcu Aug 21
        Replying to @alexelcu @withoutboats

        Borrowing might be the deal breaker. I only started playing with Rust, so I don't understand how "bind" is incompatible with borrowing. I'm sure you're right, but it would be cool to see it in a longer form of communication.

        1 reply 0 retweets 1 like
      5. Alex Nedelcu‏ @alexelcu Aug 21
        Replying to @alexelcu @withoutboats

        Also, I'm sorry for your trouble, I'm not defending your critics, but programming languages have a history of ignorance, which makes such explanations desirable; see for example JavaScript's Promise:https://github.com/promises-aplus/promises-spec/issues/94 …

        0 replies 0 retweets 2 likes
      6. End of conversation

    Loading seems to be taking a while.

    Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

      Promoted Tweet

      false

      • © 2018 Twitter
      • About
      • Help Center
      • Terms
      • Privacy policy
      • Cookies
      • Ads info