Hacker News new | ask | show | jobs
by stevepeg 1470 days ago
Author here: lots of usual language-war type comments here. Just thought I'd add my own little bit of water (hopefully).

In my post notice that aside from my personal background with programming I didn't go into detail about memory safety, which seems to be what many are debating. Frankly, it's not even one of my top reasons for praising the language. If I had to pick three these are what I'd choose:

1. Strong features for describing real-world issues in software. Here I'm talking about things like tagged unions (enums). They let you describe so much very cleanly. Use a match expression on it and you can be sure you've handled it pretty well. These lead into the stdlib's Result and Option types which extend what I said further.

2. Excellent performance without any fancy language stuff like annotating lifetimes. Using the Iterator trait you can chain up a really nice operation FP-style and get ridiculous performance. It takes fewer lines than idiomatic Python.

3. Excellent tooling. Cargo is easily the best package manager I've used (yet, someone show me better!). When doing async work the tracing crate is great, it automatically handles all the entry and exit points of the state machine that gets generated. You can also use tools like tokio-console on it, or export via opentelemetry.

2 comments

So, F# with NuGet/Fake, Scala or Kotlin with Maven/Gradle, OCaml with OPAM.

Those points are hardly Rust specific and apply to any compiled language with ML influences.

From the official "Maven in 5 Minutes" tutorial:

    mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
From the official Rust lang book, Cargo section:

    cargo new my-project
I guess it's a matter of taste...
I think it's worth making the distinction between Maven as a build tool and Maven as a package manager, because the latter I think does work quite well.

I've had enough maven for a lifetime. Too much time spent fiddling with settings.xml files and m2 folders, debugging builds in enterprise environments with dozen module projects and a mix of internal and public dependencies.

Now I guess you debug config.toml and build.rs files all the way up to ~/.cargo.
My IDE does that for me, you are looking at the wrong tree.
Just use `gradle init`. Even that long maven project gen command can be simply hidden by a shell parameterized alias
No disagreement here. My post is a praise of Rust, not "everyone must use Rust!". These languages and tools are also great!

(edit) added 'tools'

Maybe you should retitle your article "Why Rust is one of many great choices for startups"
These comments are still in context of using the language in a startup. Good luck with finding Ocaml, F# or Scala devs.
There are much more Scala devs than Rust devs.
Sounds like a bold claim to me, let alone the "much more" part.

Have you got any data to support it ?

Well, it is hard to get a true picture without some probably paid data, but Scala has been around for longer (especially if we only look at the time when the language was reasonable well known), and I know plenty of companies that have significant Scala code bases even from the top of my head. Rust, not much. Of course I could be dead wrong, but I think as of now Rust has more hype than actual code written in it (but it is not baseless hype, imo the language actually lives up to it so its usage will likely grow faster than Scala’s)
Do you want to discuss market share?
For point #3, take a look at Hex[0] which is a package manager for the erlang/elixir ecosystem.

[0] https://github.com/hexpm/hex