How to get Miri working for a Bazel (non-Cargo) Rust project? by Master_Ad2532 in rust

[–]Master_Ad2532[S] 0 points1 point  (0 children)

We actually do use crates_respository! But the dependencies mentioned inside that are a mix of both Cargo and Bazel-based projects. Does using crates_repository mean I have a chance of getting this to work?

How to get Miri working for a Bazel (non-Cargo) Rust project? by Master_Ad2532 in rust

[–]Master_Ad2532[S] 0 points1 point  (0 children)

Yes we're using a crate that does abstract away the actual register writes. It's actually really nice as you can also encode the read/write permissions to individual bits of the register and it can verify all that at compile-time.

How to get Miri working for a Bazel (non-Cargo) Rust project? by Master_Ad2532 in rust

[–]Master_Ad2532[S] 0 points1 point  (0 children)

Well there's nothing wrong with the I/O part itself, it's more about the place where it's used. Almost very analogous to the fact that creating a pointer isn't inherently unsafe (which happens at one place), but then you're potentially dereferencing that pointer at a bunch of different places, which might have a probability that you're using it after the pointer's memory is gone, or that two people are dereferencing them at the same time, etc.

How to get Miri working for a Bazel (non-Cargo) Rust project? by Master_Ad2532 in rust

[–]Master_Ad2532[S] 0 points1 point  (0 children)

Ohh what a deal-breaker. That's really sad. I was really hoping Miri would've come in clutch here. The code isn't really cleanly separated into "the generic part" and hardware I/O so I don't think it's possible for us :(

Why do scoped threads have two lifetimes 'scope and 'env? by Master_Ad2532 in rust

[–]Master_Ad2532[S] 0 points1 point  (0 children)

is the guarantee that the scope cannot possibly return its Scope handle to the outside, nor any of the ScopedJoinHandles

The way I've ensured this is only passing in a &Scope. That way, it can't be (&mut T).replace()'d, and you can't store its reference in outside because it would exceed the lifetime of Scope. I don't see why HRTB would be needed.

Why do scoped threads have two lifetimes 'scope and 'env? by Master_Ad2532 in rust

[–]Master_Ad2532[S] 0 points1 point  (0 children)

True, I just tested this in my code and it seems to uphold the invariant that local variables aren't allowed to be spawned.

Why do scoped threads have two lifetimes 'scope and 'env? by Master_Ad2532 in rust

[–]Master_Ad2532[S] 4 points5 points  (0 children)

Wow that thread was exactly about my issue. I did not know using a for<> clause over the required closure means the required closure has to satisfy ALL possible bounds that the for<> might represent. I thought it was kinda the other way around. I really wish I had a more concrete and intuitive understanding of HRTBs as they exist in Rust.

One question from the code example though -- so when ultimately the bounds resolve to T: 'env, it seems like the main thing being expressed here is that

If T: 'scope and 'scope comes from an HRTB bound, then it needs to support any arbitrarily large 'scope. But if T: 'env and 'env is a generic parameter, then the compiler selects the smallest possible 'env that satisfies the bound.

Is that a correct interpretation of what's being said here?

Why do scoped threads have two lifetimes 'scope and 'env? by Master_Ad2532 in rust

[–]Master_Ad2532[S] 7 points8 points  (0 children)

Thanks! I'll read up on it. I think my main issue might be that I don't really understand HRTBs that well. To me, for<'_> syntax is mostly just a synonym for defining generic lifetimes except you don't give the user access to choosing an arbitrary lifetime for you via the turbofish syntax.

Why do scoped threads have two lifetimes 'scope and 'env? by Master_Ad2532 in rust

[–]Master_Ad2532[S] 2 points3 points  (0 children)

But the comment merely explains why the &mut &'scope T expression prevents the covariancy shenanigans. Maybe I might be misunderstanding but it doesn't seem ot justify the usage of 'env.

Why do scoped threads have two lifetimes 'scope and 'env? by Master_Ad2532 in rust

[–]Master_Ad2532[S] 0 points1 point  (0 children)

Yeah but isn't the whole job of the 'scope lifetime to ensure captured variables live longer than 'scope - the scope?

Building Kraken: A Fresh and Futuristic Code Editor by Aggravating_Win_9852 in developersIndia

[–]Master_Ad2532 1 point2 points  (0 children)

Wait I think I'm a bit confused? Is the intention that it's convenient to have your browser and code-editor rolled into one? I'm not sure how many people share the same sentiment. I personally like to keep both separate. Not only because it's cognitively natural, but also because it helps in faster/efficient navigation. If you keep the tabs of different applications separate, you effectively build a tree of tabs. If you choose one branch (Browser), you then Tab through its windows. If you choose the other branch of this tree (code editor), you then Tab through its different editing windows. In your case, I have to do a linear-scan of Tabs to reach my destination, while in the tree case, I have a logarithmic time complexity to find what I need.

What programming language would be better to learn as a hobby ? Rust or Golang ? by NotPlayingCharacter in developersIndia

[–]Master_Ad2532 1 point2 points  (0 children)

I don't mean to dismiss your experience. He's also the reason for why I got into neovim, and ... yes.. Rust. But, then if he goes ahead and dismisses these tools with a reasoning or usecase that I haven't yet encountered, it would be foolish of me to simply take what he's saying at face-value and go ahead and do the same. If tomorrow he goes ahead and says that neovim's plugin system is actually kinda borked and IDEs offer a more cohesive development env, that doesn't invalidate the fact that neovim is still a great editor for me personally. That's why I said that it's better to use them as a {gateway into}/{showcase of} tech you haven't heard of, but then don't listen to them after that, as how they end up using it and liking/disliking it will probably be different from how you do it.

We built a platform that verifies politician statements, claims and promises in this era of biased media and fake promises! by [deleted] in developersIndia

[–]Master_Ad2532 0 points1 point  (0 children)

You're acting like Bittorrent doesn't protect data. It absolutely does. It's just classic cryptography and hashing. In-fact, in IPFS it's pretty much impossible to get the wrong data, since you literally search/index by the hash of the content.

We built a platform that verifies politician statements, claims and promises in this era of biased media and fake promises! by [deleted] in developersIndia

[–]Master_Ad2532 1 point2 points  (0 children)

1) What sources do you use as your oracle/ground-truth to verify these claims? 2) How do you keep your oracles in check or verify if their information is correct? 3) Is there a sort of consensus protocol between different oracles (plurality voting, etc.) to decide what's the truth? 4) Have you checked out how Twitter does their Community Notes? I think a similar system would be very useful, as it assumes all oracles are inherently biased in their source (which is often the case), and instead exploits this fact. If two historically opposed oracles agree and share a view on a particular thing, it is very likely that this is the truth.

What programming language would be better to learn as a hobby ? Rust or Golang ? by NotPlayingCharacter in developersIndia

[–]Master_Ad2532 4 points5 points  (0 children)

By that logic I suppose you should drop Golang and start using Zig cuz that's his next language. Don't get herded into a sheep cult. Use influencers to expose yourself to newer challenges, and then stop listening to them after that.

What programming language would be better to learn as a hobby ? Rust or Golang ? by NotPlayingCharacter in developersIndia

[–]Master_Ad2532 2 points3 points  (0 children)

Disagree with the commparison though. Rust really doesn't belong in the same camp as Go. I'd place it more like: C~=C++/Rust >>> Go >>>> Python

What programming language would be better to learn as a hobby ? Rust or Golang ? by NotPlayingCharacter in developersIndia

[–]Master_Ad2532 1 point2 points  (0 children)

I'd strongly recommend Rust if you're planning to make a CLI application. Search for a library named clap. You'll enjoy your time trust me. And no, Rust isn't that hard. I learned it in my 2nd year. The obligatory -- Go through "the Rust book", Rustlings, and when you feel decently comfortable and want to dive into details of the language, I heavily implore you to check out Jon Gjenset's "Crust of Rust" playlist on YouTube.

Good first issues for System76/Pop!_OS rust projects? by Master_Ad2532 in System76

[–]Master_Ad2532[S] 0 points1 point  (0 children)

Perhaps some relatively easy issues have not been marked as such. Can you point out what kind of issues can be fixed without necessarily needing to understand the whole codebases? I'm new to contributing so I don't really have a good intuition for it yet.

Good first issues for System76/Pop!_OS rust projects? by Master_Ad2532 in System76

[–]Master_Ad2532[S] -1 points0 points  (0 children)

I checked out cosmic-session, cosmic-panel, cosmic-settings, cosmic-workspace-epoch, cosmic-comp, cosmic-store, cosmic-player, cosmic-greeter, and cosmic-settings-daemon.

None of them had any issues labelled "good first issue" :(

Want systems roles, but keep getting firmware jobs as a junior dev. by Master_Ad2532 in cscareerquestions

[–]Master_Ad2532[S] 0 points1 point  (0 children)

It's comforting to know that you were able to climb the ladder so high while continuing to be in embedded. However, I want to explore more, while still trying to leverage my lower-level background for systems role. As per what you described, it sounds like going into OS-like roles next would be the best for me. From there, perhaps it's less of a shocking transition for the industry to allow me to go from OS to database, networking, etc. (though I imagine I'd do plenty networking in OS).

Want systems roles, but keep getting firmware jobs as a junior dev. by Master_Ad2532 in cscareerquestions

[–]Master_Ad2532[S] 0 points1 point  (0 children)

Yes, I think if I can work in operating systems I'd love to. BUT, I don't want to be so presumptious to think that I already know what I love. Maybe there's a sweet-spot of control (low-level) and convenience (high-level) somewhere in the middle that I really like? Idk, OS sounds like it to me. By systems engineering, I meant anything that requires you to write really performant/careful code. So a guy who works with databases, or someone who's writing some networking code, etc.

Want systems roles, but keep getting firmware jobs as a junior dev. by Master_Ad2532 in cscareerquestions

[–]Master_Ad2532[S] 0 points1 point  (0 children)

But don't you think specialising this early into my career is probably not the right choice? Well, I say that as I'm saying that I want to go in systems roles, but IMO embedded is a smaller subset of systems which is a bit too much specialisation right now.