People really like this syntax? I get C++ has its faults but this is like the most unreadable language.

People really like this syntax? I get C++ has its faults but this is like the most unreadable language.

Homeless People Are Sexy Shirt $21.68

Ape Out Shirt $21.68

Homeless People Are Sexy Shirt $21.68

  1. 2 weeks ago
    Anonymous

    thats perfectly readable to autists.
    but thats because theyre the epitome of tryhards

    • 2 weeks ago
      Anonymous

      >thats perfectly readable to autists.
      can you explain what the bug is in that code then?

      • 2 weeks ago
        Anonymous

        no, i dont have the autism needed to waste my time on learning rust

      • 2 weeks ago
        Anonymous

        The function doesn't have a return type. Also the LastOp trait bound is msising its constraint.

        • 2 weeks ago
          Anonymous

          It does have a return type
          >AverageOp<Self, Item>

          • 2 weeks ago
            Anonymous

            Then Anthropic Sonnet needs more training I guess

        • 1 week ago
          Anonymous

          I was actually thinking about how it adds the values in the wrong order. It doesn't matter for a few integers, but with lots of floats it's pretty damn important in some cases.

  2. 2 weeks ago
    Anonymous

    Where do I go to learn C?

    • 2 weeks ago
      Anonymous

      >C
      I mean C++. I'm phone posting and it autocorrected.

      • 2 weeks ago
        Anonymous

        Just do some projects bro. Look at some boost examples online that’s how I learned.

      • 2 weeks ago
        Anonymous

        https://www.w3schools.com/cpp/default.asp

        There a tons of sites like that.

      • 1 week ago
        Anonymous

        Read the first half of a good C++ book. Do all the exercises. Then for the second half, skim it, and skip anything that sounds too esoteric, because no one uses those features in real life.

        Then start a project and use ChatGPT for any questions you have.

        Good books are: a C++ Crash course, by Lospinoso; C++ Primer (2011 edition) by Moo and two other guys whose names I don't remember.

  3. 2 weeks ago
    Anonymous

    this is a stupid argument, try to do the same thing in C++ if it's so much better than, and by the same thing i mean the same semantic, then we can compare the two and see who is the uglier one

    • 1 week ago
      Anonymous

      they're both gonna be equally ugly. Especially in modern c++23 template stuff got cleaned up alot so its not nearly as bad as you think. If anything c++ might be clearner than this.

      But thats not the point, the point is you rust homosexuals have been arguing for years how c++ is ugly, as some kind of "con" of the language that rust doesn't have, not even realizing your own language is just as ugly.

  4. 2 weeks ago
    Anonymous

    >unreadable
    Skill issue.

  5. 2 weeks ago
    Anonymous

    What's so unreadable about it?
    It's just an ordinary generic method with a bunch of trait constraints.

    • 2 weeks ago
      Anonymous

      >What's so unreadable about it?
      everything.
      the person designing the interfaces took alot of drugs in the process or was just plain malicious
      or is just fricking moronic and doesnt know a single thing about designing interfaces

      • 2 weeks ago
        Anonymous

        Are you complaining about syntax or code?

        • 2 weeks ago
          Anonymous

          syntax.
          its objectively bad.
          one char symbol bonanza is a bad idea
          especially when you have shit like > vs >> and : vs ::

          • 2 weeks ago
            Anonymous

            I don't see a >> in the picture.
            :: has been used for accessing namespace since 1998.
            : is clearly for describing an interface.

          • 2 weeks ago
            Anonymous

            https://doc.rust-lang.org/book/appendix-02-operators.html
            its not in this exact picrel but the examples provided are part of the rust language
            in fact, rust symbols are an absolute fricking mess

          • 2 weeks ago
            Anonymous

            I don't see what the issue is? Languages are not allowed to have operators now?

          • 2 weeks ago
            Anonymous

            >I don't see what the issue is?
            and this is why you shouldnt talk about language legibility
            im not typing this shit again

            syntax.
            its objectively bad.
            one char symbol bonanza is a bad idea
            especially when you have shit like > vs >> and : vs ::

            >one char symbol bonanza is a bad idea
            clarif: the symbols you use as syntax need to be evocative and representative in order to lessen cognitive burden.
            one char symbols are the exact equivalent of using obtuse syntax to fit stuff in as little lines of code as possible.
            and thats how spaghetti is born.

          • 2 weeks ago
            Anonymous

            >syntax bad
            >complain about operators
            ???

          • 2 weeks ago
            Anonymous

            the less punctuation marks the prettier, more readable code
            you can't market your toy language as the be all end all to all problems with existing languages and grasp for the "but other languages do it too" cope when confronted with the slightest criticism

          • 2 weeks ago
            Anonymous

            >the less punctuation marks the prettier, more readable code
            No it doesn't. Proper use of operators make a language expressive and readable.
            >You can't market
            Nobody is marketing towards you, you are not a programmer.

          • 2 weeks ago
            Anonymous

            >No it doesn't
            learn to english

          • 2 weeks ago
            Anonymous

            >:: has been used for accessing namespace since 1998.
            This is a meaningless statement. Just because some languages have used it for a long time doesn't somehow make it a good choice, nor does it mean new languages will continue to use it for that purpose.

          • 2 weeks ago
            Anonymous

            And what exactly do you suggest for accessing namespace? dot operators?
            lmao

          • 1 week ago
            Anonymous

            That's not the point being made. Regardless, I wouldn't mind your suggestion as it's more consistent with less syntax burden.

          • 1 week ago
            Anonymous

            >it's more consistent
            No it isn't. Dot syntax make no distinction between accessing a symbol a namespace and a struct. It's a fricking terrible idea.
            Goes to show these armchair PLT specialist like to b***h about things that they haven't researched

          • 1 week ago
            Anonymous

            >No it isn't. Dot syntax make no distinction between accessing a symbol a namespace and a struct.
            Sounds like you're contradicting yourself. Using the same symbol consistently to access a sub-symbol, is more consistent than using multiple symbols for essentially the same concept that was arbitrarily divided up.

            >It's a fricking terrible idea.
            You didn't provide your opinions on why so I can't see your perspective on it.

            >Goes to show these armchair PLT specialist like to b***h about things that they haven't researched
            I'm not sure who specifically you're referencing with this or what relevance it would have regardless. It would be some kind of appeal to authority anyway. Just because someone is a researcher doesn't make their opinions on syntax any less subjective. It adds no weight to the discussion one way or the other.
            If you ask me, I'd be less inclined to trust academics on programming since they rarely ever put their theories into practice. I'd sooner trust day to day engineers who actually have to write the stuff regularly.

          • 1 week ago
            Anonymous

            >Sounds like you're contradicting yourself.
            In what way?
            >consistency
            I never even mentioned the word consistency. I am saying the dot operator is a terrible idea as it cannot distinguish two similar-looking operations with a very different underlying procedure.
            >You didn't provide your opinions on why
            Because it cannot distinguish between accessing a symbol in a namespace and accessing a member in a struct.
            Can you not fricking read or are you clinically moronic?

          • 1 week ago
            Anonymous

            >In what way?
            As I said, you're saying it's not consistent and your rationale is that you would be using the same symbol for the same concept. Hence, it is in fact consistent. You use the same symbol to access a symbol which is itself underneath another symbol, whether that super symbol be a namespace, struct, type which contains methods, etc.
            Your proposed alternative is to have different symbols for each one which is less consistent. Using different symbols for what is essentially the same concept, but arbitrarily divided for reasons you did not state.

            >I never even mentioned the word consistency.
            Anon. This remark makes me doubt your sincerity. I used that word and you directly quoted and replied to it with "no it isn't". Are you going to now say you were talking about something besides consistency?

            >distinguish two similar-looking operations with a very different underlying procedure
            You're entitled to see them as different procedures, because in implementation they are. The problem with this is we're talking about lexical syntax, abstractions. Each of the things you described falls under the umbrella of accessing a sub-element. The same abstract concept can be easily expressed with the same symbol. Why the distinction needs to be made by the symbol itself is unclear. I'd rather the parent symbol be better named than rely on the accessor symbol to derive more context.
            When does it seem better to rely on the symbol for this than anything else?

            >Can you not fricking read or are you clinically moronic?
            If you're going to act like this then we're not going to discuss it. The choice is yours.
            You can either talk like an angry homosexual and get ignored or talk seriously and we can discuss the topic. I'd rather you not act like a child.

          • 1 week ago
            Anonymous

            how are you going to distinguish namespace qualifiers with struct access?
            you sound like a fricking idiot honestly who has never written a programming language or a parser. do you expect to just parse out a syntax tree of dot access and just try namespace or access until it fits? why?

          • 1 week ago
            Anonymous

            What's the point of this tangent? You're acting as if this isn't a problem already solved by languages that already do this. Steering the conversation away from "why" and into "how".
            You haven't explained why you would want to make the distinction using the symbol.

            >you sound like a fricking idiot honestly who has never written a programming language or a parser. do you expect to just parse out a syntax tree of dot access and just try namespace or access until it fits? why?
            Considering you're the one asking how to accomplish such a feature, this is a very ironic statement.
            Are you trying to discuss this topic or are you just trying to get some attention and validation?
            Did you write a parser? Good job sweetie. Can we talk about the topic now?

          • 1 week ago
            Anonymous

            the point is you literally don't know how to implement a fricking parser and will write some dogshit that doesn't work correctly and paper over it with more shit code.
            C++ is already impossible to deterministically parse. shut the frick up.
            The idioctic FRICKED UP part of your shitty reply chain with that other anon is I actually had to partially parse C++ and if namespaces where not delimited by :: I would have literally killed someone. frick you, you fricking moron. namespaces are not code, things in a namespace are not data and :: IS NOT . holy shit.

          • 1 week ago
            Anonymous

            >C++ user
            That explains why you're throwing a tantrum and can't comprehend parsing sane languages in sane ways. Your language and its tooling are terrible, by your own admission.
            It's insane that you're arguing against yourself this hard.

            You're still avoiding answering the most important question and I'd still like an answer.
            Why do you think it's a good idea to have 2 symbols for the same concept instead of one.
            The answer seems to be that you can't properly implement a parser and need to tax the
            programmers to accommodate your lexer implementation. Which to me sounds like a terrible and backwards reason.
            It has nothing to do with the abstract concepts.

          • 1 week ago
            Anonymous

            >Why do you think it's a good idea to have 2 symbols for the same concept instead of one.
            they aren't the same concept. that's the whole fricking point you massive moron.

          • 1 week ago
            Anonymous

            Resolve the left hand symbol. If it's a value you try a struct/method access. If it's a module you try a module item access. If it's a type you try a type item access.
            AFAIK that covers it for Rust.

          • 1 week ago
            Anonymous

            >Resolve the left hand symbol
            why resolve? there is literally zero reason for the lexer to do this.
            it can be inferred by appropriate operator choice. that's the whole fricking point you shitter.

          • 1 week ago
            Anonymous

            chill, anon
            rustroony is either genuinely moronic
            or maliciously so
            rustshill tatics 101

            Are you complaining about syntax or code?

            syntax.
            its objectively bad.
            one char symbol bonanza is a bad idea
            especially when you have shit like > vs >> and : vs ::

            (about legibility)

            >one char symbol bonanza is a bad idea
            clarif: the symbols you use as syntax need to be evocative and representative in order to lessen cognitive burden.
            one char symbols are the exact equivalent of using obtuse syntax to fit stuff in as little lines of code as possible.
            and thats how spaghetti is born.

            (cont)

            totally honest rustBlack person reply:

            I don't see a >> in the picture.
            :: has been used for accessing namespace since 1998.
            : is clearly for describing an interface.

          • 1 week ago
            Anonymous

            ??

          • 1 week ago
            Anonymous

            >rustshill
            One of the Anon's arguing with the other Anon, doesn't even use Rust. Let alone advocate for it.

          • 1 week ago
            Anonymous

            >there is literally zero reason for the lexer to do this.
            The lexer doesn't have to know about any of this. You can do it pretty late.
            It already has to distinguish between types and enums for ::, I don't see the problem with adding values as a third case.

          • 1 week ago
            Anonymous

            >It already has to distinguish between types and enums for ::, I don't see the problem with adding values as a third case.
            ur contradicting yourself, rustroony

            >C++ user
            That explains why you're throwing a tantrum and can't comprehend parsing sane languages in sane ways. Your language and its tooling are terrible, by your own admission.
            It's insane that you're arguing against yourself this hard.

            You're still avoiding answering the most important question and I'd still like an answer.
            Why do you think it's a good idea to have 2 symbols for the same concept instead of one.
            The answer seems to be that you can't properly implement a parser and need to tax the
            programmers to accommodate your lexer implementation. Which to me sounds like a terrible and backwards reason.
            It has nothing to do with the abstract concepts.

          • 1 week ago
            Anonymous

            >You're entitled to see them as different procedures
            They ARE different procedures, moron.
            >because in implementation they are
            Yes. And thus they ought to be different
            >The rest of the mental gymnastics
            Didn't read. Go write a compiler and come back to me.

          • 1 week ago
            Anonymous

            >Yes. And thus they ought to be different
            Saying this doesn't explain your rationale. Explain why they ought to be different in the syntax.
            Why must the programmers differentiate them in the source code when they are the same concept.

            >Didn't read. Go write a compiler and come back to me.
            I'd say this isn't an argument but it's an argument against you. The answer seems to be that you can't implement a parser which handles this.
            Which is moot since it's not addressing the point about syntax and multiple languages have already solved this.

            >Why do you think it's a good idea to have 2 symbols for the same concept instead of one.
            they aren't the same concept. that's the whole fricking point you massive moron.

            That's where we disagree. I've explained my perspective on it, you have not explained yours.
            I'm of the opinion that accessing a sub-element is the same concept regardless of the super-element, and thus it would be consistent to use the same symbol for doing that same concept.
            Just because the implementation is different, does not seem like a good enough justification to warrant adding more symbols into the lexicon, especially when they're used only for that.
            And most especially, not when the rationale is "I can't write a parser unless you do that". That's a sign of a bad language. And I hate to even have to write that since you're the one making that point more than I am. It shouldn't even be considered controversial.

            I'd like to know why you think the same symbol can't be used in the syntax, abstractly/conceptually.
            That's the topic being discussed. You're deep in the weeds about how C++ would have to be implemented as if that has any bearing on the idea.
            We can sit here and list of dozens of things that would be hard to implement in their standard, that doesn't make them inherently bad ideas. Especially not in the context of new languages that aren't bound to their same insanity.

            >It already has to distinguish between types and enums for ::, I don't see the problem with adding values as a third case.
            ur contradicting yourself, rustroony
            [...]

            The second reply you quoted is me, the first one is not.
            I.e. we're not the same person.

          • 1 week ago
            Anonymous

            >No it isn't. Dot syntax make no distinction between accessing a symbol a namespace and a struct. It's a fricking terrible idea.
            Good. The alternative is having a unique symbol or pair of symbols for each bespoke idea. It's how you end up with moronic shit like the arrow -> in C.

          • 1 week ago
            Anonymous

            >The alternative is having a unique symbol or pair of symbols for each bespoke idea
            There exists no other way of accessing a symbol than namespace and struct. Do not strawman.

          • 2 weeks ago
            Anonymous

            Suggest an alternative syntax that would express the same thing as in OP.

            the less punctuation marks the prettier, more readable code
            you can't market your toy language as the be all end all to all problems with existing languages and grasp for the "but other languages do it too" cope when confronted with the slightest criticism

            Rewrite OP code without using punctuation marks.

          • 2 weeks ago
            Anonymous

            >Rewrite OP code
            How? I can't read it

          • 2 weeks ago
            Anonymous

            All the Type: Trait + Trait +... in where block are just generic bounds. It means that this function is defined iff these bounds at met. It should be trivial to understand what does the function do(even looking at name) and if you pay attention to what kind of bounds are used.

            If you still can't understand the code, you probably shouldn't be talking about language design in the first place.

          • 2 weeks ago
            Anonymous

            >ESL

          • 2 weeks ago
            Anonymous

            sfinae is infinitely better than the rust equivalents

          • 2 weeks ago
            Anonymous

            In what way? Rust traits are basically C++ concepts. SFINAE is a hack for the lack of concepts

          • 2 weeks ago
            Anonymous

            if they are like concepts then you should be able to decompose them and make them more readable, just like c++ sfinae can be broken up into smaller concepts

          • 2 weeks ago
            Anonymous

            You can compose traits, yes. The code in OP doesn't do it.

          • 2 weeks ago
            Anonymous

            thats somewhat comforting that ops example is just someone making things look "cool" like the c++ units example that was posted here also. both are shit

          • 2 weeks ago
            Anonymous

            It's not to be cool. That library is some niche attempt at implementing some "ReactiveX" concept from Microsoft. It's seems to be from functional programming and that would explain these ridiculous generic bounds. The lack of use of type aliases is contributing to that as well.
            All of this could be written much simpler with better traits/aliases and that's not something you have to write normally, unless you are doing some academic research or an experiment in bringing some abstract concept from different language into Rust.

          • 1 week ago
            Anonymous

            https://reactivex.io/languages.html
            looks good, but I don't see the Rust one.

          • 1 week ago
            Anonymous

            Because it's just some random unofficial library.
            https://docs.rs/rxrust/latest/rxrust/index.html#

          • 1 week ago
            Anonymous

            Composing Rust traits is probably more tedious than composing C++ concepts because Rust traits need to be implemented explicitly. So in addition to trait C: A + B {} you need to write impl<T> C for T where T: A + B {}.

          • 1 week ago
            Anonymous

            who thought that was a good idea?

          • 1 week ago
            Anonymous

            Traits and concepts aren't really the same thing. Traits contain functions, concepts just describe them.
            You could have this trait:
            trait C: A + B {
            fn hello(&self);
            }
            And then a blanket implementation would have to look like this:
            impl<T> C for T where T: A + B {
            fn hello(&self) {
            println!("Hello");
            }
            }
            The hello implementation has to live inside an impl C block, there's no way to do that implicitly.
            The C: A + B syntax means that for a type to implement C it also has to implement A and B. (So it doesn't mean that C is just the intersection of A and B.) You don't have to write this kind of blanket implementation, often it makes more sense to write individual implementations per type.
            One nice thing about this is that you can implement your own trait on a foreign type (like a standard library type). This compiles:
            trait MyTrait {
            fn my_method(&self);
            }

            impl MyTrait for i32 {
            fn my_method(&self) {
            println!("Hello from {self}");
            }
            }

            fn main() {
            let n = 10;
            n.my_method();
            }
            And you can limit which types implement a trait. If you want a trait to be implemented by integers but not by floats then you can just not write a float impl. (I bet concepts also have a way to do that though.)

            >it's more consistent
            No it isn't. Dot syntax make no distinction between accessing a symbol a namespace and a struct. It's a fricking terrible idea.
            Goes to show these armchair PLT specialist like to b***h about things that they haven't researched

            >Dot syntax make no distinction between accessing a symbol a namespace and a struct. It's a fricking terrible idea.
            Does this really matter? I don't mind the paamayim nekudotayim but I've never felt like I was missing out in a language that used dots for everything.
            And why not go further and use a different syntax for module namespaces versus type namespaces? Why draw the line exactly here?

            The faults from c++ are mostly from c, implicit conversions and implicit copies
            You wouldn't know because you are just an NPC parroting nonsense

            Couldn't they have limited it to C's implicit conversions and only done implicit copies for trivial types (no destructor, etc.) without adding their own complicated conversions and copies on top? I've always been confused about this

          • 1 week ago
            Anonymous

            ill just say it, if this is rusts answer to mixins then i still hate it

          • 1 week ago
            Anonymous

            Mixins are one use for traits and I don't really like that either, one of my least favorite parts of the language. Makes it hard to tell where methods come from and it can even cause backward compatibility issues.
            But the primary use is for polymorphism and that works great.

          • 2 weeks ago
            Anonymous

            Explain how exactly is sfinae better than traits/typeclasses/concepts.

          • 2 weeks ago
            Anonymous

            i use them interchangeably since people are slow to adapt to concepts

          • 2 weeks ago
            Anonymous

            That doesn't answer my question.

          • 2 weeks ago
            Anonymous

            it does answer your question

          • 2 weeks ago
            Anonymous

            Shouldn't be expecting reading comprehension from a cinile I guess.

        • 2 weeks ago
          Anonymous

          >one char symbol bonanza is a bad idea
          clarif: the symbols you use as syntax need to be evocative and representative in order to lessen cognitive burden.
          one char symbols are the exact equivalent of using obtuse syntax to fit stuff in as little lines of code as possible.
          and thats how spaghetti is born.

          • 2 weeks ago
            Anonymous

            >one char symbols are the exact equivalent of using obtuse syntax to fit stuff in as little lines of code as possible
            mfw

      • 2 weeks ago
        Anonymous

        You're so fricking stupid. Dunning krugerites should kill themselves.

        • 1 week ago
          Anonymous

          >screeching
          Not an argument.

    • 1 week ago
      Anonymous

      this is more abstract that peak java OOP moronation.
      Just because the language makes it easier, and more felxible and less boilerplate heavy, doesn't make it that much less cringe.
      This reeks of someone that wants his code DRYer than the sahara desert, and is termnially addicted to abstractions.
      Not healthy.

  6. 2 weeks ago
    Anonymous

    Templates are hard to read in general, Rust or not.
    This is from a personal project

    Usually this code only needs to be understood by one person, and then others just use the public interface

    • 2 weeks ago
      Anonymous

      Shit like this is why I program in C at work.

      • 1 week ago
        Anonymous

        What's your line of work anon
        I want to get a C job so bad

    • 2 weeks ago
      Anonymous

      >Templates are hard to read in general, Rust or not.
      Wrong. Zig solved Generics with comptime.

      • 2 weeks ago
        Anonymous

        why even zig?
        in C i write my functions as modules to be inlined.
        then writing "generics" is just writing the adequate modules into my functions. and jobs a good'n, lets go drink.

        the amount of code you write is basically the same as you would with geriatrics. and your code is not duplicated.
        If by chance or malicious design youre anal about that functionality you can have generics in C23, although i didnt even look into these so i cant tell what that system is worth. i just dont need em.

        • 2 weeks ago
          Anonymous

          >writing the adequate modules into my functions
          "calling" the adequate modules in my functions.
          the modules get inlined
          and viola! we got generics at home.

      • 1 week ago
        Anonymous

        D templates are also basically as readable as regular functions
        C++ was hamstrung having to wrap generics around C syntax, but modern languages have no excuse
        It irks me to no end that Rust carried over the abominable :: symbol

      • 1 week ago
        Anonymous

        Show me a generic linear algebra library in zig. I would love to see how well it works.

    • 2 weeks ago
      Anonymous

      I genuinely can't see where signature ends and code starts

    • 2 weeks ago
      Anonymous

      Cniles you're not helping your case here...

      • 2 weeks ago
        Anonymous

        I don't think that guy is interested in petty language wars.

        • 2 weeks ago
          Anonymous

          Me neither, this kind of shit shouldn't exist

          • 2 weeks ago
            Anonymous

            >Coding shouldn't exist
            That's basically what you're saying. Stop pretending to be a computer scientist.

      • 2 weeks ago
        Anonymous

        cniles literally have no case. That's C++.

    • 2 weeks ago
      Anonymous

      it took me like 10 minutes to understand this code including looking up what is constexpr , ratiosubtract and operator overloading.
      this is how templating should be done

  7. 2 weeks ago
    Anonymous

    I can dislike both of them without difficulty.

  8. 2 weeks ago
    Anonymous

    It's literally indistinguishable from c++. They took all the faults of c++, then just did them again a second time because there wasn't enough shit c++ code in the world.

    • 1 week ago
      Anonymous

      The faults from c++ are mostly from c, implicit conversions and implicit copies
      You wouldn't know because you are just an NPC parroting nonsense

      • 1 week ago
        Anonymous

        >mplicit conversions and implicit copies
        literally this

      • 1 week ago
        Anonymous

        >mplicit conversions and implicit copies
        literally this

        >ma, the knife CUT ME!!!!!
        literally skill issue

        • 1 week ago
          Anonymous

          std::optional<S> do_stuff() {
          return S{}
          }

          • 1 week ago
            Anonymous

            what are you trying to say?

          • 1 week ago
            Anonymous

            Exactly you don't know the rules.

          • 1 week ago
            Anonymous

            >rules
            topkek, if i cared about these i wouldnt write in C you dweeb

          • 1 week ago
            Anonymous

            NTA, I am

            >mplicit conversions and implicit copies
            literally this

            Let's be real here, nobody really uses std::optional because C++ has no real pattern matching yet.
            And nobody probably gonna use it either because good luck pushing these concepts in codebase controlled by half dead boomers.

          • 1 week ago
            Anonymous

            >std::optional<S> do_stuff() {
            > return S{}
            frick sake.
            I can't stand C++.
            thanks for reminding me.

          • 1 week ago
            Anonymous

            cope and sneed

          • 1 week ago
            Anonymous

            I honestly forgot that returns can be promoted. I'm assuming it's similar to parameters in terms of promotion rules?

      • 1 week ago
        Anonymous

        Also C++ is not unsafe because of pointers waaa waa it's because of this moronic implicit shit and their designers being morons, look at regex or modules
        Industry should really just move on, just admit that C++ is garbage

        • 1 week ago
          Anonymous

          it's still unsafe because of pointers. c++ iterators are very easy to misuse and they're basically raw pointers

          ?t=294

          • 1 week ago
            Anonymous

            The example he shows are simple and the ones that aren't simple are because of the moronic constructor temporaries copies bla bla, look at string_view and span they also have this problem

          • 1 week ago
            Anonymous

            that's c++'s calling card, a bunch of moronic shit you have to know to use it safely because of course it doesn't do what you expect it to. the designers are moronic and still adding UB to new feature without any safe or impossible to use incorrectly alternatives
            any new languages being designed like c++ is currently would never take off

          • 1 week ago
            Anonymous

            Why not just use Rust iteration model? He says it's less expressive and slower, but I personally never experienced that, considering how easily composable they are and how compiler inlines and optimizes away stuff. Also not being limited to continuous memory is a great advantage too.

          • 1 week ago
            Anonymous

            you can watch the talk, he discusses it. his solution that gets better performance than the std ranges is closer to what rust does (and compiles to a lot of the same code when i last checked).
            there are pros and cons to both methods. by default, the Iterator trait is not as powerful because you need the other traits such as exactsizeiterator and doubleendediterator and then internal private traits like trustedlen/trustedstep for the most optimal performance.

  9. 2 weeks ago
    Anonymous

    Perfectly understandable compared to C++ templates. C++ users would say the same thing, "this is for library code, users don't have to worry about writing this"

    • 2 weeks ago
      Anonymous

      >rustroony
      >Black tier take
      if all you use is libs just use python at this point and stop talking about your failed abortion of a language

      • 1 week ago
        Anonymous

        Python libs are low quality

  10. 2 weeks ago
    Anonymous

    All I have to say is call me when they have a GUI library and I’ll learn it.

  11. 2 weeks ago
    Anonymous

    it looks like typescript code made by morons

  12. 2 weeks ago
    Anonymous

    Those traits are pretty self explanatory. Maybe you are not good at programming.

  13. 2 weeks ago
    Anonymous

    This is the ugliest shit I have ever seen
    >b-but it's ugly in other languages too
    What's the point of this one then?

  14. 2 weeks ago
    Anonymous

    I only hate how modern languages are forcing implicit types so bad
    >let in rust
    >python assigment level in go
    frick you. you want lower level you specify the type every time

    • 2 weeks ago
      Anonymous

      assigment level in go
      What do you mean by this? If you're talking about := that comes from one of Pike's previous languages; Newsqueak, not Python.

    • 2 weeks ago
      Anonymous

      No one is stopping you from writing out all types explicitly.
      You will quickly understand why type deduction exists.

    • 1 week ago
      Anonymous

      >t. neet nocoder

    • 1 week ago
      Anonymous

      sub 70IQ take
      whats the point in repeating redundant information.
      its just visual noise.
      The compiler doesn't need it.
      Non moronic Humans don't need it in 98% of cases either.
      The functional gays were right on this all along.

  15. 2 weeks ago
    Anonymous

    yeah I'm just going to keep using objective-c.

  16. 2 weeks ago
    Anonymous

    The trait bounds on the simple for loop version would be very readable. Anything async or functional is truly painful in Rust.

    • 2 weeks ago
      Anonymous

      i simply don't use async and leave the nerds to roleplay haskell in libs that i consume as a user

  17. 2 weeks ago
    bruce3434

    If you cannot handle interfaces and operators, consider a different hobby.

  18. 2 weeks ago
    Anonymous

    Looks like programing language syntax designed by chatgpt

    • 2 weeks ago
      Anonymous

      Design a better syntax and show us how would you express the same thing in it.

      • 2 weeks ago
        Anonymous

        javascript

        • 2 weeks ago
          Anonymous

          I guess you've never seen typescript library code. OP's screenshot is nothing compared to some of them.

          • 2 weeks ago
            Anonymous

            This lmao. I used to write hundred of lines of types in typescript in one of my projects. TS is actually more powerful than Rust type system in some aspects and you can really go crazy with it.

            impossible, what does the op even mean?

            See

            All the Type: Trait + Trait +... in where block are just generic bounds. It means that this function is defined iff these bounds at met. It should be trivial to understand what does the function do(even looking at name) and if you pay attention to what kind of bounds are used.

            If you still can't understand the code, you probably shouldn't be talking about language design in the first place.

            It's not to be cool. That library is some niche attempt at implementing some "ReactiveX" concept from Microsoft. It's seems to be from functional programming and that would explain these ridiculous generic bounds. The lack of use of type aliases is contributing to that as well.
            All of this could be written much simpler with better traits/aliases and that's not something you have to write normally, unless you are doing some academic research or an experiment in bringing some abstract concept from different language into Rust.

          • 2 weeks ago
            Anonymous

            its just bounds. okay but what does it mean, i cant read ops bounds

          • 2 weeks ago
            Anonymous

            >javascript
            yeah but what about tyyyyyyyyypescript

          • 2 weeks ago
            Anonymous

            hello saar, types bad yes

          • 2 weeks ago
            Anonymous

            yes hallo my friend, no types is no problems

          • 2 weeks ago
            Anonymous

            If you don't care about correctness, sure.

      • 2 weeks ago
        Anonymous

        just use some existing language and be done, that ez

        • 2 weeks ago
          Anonymous

          Show us the equivalent code in your favourite language then.

          • 2 weeks ago
            Anonymous

            impossible, what does the op even mean?

    • 2 weeks ago
      Anonymous

      have a nice day pajeet, you're a moron

      • 1 week ago
        Anonymous

        cope and seethe

  19. 2 weeks ago
    Anonymous

    >NOOOO you can't force me to statically define everything
    >Muh dynamic shitlangs
    This has nothing to do with syntax and everything to do with you being a script babby shitter.

  20. 2 weeks ago
    Anonymous

    I do yes.

  21. 2 weeks ago
    Anonymous

    I was actually just going to disagree to be a contrarian, but I decided to take a look and well while I understood what the code is doing (good variable and function naming) I have no fricking clue about what is actually happening in detail
    that could be because I haven't tried rust and maybe I will be able to understand it if I learn rust

    • 2 weeks ago
      Anonymous

      >ReactiveX (Rx, also known as Reactive Extensions) is a software library originally created by Microsoft that allows imperative programming languages to operate on sequences of data regardless of whether the data is synchronous or asynchronous. It provides a set of sequence operators that operate on each item in the sequence. It is an implementation of reactive programming and provides a blueprint for the tools to be implemented in multiple programming languages.
      This should shed some light on it. That code just defines an average under the Rx paradigm. It looks like this because it is supposed to accept both concrete data and async streams using same functions if I understand correctly.

    • 2 weeks ago
      Anonymous

      Also I think this code doesn't do any actual computation. It seems like it just composes some operations together and returns an "operation"(AverageOp?). To understand what the code is precisely doing you will probably have to look at library documentation or at least rest of the code. It's a very high level code.

  22. 1 week ago
    Anonymous

    [...]

    • 1 week ago
      Anonymous

      >tranime
      What a fricking waste.

      • 1 week ago
        Anonymous

        where do you think you are?

        • 1 week ago
          Anonymous

          IQfy.

          • 1 week ago
            Anonymous

            >IQfy.
            check again.

            /misc/ accounts for 60% of the trafic.
            know your place, human trash

            4keks is a frog site, not an anime site

            explains why this thread is so fricking garbage and people can't even read some over-engineered map/reduce functional autism the OP posted.

          • 1 week ago
            Anonymous

            >explains why this thread is so fricking garbage and people can't even read some over-engineered map/reduce functional autism the OP posted.
            no.

        • 1 week ago
          Anonymous

          /misc/ accounts for 60% of the trafic.
          know your place, human trash

          4keks is a frog site, not an anime site

          • 1 week ago
            Anonymous

            Uhm it's 4chinkz you child...

          • 1 week ago
            Anonymous

            >you child
            its important to keep your innocent self alive, anon

          • 1 week ago
            Anonymous

            I meant chud...

          • 1 week ago
            Anonymous

            have some more XG Love Forever anon.

          • 1 week ago
            Anonymous

            you say it like an insult, anon...

            >Yes. And thus they ought to be different
            Saying this doesn't explain your rationale. Explain why they ought to be different in the syntax.
            Why must the programmers differentiate them in the source code when they are the same concept.

            >Didn't read. Go write a compiler and come back to me.
            I'd say this isn't an argument but it's an argument against you. The answer seems to be that you can't implement a parser which handles this.
            Which is moot since it's not addressing the point about syntax and multiple languages have already solved this.

            [...]
            That's where we disagree. I've explained my perspective on it, you have not explained yours.
            I'm of the opinion that accessing a sub-element is the same concept regardless of the super-element, and thus it would be consistent to use the same symbol for doing that same concept.
            Just because the implementation is different, does not seem like a good enough justification to warrant adding more symbols into the lexicon, especially when they're used only for that.
            And most especially, not when the rationale is "I can't write a parser unless you do that". That's a sign of a bad language. And I hate to even have to write that since you're the one making that point more than I am. It shouldn't even be considered controversial.

            I'd like to know why you think the same symbol can't be used in the syntax, abstractly/conceptually.
            That's the topic being discussed. You're deep in the weeds about how C++ would have to be implemented as if that has any bearing on the idea.
            We can sit here and list of dozens of things that would be hard to implement in their standard, that doesn't make them inherently bad ideas. Especially not in the context of new languages that aren't bound to their same insanity.

            [...]
            The second reply you quoted is me, the first one is not.
            I.e. we're not the same person.

            >not the same person
            ok, fair enough

  23. 1 week ago
    Anonymous

    I really think they used the :: for namespaces because of social reasons
    Nobody would have picked rust up if it looked like Haskell(anything not C like)

    • 1 week ago
      Anonymous

      thats stupid.
      people hate c++.
      its like to promote an ice cream company you would use the image of dead children

  24. 1 week ago
    Incredibly Old Village Elder Wizard

    what about it? this is a write only piece of late night frustration and I do similar shit all the time in other languages, hardly something to complain about.

  25. 1 week ago
    Anonymous

    Reading is fine but you won't see me writing that ever

  26. 1 week ago
    Anonymous

    rust is perfect for dei jobs because they think they are serving a function rewriting everything in rust to be slower than c

    • 1 week ago
      Anonymous
  27. 1 week ago
    Anonymous

    DRY was a mistake

    • 1 week ago
      Anonymous

      Best programmer I worked with said this in a CR once and I realize he is right now that I am older. Sometimes just copying/pasting modifying the same code for a different type is way simpler/safer/maintainable than type tetris.

  28. 1 week ago
    Anonymous

    >unreadable
    Every language is unreadable until you understand the syntax.

    • 1 week ago
      Anonymous

      theres objective metrics to legibility.
      a language is a human interface like any other.
      like traffic lights, like doorknobs, like stairs.
      humans have their specificities, and valid interfaces are made with said specificities in mind.
      like with traffic lights- the red color has been chosen because it elicits an instinctual response of getting attentive within our brains.
      rust has no consideration for human characteristics. therefor, its interface is trash and a sign of design incompetence.
      rust is objectively bad.

      ??

      wtf you even mean, autismo?

      • 1 week ago
        Anonymous

        >wtf you even mean, autismo?
        That's my line. You've quoted me along with some random other posts implying it was all one poster.

        • 1 week ago
          Anonymous

          ah, didnt notice
          its time for fricking id's on this board

          • 1 week ago
            Anonymous

            >its time for fricking id's on this board
            Posts have them. (You) don't.

    • 1 week ago
      Anonymous

      theres objective metrics to legibility.
      a language is a human interface like any other.
      like traffic lights, like doorknobs, like stairs.
      humans have their specificities, and valid interfaces are made with said specificities in mind.
      like with traffic lights- the red color has been chosen because it elicits an instinctual response of getting attentive within our brains.
      rust has no consideration for human characteristics. therefor, its interface is trash and a sign of design incompetence.
      rust is objectively bad.

      [...]
      wtf you even mean, autismo?

      (cont.)
      in the case of rust, its problem is that no attention was paid to the reality of humans being visual creatures.
      we respond best to visual stimuli, it is just how we evolved.

      this means that to achieve satisfactory legibility, there need to be enough variation between individual symbols, and said symbols need to be recognizable enough to be effortlessly read.

      this is not the case with rust.
      like in the example i outlined yesterday, namely:
      '::' vs ':'
      or '>>' vs '>'

      just imagine if we used : as a stop sign
      and :: as a speed limit. both symbols surrounded by other characters.

      these are objective metrics
      and rust is objectively bad on that front.

      • 1 week ago
        Anonymous

        >'>>'
        The bit shift operator? Because other than that, > is just the closing bracket for generics, same as ] or ) for indexing or function calls.

        • 1 week ago
          Anonymous

          yes
          and comparison operator too when its one symbol

          bitshift? makes sense. its evocative.
          comparison? makes sense. its a math symbol. its evocative.

          closing bracket for generics- why????

          • 1 week ago
            Anonymous

            Because [] or () would be worse.

          • 1 week ago
            Anonymous

            not my problem.
            im not the one designing the language
            and i dont have to have patience for other peoples frickups.
            im the client, remember?

          • 1 week ago
            Anonymous

            I guess you should screech about every other language with generics as well, then.

          • 1 week ago
            Anonymous

            >nuh wataboot!!!!
            yes i do. i loathe generics because you can do an equivalent job using inlines.
            solves duplicate code. solves 98% of code volume.

            but one would have to possess a functioning brain to do so.
            and corporate wanted to lower the price of the workforce, so here we are.

          • 1 week ago
            Anonymous

            Sorry, I wasn't aware I was talking to a troglodyte.
            I won't bother you anymore.

          • 1 week ago
            Anonymous

            >its LE good bc its new
            progressivism is a mental illness.
            too bad we got laws preventing natural selection nowadays

          • 1 week ago
            Anonymous

            >new
            May be compared to a fossil.

          • 1 week ago
            Anonymous

            i accept your utter concession, childish rustroony

          • 1 week ago
            Anonymous

            really wish we adopted french quotes now that you're talking about balanced delimiters.

          • 1 week ago
            Anonymous

            It hardly matters which when all of those are some kind of bracket. Go uses [] for generic type parameters (as opposed to <>) and it doesn't even phase me. The only thing I could even say about it is that it avoids having to hold shift to type [], which isn't a big deal, it's just the only thing that comes to mind.

  29. 1 week ago
    Anonymous

    Everyone who unironically likes this shit has severe mental illnesses.

    • 1 week ago
      Anonymous

      it makes sense when you understand rx or why langauges that prefer static definitions would be this verbose.
      really you sound like a brainlet tbh.

  30. 1 week ago
    Anonymous

    i couldnt find 'average' but heres the c++ code for concat in rx extensions, if anyone is curious. these paradigms are obnoxious in every language

  31. 1 week ago
    Anonymous

    Once you realize Lisp is correct because it has so little syntax meta programming / generic programming can actually be understood its time to move into management since you realized the truth and normies would rather fight over which syntax is “better”.

  32. 1 week ago
    Anonymous

    >omg my low level typed languages are so good!!!!
    >they all devolve into auto typed shit which borrows things like lambdas from javascript and try to avoid types as much possible with shit like templating

    • 1 week ago
      Anonymous

      mad brainlet is le mad

  33. 1 week ago
    Anonymous

    pretty much as moronic and unreadable as C# LINQ walls

Your email address will not be published. Required fields are marked *