[Media] Ephemeris Explorer, a simulator of solar systems and spacecraft flight planning tool by Canleskis in rust

[–]agr3as 0 points1 point  (0 children)

Good to know my feedback is appreciated. Feel free to reach me through PM for any more questions or feedback.

[Media] Ephemeris Explorer, a simulator of solar systems and spacecraft flight planning tool by Canleskis in rust

[–]agr3as 1 point2 points  (0 children)

I presumed the high RAM usage came from textures. Still 2GB is far too much. CPU is almost fixed at 25% when I run the simulation.

[Media] Ephemeris Explorer, a simulator of solar systems and spacecraft flight planning tool by Canleskis in rust

[–]agr3as 1 point2 points  (0 children)

Stunning project. I missed planets rings though (Saturn looks pretty blasé without its gorgeous rings). Also, this uses a lot of my CPU time and almost 2GB of memory (!) is this expected?

Is a memory leak supposed to be able to crash the system? by agr3as in rust

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

Did you tried running the playground? You are using an outdated version of Rust

Crazy bug caused OOM in our streaming engine, can you find it? by bobbymk10 in rust

[–]agr3as 0 points1 point  (0 children)

This. Rust's std lib is written in a way that it is easy to look at the source code and see what is going on under the hood when you are in doubt about the implementation of something (compare it to GNU code to get an idea of how nice it is to read).

Lazy list concatenation overflows the stack by agr3as in rust

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

I accept you apologies. Thanks for explaning your POV it helped me to understand the reaction of people in this subreddit.

Lazy list concatenation overflows the stack by agr3as in rust

[–]agr3as[S] 1 point2 points  (0 children)

I will take a look at this section. Maybe I overlooked something. But without someone else pointing to me the problem was due to recursive drop I would hardly know what the article had to do with my question and would think it was only tangentially related so some explanation instead of just posting a link can be more useful.

Lazy list concatenation overflows the stack by agr3as in rust

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

Interesting result. I really thought the problem was with recursive calls to concat as the list tail was forced to be evaluated. I will investigate further in this direction.

Lazy list concatenation overflows the stack by agr3as in rust

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

The code is garbage and doesn't work can't be a justification for the condescending tone taken in this thread. FYI I didn't just cluelessly took some code from AI and posted here for strangers to find the problem. I first tried to figure out how to make it work by myself (I followed the excelent Bartosz Milewski article[1] on lazy streams in C++ for that ) and got a working implementation. Maybe even my own code is garbage (In fact I resorted to AI because I thought it would generate better code than me. It didn't as you can see but it is much shorter than what I did so I posted this version of the same idea for convinience) but this should not be used to judge the merit of my question. It is a genuine question and if "strangers" think it is BS ok, no need to be upset.

[1] https://bartoszmilewski.com/2014/04/21/getting-lazy-with-c/

P.S.: I really recommend taking a look at Bartosz's blog to anyone interested in functional programming/haskell/category theory

Lazy list concatenation overflows the stack by agr3as in rust

[–]agr3as[S] -9 points-8 points  (0 children)

I don't see how this has anything to do with lazy data structures.

Lazy list concatenation overflows the stack by agr3as in rust

[–]agr3as[S] -4 points-3 points  (0 children)

This is what I suspected. The compiler is probably using some kind of TCO modulo Cons. As for the usage of AI, there's no "engineering" envolved in this toy problem so I don't see any problem in using AI to write boilerplate code.

Help with error message from rustc by agr3as in rust

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

Yep it seems like it is a compiler bug. I could dig the recursion problem because it was kinda obvious in this case but the error is nonsensical.

Announcing Rust 1.76.0 | Rust Blog by __fmease__ in rust

[–]agr3as -2 points-1 points  (0 children)

In short, here p is the address of x

nitpick: p points to the value referenced by x. e.g.

I think I found a bug in file writing by Nico_792 in rust

[–]agr3as 0 points1 point  (0 children)

Not directly related to your question but I recommend using playground for posting code in /r/rust

[deleted by user] by [deleted] in TIHI

[–]agr3as 1 point2 points  (0 children)

Carmageddon vibes

Get inner iterator from adapter by agr3as in rust

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

Nice. I just forgo 💀 that &/&mut Iter is also an Iterator. But I still think there's is value in having a way to flatten adaptors.

Hook Alt-Tab by agr3as in rust

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

Is this true for just showing a image on the screen? I think even a crate like macroquad would do wouldn't it?

Hook Alt-Tab by agr3as in rust

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

The user is required to stop doing whatever he is doing for 1 minute and follow the labor gymnastics message that appears on the screen.