←back to thread

517 points bkolobara | 1 comments | | HN request time: 0.2s | source
Show context
misja111 ◴[] No.45049536[source]
Come on, the author is comparing Rust to Typescript, Zig and Python, and then concludes that Rust becomes more productive in larger codebases compared to 'some other language'? Could it be that those 3 languages were not really designed with large (backend) codebases in mind? To do a fair analysis the author should have compared with a language like Java, Scala or C#.

About the article itself: the part of wrapping a structure in a mutex because it is accessed concurrently is a bit of a red flag. If you are really working in large codebases, you'd like to avoid having to do that: you'd much rather encapsulate that structure in a service and make sure all access to the structure is queued. Much simpler and less chance for nasty deadlocks.

replies(1): >>45049561 #
Ygg2 ◴[] No.45049561[source]
> To do a fair analysis the author should have compared with a language like Java, Scala or C#.

Wouldn't that be unfair to them? They still use null or Nullable. They don't have ADTs, their thread-safe invariant is maintained by docs, etc.

replies(2): >>45050052 #>>45050252 #
misja111 ◴[] No.45050052[source]
Maybe. But at least these languages were meant for large applications so the outcome of the comparison would be more meaningful.

Apart from that, Scala uses the Option type instead of null, and it has ADT's; And I dont know about C# but in Java and Scala using low level mutexes is considered a code smell, the standard libraries provide higher level concurrent data structures.

On top of that, Scala provides several widely used IO frameworks that make dealing with concurrency and side effect much more simple and less error-prone, it would win the comparison with Rust here.

replies(1): >>45050734 #
Ygg2 ◴[] No.45050734[source]
> On top of that, Scala provides several widely used ...

With Scala is less what you miss, and more what you have.

- Custom operators. Those are great for DSLs and rendering your code to look like utter gibberish, and confuse IDEs.

- SBT. Shudder.

- Scala 2 codebases.

replies(1): >>45052725 #
misja111 ◴[] No.45052725[source]
Your first 2 are good points. Your last point is of course not relevant when you're considering which language to pick for your new enterprise application.

Anyways, IMO it would have been much more interesting and useful to compare Rust with Scala/Java/C#, whatever the outcome of the comparison would be.

replies(1): >>45056283 #
1. Ygg2 ◴[] No.45056283[source]
> Your last point is of course not relevant when you're considering which language to pick for your new enterprise application.

Sure I might be writing a new app, but what if some dependency is Scala 2.12-?

As for your latter point. I still think Rust would be more productive than all listed. I would expect Scala might give Rust the biggest run for its money. C# could probably be closest to Rust perf wise. Or not. Depends on the workload.