calcopiritus

joined 2 years ago
[–] calcopiritus@lemmy.world 2 points 2 hours ago

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".

[–] calcopiritus@lemmy.world 2 points 8 hours ago

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.

[–] calcopiritus@lemmy.world 4 points 20 hours ago (2 children)

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.

[–] calcopiritus@lemmy.world 1 points 1 day ago* (last edited 1 day ago)

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.

[–] calcopiritus@lemmy.world 3 points 1 day ago

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.

[–] calcopiritus@lemmy.world 11 points 1 day ago (1 children)
[–] calcopiritus@lemmy.world 9 points 1 day ago (7 children)

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.

[–] calcopiritus@lemmy.world 4 points 2 days ago

If you pay your employees, it stops being profit. Paying employees is a cost. Profit = revenue - cost. You cannot hurt employees by taxing profit.

[–] calcopiritus@lemmy.world 7 points 2 days ago (2 children)

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.

[–] calcopiritus@lemmy.world 3 points 2 days ago (1 children)

If you want an idea: just yesterday libre office writer crashed on me like 7 times. Losing all unsaved progress each time.

If someone competent wrote a good OSS alternative I would download it in a heartbeat.

[–] calcopiritus@lemmy.world 12 points 2 days ago

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).

[–] calcopiritus@lemmy.world 6 points 2 days ago

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.

view more: next ›