#rust-lang

/

      • est31
        that's why I said either pretty scary or pretty cool
      • _nox
        Yeah, and I meant to say I definitely don't find that cool at all.
      • est31
        legitimate view
      • I'm no fan of the entire EBCB thing
      • "is" that doesnt bind is great
      • as well as if guards on if
      • that would cover like 90% of use cases, be simple, and not require super complicated rules
      • _nox
        EBCB?
      • "is" is matches!, why not just use matches!?
      • korczis has quit
      • est31
        BCEC I mean
      • _nox
        BCEC?
      • est31
        Binding Creation in Expression Context
      • _nox
        Where?
      • est31
        I've made up that term to describe the proposed concepts
      • _nox
        Oh in the RFC with the weird indent style.
      • est31
      • either EXPR is Some(v) && v > 10
      • _nox
        This looks like saccharine.
      • est31
        or let Some(v) = EXPR && v > 10
      • _nox
        TBH I would be pretty pissed off to see this merged while let else was rejected.
      • AstralSorcerer joined the channel
      • est31
        _nox: yeah it is a quite sugary debate we have
      • Muhannad has quit
      • _nox
        Especially when the argument against let else was "just use match".
      • rkruppe
        I've given up on the thread because there's like ten different proposals floating around
      • Including several that are only tangentially related
      • est31
        I could live without any of this stuff merged
      • rkruppe
        well obviously
      • _nox
        We definitely live without let else in Servo, but it would make code cleaner in many places.
      • rkruppe
        I must say I am currently a bit sour on further syntactic sugar around control flow, seeing as I am currently reading code that could save several levels of indentations just with existing tools (early return, if let)
      • est31
        I just wouldnt want sugar merged that gives a bit sweetness but means a great deal of arbitrary rules
      • mattes has quit
      • _nox
        Sour on sugar?
      • :)
      • rkruppe
        indeed
      • est31 pours a bucket of berchtesgadener salt on rkruppe
      • _nox would be happy with let else without the non-diverging else blocks.
      • est31
        I often write code like let f = if let Some(v) = expr { v } else { continue; } or similar
      • _nox
        est31: Same.
      • est31: https://github.com/rust-lang/rfcs/pull/1303#iss... is what I meant in my /me.
      • est31
        _nox: is that what let else is about? making that shorter?
      • _nox
        est31: HTML is plenty of "if X is null, abort these steps".
      • est31: Yep.
      • est31: let Some(v) = expr else { continue }
      • est31
        oh that would be sweet
      • _nox
      • Havvy
        At this point I think the RFC should be closed, and reopened in another PR, because this BCEC stuff is not the PR, and everybody is ignoring it, and if we tried to go back to it, anybody new to the discussion would be so so so confused.
      • est31
        yeah
      • lets do it like the modules rfc
      • new pr for each day
      • _nox: let expr really looks great....
      • _nox
        est31: A rogue-like RFC?
      • :)
      • Every time a legit argument against it is made, the RFC is killed and a new one must be ran.
      • Havvy
        est31: I don't mean have a new RFC, I mean that the comments on the RFC are totally unrelated to the RFC that it's impossible to actually discuss the RFC.
      • est31
        especially once we get arbitrary labeled blocks
      • porky11 has quit
      • Noldorin joined the channel
      • Havvy: I've said "new PR for each day" not "new RFC" :)
      • got what you've meant
      • but yeah the modules rfc got revised each time and renamed
      • Havvy
        The modules one actually made changes based on discussion, as the discussion was related to the RFC.
      • Noldorin
        okay, what on earth's going on here... 'if' expressions aren't supported in const fns?! I'm getting error[E0019]: constant function contains unimplemented expression type
      • steveklabnik
        that's true
      • if is not currently allowed in a const fn
      • Noldorin
        steveklabnik, ?!
      • rkruppe
        Havvy: a new PR won't fix that. anything addressing the use case of chained if-let is like a big invitation to propose BCEC
      • steveklabnik
      • Noldorin
        steveklabnik, I was under the impression lots of things (more complicated than if) were allowed underthe new MIRI evaluator
      • steveklabnik
        > although more useful than loops, conditional control flow (if/else and match) also remains unimplemented and only match would pose a challenge
      • rkruppe
        miri isn't the default yet
      • it still runs side by side the old const eval
      • steveklabnik
        yes
      • Havvy
        rkruppe: The BCEC should be its own RFC and design work for it can be done there.
      • steveklabnik
        and, even then
      • Noldorin
        rkruppe, ah rubbish. can I make it default?
      • steveklabnik
        i am pretty sure right now that it's restricted to the same things as the old evaluator? not 100% on that though
      • -Z miri
      • iirc
      • est31
        Noldorin: even if miri is the new default, one needs a new rfc to allow all the new stuff
      • we are not there yet
      • rkruppe
        Havvy: you can't separate it very well since it's addressing the same use case
      • Noldorin
        est31, what's so controversial about if's in const exprs?
      • rkruppe
        nothing
      • Noldorin
        then surely an RFC isn't needed
      • rkruppe
        the RFC is needed to determine the exact extent
      • because miri can do much, much more than ifs
      • Noldorin
        sounds like silly bureaucracy, but okay...
      • steveklabnik
        it's more like "actually design the language" rather than "let it do anything just because"
      • est31
        Noldorin: yeah its more of a bureocracy thing than controversies thing
      • rkruppe
        Yes I don't expect it to be super controversial either
      • est31
        RFCs are no court, not made to end clan wars
      • Noldorin
        steveklabnik, for things that need designing, sure. but "enabling if expressions in const expressions" seems so trivial as to not need it
      • est31, rkruppe fair enough
      • est31
        Noldorin: miri will likely enable far more stuff
      • rkruppe
        But it's a major feature and it will impact all Rust implementations so it's good to make sure everyone's on board.
      • eddyb
        Noldorin: it allows meaningful recursion
      • Noldorin
        est31, yeah, that's what I understand.
      • oli-obk is almost done with the miri PR, right?
      • est31
        miri is integrated into the compiler already
      • eddyb
        and non-linear control-flow
      • making some analysis harder
      • Noldorin
        oh. well I got the impression oli-obk was working on some final stuff to do with it. at least that's what he told me
      • eddyb
        you don't want if/else without imperative loops
      • because people will write recursive implementations of algorithms
      • Noldorin
        is there a way to enable miri when building Rust? for the stdlib.
      • eddyb, yeah, and Rust isn't optimised for that... makes sense
      • eddyb
        Noldorin: oli-obk is working on replacing the old CTFE with miri
      • miri is not usable for CTFE right now, only to double-check the results of old CTFE
      • Noldorin
        aha
      • est31
        Havvy: I think all discussions in this area are like this, that everyone just brings up their pet proposal
      • Noldorin
        eddyb, so I can't actually do anything more by enabling -Z miri right now eh?
      • in terms of CTFE
      • eddyb
        Noldorin: no it's just that we don't want people to do the C++ constexpr thing of rewriting their algorithms to some weird lambda calculus
      • Noldorin: correct
      • Noldorin
        okay heh
      • fair
      • eddyb, any idea how close it is to completion? is there a PR for it? I'd be interested in trying it out. :-)
      • eddyb
        yeah filter by oli-obk's PRs
      • actually I may have it handy
      • rustbot
        [PR 46882] <open> WIP: add more boosters 🚀 to miri... <https://github.com/rust-lang/rust/pull/46882>;
      • Noldorin
        eddyb, cool, thanks
      • Diggsey joined the channel
      • frewsxcv has quit
      • Muhannad joined the channel
      • AstralSorcerer has quit
      • korczis joined the channel
      • Muhannad has quit
      • Muhannad joined the channel
      • frewsxcv joined the channel
      • eternaleye joined the channel
      • Muhannad has quit
      • simulacrum has quit
      • korczis has quit
      • korczis joined the channel
      • simulacrum joined the channel
      • Noldorin has quit
      • Noldorin joined the channel
      • mib_a6l47a joined the channel
      • Muhannad joined the channel
      • mib_a6l47a has quit
      • korczis has quit
      • Muhannad has quit
      • korczis joined the channel
      • Kotnik has quit
      • lmposter joined the channel
      • korczis has quit
      • korczis joined the channel