Since programming is increasingly offloaded to LLMs and English is the main way engineers interact with code, it's interesting to see how LLMs reason in different programming languages. In our benchmarking, we've found LLMs perform comparably between languages for one-shot coding submissions, slightly favoring more popular languages. But if you give frontier LLMs a harness and let them iterate / fix compilation error…
Anecdotally I think AI is quite good at langs with lots of training data: C#, TypeScript Rust. I also think it's much better with languages with more guardrails and clear syntax: think expressive types (sum types), brackets, and linters / compile checks. Rust has expressive types and lots of compile checks to avoid classes of bugs via ownership / lifetimes and I think makes it a very good tool for agents to use.
High-Level Rust: Getting 80% of the Benefits with 20% of the Pain
81–90 of 122 posts
Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain
#82Earlier quoted context omitted.
Kotlin is a few tweaks on top of Java, most of which aren't relevant anymore, and it's not strictly better in most ways other than saving a few keystrokes (and preference). It's a little bit nicer to write but that's almost irrelevant. It also comes with some runtime cruft. In reality there is no Kotlin without Java, which means most projects end up a bit 'dual'; every single Kotlin project we've had (except Android)…
There definitely is Kotlin without Java, and you can compile Kotlin code for use in jvm, ios/ipados/macos, android, wasm/js, and native.
Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain
#83Earlier quoted context omitted.
It's not ARC though. They use fancy threading mechanisms to avoid having to check on every access. Much faster.
"Swift uses Automatic Reference Counting (ARC) to track and manage your app’s memory usage." https://docs.swift.org/swift-book/documentation/the-swift-pr...
... which is what I thought people were referring to.
Yes - it's ref counting, but it's not like 'Arc' at all - ARC is way more thread aware and most 'access' doesn't have to do thread checking. Much faster.
So - using Rust 'Arc' would not be at all like using Swift 'ARC' in the end.
Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain
#84Earlier quoted context omitted.
That's because it's structurally typed (as opposed to nominally typed). I don't happen to prefer it, but I don't think it's fair to conflate that with unsoundness like the example given above; it's totally possible to have a sound structural type system. TypeScript doesn't happen to be sound, but it's not because of that.
Structural typing is great. It's the verified version of duck typing.
Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain
#85Earlier quoted context omitted.
> Scala is comparable in popularity to Go or Rust Do you have any numbers to back you up? That statement sounds very, very wrong to me
Not good ones, and Scala devs are keenly aware they have been going in the wrong direction compared to Go/Rust, in part because of articles like this. RedMonk shows Scala is comparable to Go and Rust [0] You can see in this chart which plots the number of projects on Github and tags on StackOverflow (ha ha.) The upper right most cluster has the most popular languages (C++, Java, Python, JS, PHP, TypeScript) then the…
Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain
#86Earlier quoted context omitted.
> C# [...] only really works properly in Windows What do you mean with this? Maybe you are thinking of the old ".NET Framework" runtime, which only runs on Windows? Nowadays there is ".NET Core" which runs on macOS and Linux as well.
Even om Windows .NET does not work properly with mySQL and Postgres it only really works properly with Microsoft MySQL-Clone or I don't know the official name.
Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain
#87Earlier quoted context omitted.
For the use cases outlined in the OP, a 36% performance gain for an optimization that complex would be considered a waste of time. OP was explicitly not talking about code that cares about the performance of its hot path that much. Most applications spend 90% of their runtime waiting for IO anyway, so optimizations of this scale don't do anything.
Adding a few borrows and annotations is not "an optimization that complex"; use Arc at first but then find those bottlenecks via profiling then fix them.
For most cases you will still be comfortably in the JVM/golang performance window.
Rust is great language, fighting the borrow checker sucks, don’t do it if you don’t need to.
Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain
#88Earlier quoted context omitted.
Pretty sure by devx they mean something like syntax ergonomics. Because otherwise rust's devx first class (cargo, clippy, crates.io) so kind of a nonstandard definition. I think it's fair to say Java's "syntax ergonomics" are a little below the rest / somewhat manual like rust or C++ by default.
Yeah, but worse than Go?
Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain
#89Regarding TypeScript: > but types lie at runtime (unsound) requiring you to add your own runtime checks. I don't recall doing that outside of situations when data is crossing system boundaries. The vast majority of languages have an unsound type system, yet people are productive in them. Over the years I've come to realise it's a form of nitpicking. You absolutely need it in some applications, but it's not an importa…
Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain
#90I program almost all languages except C# and Rust haha. So someone looking for the perfect languages while actively using the only two languages I actively avoid is very strange to me. C# has close to zero community and only really works properly in Windows which is far past its glory days. Except for Microsoft aggressively pushing it as a Java alternative it has no right to exist. Rust is an overcomplicated subset o…
Haven't had anymore issues programing in C# on Linux than on Windows (if not less).
Rust certainly isn't as complicated as C++, and the complexity over C is well worth it, specially given the better ergonomics. Writing properly safe code on C or C++, however, will basically have you emulate the Rust compiler through tooling or inside your brain, which bears its own complexity.
Don't get me started on the PHP/Rust comparison, what is even the similarity here?
This just reeks of bad faith.