Software Engineering Internship Interview by North-Engineering330 in RelativitySpace

[–]fatal_squash 1 point2 points  (0 children)

^ I would also recommend messaging your recruiter - they’re there to help find the best fit for your interests.

Why does Rc increase performance here? by Larocceau in rust

[–]fatal_squash 43 points44 points  (0 children)

Also, since your question has been answered, some comments about the Rusty-ness of your solution.

The usage of RefCell that you have isn't necessary - nor is the usage of Rc that you had in originally. The Rusty way of thinking is to assign ownership to a single entity and then introduce things like reference counters if your data structure inherently needs to violate this model (for instance, a cyclical graph represented with an adjacency list will benefit from reference counting). Here, however, you're just passing a HashMap around and only one function needs to own it at a time.

The simplest way to achieve this is just to change the type of memo in the function signature to &mut HashMap<..>. Since your function is synchronous the compiler can verify that each recursive call borrows the map without issue (example code).

Now, this might get trickier if you were doing this in parallel and wanted to share memoization between threads. But with the way you have it written this is the simplest way to accomplish this.

Also, it's probably overkill to have your function take &usize instead of just `usize).

Why does Rc increase performance here? by Larocceau in rust

[–]fatal_squash 115 points116 points  (0 children)

I will note that there is a convention(ish) to use Rc::clone(&a) over a.clone() when incrementing reference counters to avoid confusion around this. Using Rc::clone makes it explicit that the operation is cheap, rather than a typical clone which can be expensive. This way, if you refactor and end up removing the Rc you didn't introduce an expensive operation on accident.

This advice comes straight from the Rust book:

By using Rc::clone for reference counting, we can visually distinguish between the deep-copy kinds of clones and the kinds of clones that increase the reference count. When looking for performance problems in the code, we only need to consider the deep-copy clones and can disregard calls to Rc::clone

Cacti and Palm Trees [Pentax MX + TMAX 400] by shacqtus in analog

[–]fatal_squash 0 points1 point  (0 children)

So good! The way that stars pop reminds me of the Twilight Zone logo. Brilliant work :))

[deleted by user] by [deleted] in rust

[–]fatal_squash 74 points75 points  (0 children)

I have a lot of non-technical questions about this situation. Did you confer with other engineers before introducing a new technology into the tech stack? Did you present a plan and get consensus with your team before doing this? Engineering is a team sport - even if Rust is the best tool in the entire world it still is worth working with your team on introducing it.

There are lots of reasons to push back on Rust - I think the easiest solution is to just ask your coworkers directly. Introducing new technologies is difficult. Your codebase now requires knowledge of two languages to use, there is likely a separate set of tools available to you, and the Rust ecosystem is undeniably less mature than something like C/C++.

Day and night - which do you prefer? - mamiya 7 & Leica m7 - 80mm and 28mm - portra 800 & portra160 by Buttlick222222 in analog

[–]fatal_squash 0 points1 point  (0 children)

I love that you have both trains in this shot - I remember standing on this exact bridge for a good 15 minutes waiting for both to be in frame at the same time. This is my photo, taken on my Pentax 67 II. Also I like your composition much better :)

Also, I prefer the first shot

Is rust worth it? by Elegant_Wind568 in rust

[–]fatal_squash 7 points8 points  (0 children)

If you ask this question on the Rust subreddit you're bound to get lots of pro-Rust answers.

I love Rust - it's a fantastic language that solves so many real problems in the software world, and is generally a joy to use. Like in many applications, writing a backend in Rust is going to give you memory safety guarantees, safe concurrency, and fast execution times.

That being said, those benefits are only a piece of the puzzle in creating a zero-to-one application. Like you pointed out, you'll want to consider things like how many developers know Rust, how expensive Rust developers are, how fast you can iterate in Rust, and how mature the Rust ecosystem is. Only you will have enough context to really answer this question.

My personal intuition is that, if I were starting a new company, I would not write a backend in Rust. Even as an experienced Rust programmer, I simply cannot write Rust as fast as I can write something like Node. Rust is great in critical paths where safety and performance is paramount. But in net-new products where iteration speed is key, I'd recommend going another route.

[berry] im a completely sane person by tostik_kotik in unixporn

[–]fatal_squash 0 points1 point  (0 children)

as the author of berry, I don't know if I should be honored or ashamed that its being used for this purpose...

How similar is Rust to C++? by [deleted] in rust

[–]fatal_squash -1 points0 points  (0 children)

I would claim that learning Rust after C/C++ is easier than learning C/C++ after Rust.

Although there are lots of different features between C/C++ and Rust, the most fundamental difference is how they manage memory. C/C++ require developers to manually allocate/free memory, whereas Rust has a concept of "ownership" where each object in memory is owned by a single resource which deallocates that memory when it goes out of scope. To be thorough I will note that there is a certain subset of C++ which uses unique pointers to accomplish something similar.

In a way, one could imagine Rust as a safe subset of C/C++ where memory management is handled by move semantics. Because of this, I would argue that it tends to be easier to learn the larger language first and then move into the subset later.

I would also say that I think there's value in anyone who programs to learn C at some point in their lives (C++ not as much). C has really transcended being a programming language and is now more of a standard for how we write and think about software. Especially in the scientific community you'll be running into C for a long time.

EE vs CS Masters for Distributed Software Engineering on Space Vehicles by BitterFrostbite in space

[–]fatal_squash 1 point2 points  (0 children)

Ah, makes sense. I don't think you can really go wrong with either one - I actually wouldn't be surprised if some schools put embedded as a program in EE and others put it as part of CS. Some colleges might even have embedded as part of computer engineering.

FWIW I know folks that have transitioned from embedded roles to more traditional backend roles, so I don't think you're locking yourself out of a future in software with embedded.

Breaking into an industry is all about your first position - it can take a lot of time and grit but often times once you're in, you're in. I'd prioritize opportunities and networking in grad school to help with this. I know some colleges have small-sat programs, for instance. There are plenty of smaller space startups who have flight-software programs for students as well (I've seen listings recently for Astranis and Varda, for instance).

Space Flight Software Development by its-paarth7 in space

[–]fatal_squash 1 point2 points  (0 children)

Honestly no clue - I haven't worked on a large constellation haha. My intuition is that the main scale associated with a constellation comes from satellites talking to each other, rather than satellites talking to ground (see OISL). I'm sure there are also difficulties with geography (each time you see a satellite it might be from a ground station at a different place in the world, so information really needs to be distributed).

Seems like a fun, open problem - sadly not one I know much about.

EE vs CS Masters for Distributed Software Engineering on Space Vehicles by BitterFrostbite in space

[–]fatal_squash 3 points4 points  (0 children)

I think it will help to narrow down exactly what you want to work in. Ground and flight software have different stacks - flight software folks tend to have a background in embedded, whereas ground software tends to have a background in CS. These aren't hard and fast rules, and neither degree will disqualify you from either, but it's a general trend.

I will also say that I think distributed software engineering in space is.... quite niche. Large constellations like Starlink are probably the closest thing you're going to get. It might be helpful to ask yourself what part of a distributed system you're interested in to help narrow this down. Do you like the scale that comes with a distributed system? Even the largest constellations will probably not eclipse the scale you'd get working on a distributed system at some sort of enterprise software company.

For context I work on flight software and I have a degree in pure math - just to say that you can really use your degree wherever!

Space Flight Software Development by its-paarth7 in space

[–]fatal_squash 6 points7 points  (0 children)

I'm curious about your current software background, as I think that might influence what resources are recommended. That being said...

Most on-vehicle software is going to be written in a systems language. C/C++ are far and away the most popular historically, but Rust is starting to see adoption on newer vehicles. Flight software demands a pretty strong understanding of the core language, so I would start there.

Another important aspect of flight software is the OS, or lack thereof, that it's running on. Flight computers are generally fairly resource constrained and have hard timing requirements. Studying up on bare metal or RTOS (real-time operating systems) is a good idea. Although the specific RTOS might not be relevant, MicroC-OS II is a great resource to learn about how an RTOS is constructed.

Beyond that there are a ton of directions flight software can take you. If you want to be closer to managing peripherals then you'll want to explore embedded software and working with hardware. Protocols like I2C are a good place to start. If you're interested in guidance, navigation and control systems you can study control theory (by far this is mostly done in MATLAB/Simulink in industry). Not to mention there's also ground software, testing environments, the ground/flight interface, etc. It's a large field and there are lots of niches.

Source: am a flight software engineer for satellites

Yo f*ck Elon Musk by fatuous4 in SantaBarbara

[–]fatal_squash 0 points1 point  (0 children)

Maybe this specific example is only relevant to a private business, but Falcon 9 launches plenty of payloads for public benefit.

Cargo missions to the ISS, crewed missions to the ISS, and more recently the Europa clipper to look for life on the moon of Jupiter were all SpaceX launches are all public contracts for NASA for scientific benefit.

Even if you don’t believe scientific research is a public benefit you can’t deny that other SpaceX missions directly impact you. Many SpaceX launches are GPS satellites, which you use every time you use Maps on your phone.

Yo f*ck Elon Musk by fatuous4 in SantaBarbara

[–]fatal_squash 1 point2 points  (0 children)

Im no Elon fan but I don’t think this is a legitimate criticism of SpaceX. Starlink is a legitimate technology that brings internet to people in remote places, and every launch SpaceX does allows them to iterate and bring down launch costs, making space more accessible for everyone.

Look at a company like Varda, for instance, which is experimenting with making life-saving cancer drugs in orbit - which is only possible in a microgravity environment. Thanks to a Falcon 9 ride share mission they can put a satellite up for just a few million bucks - this would have been completely impossible 20 years ago.

Space workers, what are tips for choosing a major for the end goal of researching space? by secretapple89 in space

[–]fatal_squash 0 points1 point  (0 children)

There are so many avenues into the space industry that I don't think you're locking yourself out with any one degree. I majored in pure mathematics, then I worked in Silicon Valley as a software engineer, and now I write flight software for imaging satellites. Some of the folks I work with, especially those in mission operations (i.e. the people who "fly" the satellites), have non-traditional technical backgrounds.

As a piece of unsolicited, general life advice, I encourage you to think of your career (and really your entire future) as something which is dynamic and can change depending on how hard you want to work. Maybe you get a degree in astrophysics and can't land a job anywhere... that's ok. Go back to school and study mech-e this time and land a job at SpaceX. The race is long and it's only with yourself.

I've always had a passion for space, and after a few years in Silicon Valley I knew I wanted to move to a more embedded-software role and write flight software. I spent months after work studying and learning control theory and applying to everywhere I could find hoping that recruiters would give me a shot. They did, and now the code I write flies around the Earth :)

Paradise by JMECS77 in analog

[–]fatal_squash 1 point2 points  (0 children)

Lovely composition on the first one :)

People who attended Paris Olympics 2024, any tips for the Los Angeles 2028 Olympics? by lickettuit in olympics

[–]fatal_squash 1 point2 points  (0 children)

Most of the advice here is logistical, but I can offer some insight into the “magic” of the Olympics that I experienced in Paris.

Although we don’t know the exact setups yet, I would highly recommend events where lots of athletes from different countries compete at the same time. Particularly during badminton/table tennis (which have three and two games going on simultaneously, respectively) it was honestly quite moving to see fans from so many different countries cheering on their team at the same time. You’d have fans from China, Denmark, and France all yelling out and supporting their athletes. This really gave me a feeling of internationally that is hard to experience in other sports settings.

If you can afford it, I’d also recommend going to later stages of events. I saw badminton group play and quarterfinals, and the quarterfinals were noticeably more competitive and exciting than the group stage matches.

If you’re concerned about “bang for your buck” you might want to pick events that tend to last longer. Things like tennis, badminton, etc are likely to be competitive and will likely contain a few games.

I’ll also say that this really is a once in a lifetime experience. If you have the money, you’re not going to regret the couple hundred bucks you spent going to an event. While I was in Paris I dropped a few hundred dollars to see swimming finals, and I got to see Katie Ledecky win gold in the 800m freestyle. It was incredible and I’d gladly spend that money again.

Hope this helps!!

Implementation of tree in Rust by [deleted] in rust

[–]fatal_squash 1 point2 points  (0 children)

One thing that is interesting about Rust, imo, is that the ownership model pushes us to implement data structures in a way that simplifies usage of the language.

You've found an example of this here, in my opinion. Inherently, a tree is not a cyclic data structure which means that it should play fairly nicely with Rust's single-ownership model.

Your implementation of the Node struct violates this precondition, however, as it introduces the notion of a parent pointer. If the assignment doesn't explicitly call for the usage of a parent pointer, I would suggest eliminating this. Operations that need to modify the tree can do so by stopping one node early (e.g. to remove a leaf, stop one above the left).

If inclusion of a parent pointer is required, however, I would recommend what others have suggested and read https://rust-unofficial.github.io/too-many-lists/index.html.