• 4 Posts
  • 28 Comments
Joined 4 years ago
cake
Cake day: April 27th, 2023

help-circle



  • Let me ask a question, then: why were the Linux kernel and the Linux ecosystem written in C rather than Python?

    … because C is a systems langauge that you can use to build a kernel? While Python is an interpreted runtime that cannot target bare-metal?

    Rust can easily take the place of C, as Rust can also target bare-metal. It can do everything that C can do (perhaps aside from compiling to some very esoteric platforms). The reason Linux is written in C is cause C was the best option at the time, not because C is some magical language that can do stuff that no other language can.

    Also, just because Linux was written in C doesn’t mean it is the best-known, most famous or most widely used language. Python is much more well-known and widely used than C.


  • I don’t know where you’ve heard this, but none of it is true. Rust is definitely used for low-latency trading, and that’s actually one place where it really shines.

    sharing memory addresses across code intentionally having the same address written to and read from across threads. Something rust is sort of designed to not support.

    C++ does not “support” that either. C++ will let you write that code, but if you write code like that in C++, it’s undefined behavior and trust me, no low-latency trading firm wants undefined behavior in their trading software (just imagine what could go wrong…).

    Rust helps you avoid such issues. However, Rust definitely “supports” undefined behavior in the exact same way. If you want to share mutable pointers across threads and you don’t give a crap about undefined behavior… I mean, that’s really, really stupid but you can just write unsafe and then you can do exactly what you can do in C++ as well.



  • but no language can take the place of C

    Why do you say that? I definitely think Rust can take the place of C. Not just can actually, I’d go as far as to say that Rust should take the place of C. C is much too unsafe to be used in today’s age. There’s really no excuse to use a memory unsafe language today if you’re starting something new.

    It would not have been better if it was written in C. Rust is just as fast and much better.


  • I’m a professional software engineer writing Rust for many years now.

    Honestly, I am very happy that AI is using Rust. Much better that AI uses Rust than Python! If you think AI written Rust is bad, you have no idea how sloppy AI written Python is.

    Rust is a great language. Turns out the same stuff that makes it great for humans also makes it great for agents. This is not a bad thing, this is a win-win.

    Historically, Rust’s biggest disadvantage has been how hard the language is to write and how much you sometimes need to fight the compiler. This disadvantage is quite effectively mitigated by AI, since you can let the AI fight the compiler and write most of the code. So you get all the advantages that Rust brings with basically none of the downsides.

    I’m just happy that Rust was invented before LLMs. If Rust did not exist before LLMs, the code the AIs would be writing would be a lot worse.


  • You may not agree with how we raise our kids around these parts, but it sure does work better than what you’ve got going on, you fucking worthless American pussies.

    This is unnecessarily rude and derogatory towards many, many people, and not a tone we condone on Feddit.dk (see our site-wide rule 1). These rules also apply to you as a user when commenting in external communities. Please keep that in mind. We expect Feddit.dk users to be respectful in external communities, as we do not want Feddit.dk to be associated with bad behaviour.








  • I agree that dependencies and package management is a real problem in programming nowadays, but it is not a problem unique to Rust. In fact, I struggle to name a single popular language nowadays that doesn’t have the exact same problems.

    It’s not so much “But that’s not how you build stable software.” It’s more like “But that’s not how you build software [at all today].” Modern software is powered by loads of shared packages, that’s just how all modern languages work. This is equally true for Rust and Python.

    Rust still has the edge here btw. Rust libraries (crates) are often very high quality with very good documentation. The language again helps here a lot, by providing extensive tooling for automatic documentation generation. Documentation in other languages are is far less helpful or poorly written. This is also again something that helps an AI write better code (just as it helps humans write better code).

    The packaging also helps elevate Rust to a high-level language, because you can build easily usable abstractions in packages that can be used in simple programs. All the complexity can be hidden away in a crate and suddenly Rust feels more like Python. I think that’s actually a good thing from package managers.


  • Right now everyone is asking their AI agents to rewrite programs in Rust or C or assembly. This is fun, but it’s not a serious attempt at optimization.

    C or assembly seems pointless and only for performance. But the reason people (re) write programs in Rust is because Rust as a language has a lot of guardrails that help make a program more stable, more correct. That reliability is the real reason for Rust. The performance is just a cherry on top.

    This is actually exactly what you want in a language for AI. This is anecdotal from my side, but in my experience, an AI writing Rust will write far less sloppy crap than an AI writing Python.

    Most of the argument against Rust has historically been that prototyping is slow and the language is a bother to write because the compiler makes it hard. But this only holds if humans are the bottleneck for writing the code! Rust therefore has all of the benefits but basically none of the downsides when having an AI write it.