• 0 Posts
  • 324 Comments
Joined 3 years ago
cake
Cake day: September 2nd, 2023

help-circle
  • Yes. Dying your hair crazy colors will get you attention. But it doesn’t mean that you dyed your hair because you wanted attention.

    If my dog goes too far away, I will shout its name very loud so it hears me and comes back to me.

    Doing this will inevitably draw the attention of most of the people around me. But that was not my intention though, I just wanted the attention of my dog. The attention of the other people is just an unavoidable side effect. It may even be an unwanted side effect.


  • This is not a list of all the things they are banning AI from.

    This is a list of every reasonable use of LLMs they can think of in their environment.

    So if anyone thinks “hmm, I know they don’t like LLM contributions but I’m just going to use it once for X”. The immediate next thought should be “They don’t even allow LLMs to spell check, therefore my single use of LLM for X will not be welcome, I will not do it”.

    Basically none of this is enforceable. The rules are there so if someone is caught doing something, it can be pointed out that that something is written in the rules. And also to give a general sense of what is tolerated or not in a community.

    This reminds me of a traffic law in my country:

    It is illegal to go all the way around a roundabout 3 times in a row. There is not a police officer ok every roundabout, or a camera counting how many times you go around it. But if a kid goes off and do stupid shit at 2AM with a loud AF car, one of the things one might do is do many loops on a roundabout. Therefore they can’t just say “I’m not doing anything illegal, I’m just using the public roads with my car and a valid driver’s license”. Since one of the things they did was doing more than 3 rounds in a roundabout.




  • I don’t think the difference is the minimum education for entry.

    I’d say the difference is how much of your paycheck is because of you specifically and how much is for just general labor.

    So a physics researcher job is “skilled” because most of the pay is because the specific researcher knows about physics.

    But a waiter job is “unskilled” since the skills needed to do the job are the skills needed for basically any job:

    • Basic maths skills
    • People skills
    • Willingness to work
    • Physical endurance
    • Enthusiasm to work
    • Memory
    • Handling stressful situations
    • Other relatively basic skills

    Of those, only physical endurance and people skills are “exclusive” to being a waiter. There are some actual jobs that require no physical endurance. And some jobs don’t require as much people skills as being a waiter does. But the rest of them are general across basically every job.

    Of course, "unskilled job"s do require skills, I just listed a bunch of them. But most of those skills, any other worker that does any other job would have. Therefore I count payment for those skills as payment for “general labor” and not “payment for you specifically”.


  • TL;DR:

    Domain Driven Design has a flaw: not all types can be categorized into “valid” and “invalid”, since it often depends on context.

    Solution: you just haven’t modeled your domain correctly. You have a type for “MyData” but you don’t have a type for “MyDataThatIsBeingEditedByTheUser”.

    So the “final” type should be valid, but often you should have intermediate type(s) that model incomplete input.

    Basically, when doing DDD don’t forget your builder types.


  • If you come with reddit mentality, you’re gonna see reddit eveywhere. In Lemmy, upvotes are not a popularity contest. There is no karma. Votes have no use other than sorting.

    One of the reasons my comment may have more upvotes might be because it directly answers the question of the commenter above.

    OP didn’t ask what the borrow checker was, OP asked if it was an integral part of rust, and I answered it. Just like another commenter asked more specific questions about rusts’ borrow checker and I answered them.

    Another reason might just be that my comment has more entertainment value, while the other one is purely educational.

    Another reason might be that Lemmy is already full of rust explanations, therefore there are probably not a lot of people left to learn how it works.



  • I don’t see how LLVM helps with bootstrapping.

    Yes, it helps with supporting newer platforms, since LLVM is a big project and will probably have support for the new platforms relatively fast.

    But as long as any part of the whole process is in rust, it means that you need a rust compiler to build the rust compiler, thus needing to solve the bootstrapping problem.

    Of course, every compiler has this issue (even if not self-hosted, you still have to bootstrap the compiler of the language your language is written in).

    The only solution for this is to have a compiler-chain where the first level is a simple compiler that can be relatively easily written in the assembly language of the new platform.

    EDIT: or of course I could’ve read any other comment. Of course you can use one of the intermediate representations that are portable to build the first compiler. In which case you don’t need a rust compiler, just need LLVM. Makes sense then.


  • You can reference count, but you must do so explicitly, just like in C++ you have to explicitly use std::shared_ptr, in rust you must explicitly use std::rc::Rc.

    Rusts’ memory safety is managed at compile time, that’s what the borrow checker does. It enforces a strict set of simple rules that guarantee at compile time that all the references are valid when they are used. This means that there is no runtime cost.

    Q: “Why would you use Rc then? It would only introduce runtime overhead that is not needed because rust already checked that the program is correct”

    A: the borrow checker ensures that your program is valid. However, not all valid programs are allowed by the borrow checker. That is what unsafe is for. unsafe allows you to skip some rust safety features if you want to make a program that is valid but rejected by the “safe” rust compiler. Rc uses unsafe internally to expose an API that is safe, but allows you to do things that would normally be rejected by rust.

    Of course, the borrow checker is not all the safety features of rust. There are some safety features that actually do have runtime checks.

    For example, you can try to access invalid memory by reading out of the bounds of a buffer/array. Most of the time, it is impossible/impractical to solve for this at compile time. Therefore, a bounds check is done on every array access, if the check fails, the program crashes. That check is done at run time. Many times the compiler will optimize those checks, but sometimes they just cannot be optimized out.




  • You guys don’t pay with cash?

    So every purchase you make, doesn’t matter how small, you give a cut to the payment processor? I’d be fucking pissed if I were a small shop selling to you. In fact there are many shops that just refuse to sell if you buy something too cheap through a payment processor.


  • Ball bearings aren’t wheels to me though.

    For me, a characteristic feature of a wheel is that it is circular, not spherical. Which would disqualify ball bearings.

    Doors are harder to define though. Since there can be doors for non-people. For example dog doors.

    I would define doors as “manmade object that sits between an ‘inside’ and ‘outside’ which can be closed or opened. And has the main purpose of letting things in or keeping them out”. But for that you’d have to define “inside” and “outside”. And would include windows, since they let air and light in and can be closed. I wouldn’t consider a window a door.



  • Low level goes way beyond raw pointers. But yes, rust does have raw pointers.

    Java does have raw pointers too I believe though. I wouldn’t call it low level.

    But low level is not well defined. At some point, the difference between low level and high level used to be whether you had to write a different program for each computer architecture. Under that definition, C is a high level language. Assembly (and very old languages) would be low level.

    My own definition of low level is: if you have to care at all about memory management, it’s low level.

    Basically, if the language has a garbage collector or if it automatically counts references without you explicitly telling it so, it’s a high level language for me.



  • Yes, the end goal is very similar to a garbage collector. Both are advanced systems of memory management.

    The most important difference being that a garbage collector runs at runtime, while the borrow checker at compile time. Which means that the borrow checker has 0 impact on the program’s performance. It just takes longer to compile the program.

    Which also means that, while the garbage collector says “you can do whatever you want with memory, don’t worry about it, I’ll handle it for you”. The borrow checker says “you fucking donkey. Why did you do that? I won’t compile this if you don’t fix it”.

    So you trade programmer comfort for performance (end user comfort).


  • Lemmy is social media, not school. Nobody owes an explanation. Mostly because the poster cannot know the knowledge level of whoever is gonna read the post. If every post has to be explained for every potential person that could read it, every post would be followed by a wall of text. Of all social media, the only time I’ve seen it happen is pugjesus’ history posts. Which makes sense since he often references some niche history knowledge that very few people would know about.

    Just googling “borrow checker” would’ve shown you it’s something rust-related.


  • Yes. Someone that knows just a little more of rust than you do would know what the borrow checker is.

    It’s the core feature of rust.

    Like talking about java and not knowing what “inheritance” is.

    EDIT: just so you understand how vibecoded that project is.

    The dude says he vibecoded “some of it” because some rust features make it a hard language for him. The one feature he’s talking about is the borrow checker.

    It’s like saying “man, sure is hot today”. Someone says “yeah, this summer sure is hot” and the dude replied “yeah, summerians lived in a hot place too”.