• 0 Posts
  • 11 Comments
Joined 2 years ago
cake
Cake day: August 29th, 2023

help-circle

  • Thanks for your reply, some replies below!

    requiring positional args to use the assignment syntax

    Not sure, maybe my wording isn’t clear enough. What I intended to say is that arguments can be named, not that they have to. In any case, the order of arguments must match the order of parameters, named or not.

    But you’re also missing one use of the impl keyword: fn func() -> impl Trait.

    That removal could actually happen, so I didn’t list it. (Rust started requiring dyn and disallowed naked trait returns with edition 2018. So dropping the impl in that position might not be completely impossible like the other uses of impl.)

    Are you suggesting using keywords/methods [for array and slice syntax] instead?

    Yes, just methods.

    I can understand someone preferring the PartialEq/PartialOrd behavior

    You can have both – that’s what’s being made possible by them not being in a hierarchy.

    I think if-let makes sense, but don’t expand it.

    It’s a bit late for that, isn’t it? ;-)

    Why? What value does -> () provide? Why not elide that?

    What value is provided by keeping it? Why a syntactic special-case for exactly that type and not any other random type?

    languages w/o them feel awkward since you’re generally limited to one statement per line

    Then fixing that might make sense. :-)




  • soc@programming.devtoRust@programming.devthings rust shipped without (2015)
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    18 days ago

    Some of the earlier ones remind me of C#'s records. Were they inspired from them?

    No, that stuff is much much older.

    Named parameters are problematic because of parameter names becoming significant to the API. See Python’s * and / in parameter lists (like def foo(a, *, b) for example).

    I think the name problem is overblown, you can always have an annotation to facilitate name changes.





  • soc@programming.devtoLinux@programming.devWhy the Linux Kernel Should Stick With C
    link
    fedilink
    English
    arrow-up
    15
    arrow-down
    4
    ·
    edit-2
    2 months ago

    Absolutely delusional.

    code that is readable, auditable, and easy to port

    Yeah C is the language that comes to everybody’s mind reading that. /s

    C’s simplicity …

    Is that simplicity currently in the room with us?

    … and widespread adoption make it the best choice for this philosophy.

    Ah, the asbestos argument.


    If people want to run the latest kernels on hardware that isn’t maintained anymore, they need to toughen up and send patches …

    … or they stick to an old kernel for their unmaintained hardware.

    Both is fine to me, but that entitled Boomer attitude of “nobody should have nice things, because that would challenge status quo” needs to die.


  • “apparently it’s a better safer C++, but I’m not going to switch because I can technically do all that stuff in C++”

    The main difference between C++ and D was that (for most of the time in the past) D required a garbage collector.

    So, D was a language with similar Algol-style syntax targeting a completely different niche from C++.

    Trying to correct your quote, it should read something like “I’m not going to switch because I can’t technically do all that stuff in D that I’m doing in C++” for it to make any sense.