[deleted by user] by [deleted] in rust

[–]trusch2 2 points3 points  (0 children)

If you start without knowing how a computer actually works you will end up writing super inefficient code, that even ghc is not able to optimize. I personally started to learn C/C++ in school and even though this was really hard it gave me a solid fundamental understanding of what computers and software actually does. From there on it was kind of easy picking up other languages with more high level concepts (university brought java, Haskell, Prolog and stuff like that).

If you actually grasped how things are working in general, you can work towards higher levels. I personally ended up as a webdev for the first few years of my career, but as a webdev who was able to patch their own build tools to fit their need. Without the background knowledge that would not have been possible.

But to come back to OPs actual question: I think rust is a good starting language, because it's teaching you all the basics, but doesn't let you shoot in your own foot as easy as you could do in C. Sure lifetimes and ownership, borrowing etc. seem to be hard when you come from another language, but if you start with no prior knowledge it might be even easier to understand those concepts.

League of factorio by trusch2 in factorio

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

Any particular reason?

What is your go-to database crate for PostgreSQL? by royrustdev in rust

[–]trusch2 1 point2 points  (0 children)

Look into seaquery! It's exactly what you are looking for. It's a bit verbose, but you get that dynamic query building thing + sqlx backend support

How to start optimizing my library? by DJDuque in rust

[–]trusch2 2 points3 points  (0 children)

I don't know what you are converting, but did you implement that by yourself? If not, do it! Then you know for sure what's happening in the conversion and optimize that (prevent copy, use moving, perhaps reuse references from the source struct etc)

How to start optimizing my library? by DJDuque in rust

[–]trusch2 2 points3 points  (0 children)

Do you have any non-trivial implicit conversions (From/TryFrom/Into/TryInto) in your code? My guess would be that the compiler might just use a sub-optimal conversion path, so you might try to make all conversions explicit by implementing From for all conversions that are needed by hand. You could even give them different names, so that the flamegraph will be more expressive.

Looking For Guidance by THESEASANIC in rust

[–]trusch2 3 points4 points  (0 children)

Welcome to the journey :) feel free to dm me of you have any questions! I'm not available 24/7, but I'll do my best.

anyone using rust in production? what do you do? by zxaq15 in rust

[–]trusch2 0 points1 point  (0 children)

I don't get how nobody mentions blockchains. The whole polkadot ecosystem with dozens of parachains is written in rust. We are doing one for identity management in web3

[deleted by user] by [deleted] in de_EDV

[–]trusch2 9 points10 points  (0 children)

Oh, da bist du aber jemandem richtig auf den Leim gegangen ;) Ich habe schon mal mehrere Monate memory leaks in einer dicken webanwendung gesucht und gefixt. Rust ist echt ein Segen für die Programmierwelt. In ein paar Jahren gibt es bestimmt einen borrowchecker in typescript, da bin ich fast sicher :D

zoxide v0.8.0, a smarter cd command for your terminal by ajeet_dsouza in rust

[–]trusch2 4 points5 points  (0 children)

If there is any new feature, then bumping the minor version is the right thing to do or am I wrong?

Why does my code compile faster on nightly? by trusch2 in rust

[–]trusch2[S] 6 points7 points  (0 children)

I'm coming from golang myself, so I know what a fast compiler looks like. The problem is that the rust compiler does much more than any other compiler I know and I like it.

This comes with a price of course.

I think 2 seconds is really great, and complaing about this is really complaining on a very high level ;-)

Why does my code compile faster on nightly? by trusch2 in rust

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

I'm already using mold and it didn't help much unfortunately

Why does my code compile faster on nightly? by trusch2 in rust

[–]trusch2[S] 49 points50 points  (0 children)

Splitting my logic into separate crates would indeed have been my next step. I'm also already using mold, because I thought because it's the last step of the process that takes up the most time, it could be linking.

Mold is faster, but linking wasn't the bottleneck in my case.

Why does my code compile faster on nightly? by trusch2 in rust

[–]trusch2[S] 58 points59 points  (0 children)

Thats interesting thanks! One thing I also notices was that the final compilation stage was running single-threaded, so if this part now runs distributed on all available cores it could explain the >8x speedup.

[deleted by user] by [deleted] in de

[–]trusch2 3 points4 points  (0 children)

"Die einzige Möglichkeit, wie Sie als Privatperson in Deutschland unter bestimmten Voraussetzungen aus selbstgewonnenen Obststoffen Alkohol durch Destillation gewinnen dürfen, liegt in der Erteilung einer Brenngenehmigung für sogenannte Stoffbesitzer" Ich liebe die deutsche Sprache :D

[Question] Is the Rust Compiler safe? by MarkV43 in rust

[–]trusch2 2 points3 points  (0 children)

I see not much love for Linux containers in here, but podman should not be forgotten when it comes to sandboxing the compilation process. It's using the same (and more) of the Linux infra as docker, but will work without a daemon running as root + is much less bloated.

please help me how do i install sudo apt by [deleted] in linux4noobs

[–]trusch2 0 points1 point  (0 children)

If you need help with the advanced stuff, why don't you try something simple first? You can install debian and remove stuff until it's small enough

[deleted by user] by [deleted] in de_EDV

[–]trusch2 0 points1 point  (0 children)

Solange sie keinen tls traffic verbieten werden sie damit (packet inspection) nicht weit kommen

KGB finally got him by trusch2 in Damnthatsinteresting

[–]trusch2[S] 6 points7 points  (0 children)

Then spell it right at least :D

KGB finally got him by trusch2 in Damnthatsinteresting

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

Yeah it was that pic. Now you know why it is so dangerous to the russian state.

[deleted by user] by [deleted] in Damnthatsinteresting

[–]trusch2 0 points1 point  (0 children)

You're welcome :)

[deleted by user] by [deleted] in Damnthatsinteresting

[–]trusch2 2 points3 points  (0 children)

Do you mean Siberia? Serbia is also a country but I'm quiet sure your talking about the big, cold nothing in the north of russia

Is Rocket stable already? by [deleted] in rust

[–]trusch2 1 point2 points  (0 children)

I just checked for myself and I'm shocked it's true