Hacker News new | ask | show | jobs
by valenterry 1966 days ago
> But programmer ergonomics don't seem like a focus of their team currently.

Actually, maybe my post gave a wrong vibe. I like Rust and I think the team put a lot of effort into programmer ergonomics.

It's just that the language is focused on performance a lot and compete with C++. And so they sometimes make tradeoffs in favor of performance instead of expressiveness or simplicity.

That is understandable - but 95% of the projects I(!) have worked on don't need this - I can just give it a GB more RAM and a bit more CPU and write software quicker because I don't have to care about certain details.

> At least that's happened to me, maybe I am just dumb and mediocre though.

The fact that you used Rust probably puts you in the upper 10% - rough gestimation. I'm not telling you which 10% though. :P

1 comments

> It's just that the language is focused on performance a lot and compete with C++. And so they sometimes make tradeoffs in favor of performance instead of expressiveness or simplicity.

Yep, exactly my feeling. When I get back to writing Elixir at my $day_job I am just blown away how I can achieve most of the same results (for 100X less performance of course) in like 20x less coding lines... :( Not a direct comparison with a dynamic language is possible of course, but I too wish the Rust team starts sacrificing something for a bit more expresiveness and code conciseness.

> That is understandable - but 95% of the projects I(!) have worked on don't need this - I can just give it a GB more RAM and a bit more CPU and write software quicker because I don't have to care about certain details.

Both what you describe and hand-crafted and ruthlessly tested C/C++ code that's maximally efficient have their place. But I definitely don't belong the the "machine efficiency at all costs" tribe and I get worried at any potential signal that Rust is headed in that direction. Which it might not be. We'll see.

> The fact that you used Rust probably puts you in the upper 10% - rough gestimation. I'm not telling you which 10% though. :P

<Saruman voice> YOU HAVE NO POWER HERE!

...I mean, I am myself's worst critic. It took me a while to get comfortable with Rust and even if that means I am a below-average programmer, I don't care. I am taking my time and I can objectively measure that I am getting better with time there.

I still do agree that Rust does require time and persistence however. That is irrevocably true. Here's to hoping the team will make it consume a bit less characters (and thus typing) and improve the compiler and the tooling further. I am rooting for them with all my heart.

> I get worried at any potential signal that Rust is headed in that direction. Which it might not be.

I think they do - but that's good! We need a language like Rust to write operation systems, databases, proxys, webservers, hey maybe even browsers. All the things that are widely used and need to be high performant and secure.

Maybe you are using Rust, but you actually really want a different language, one that doesn't focus so much on low level / performance?

Haskell or Scala or F# come to my mind. I'm listing statically typed languages, because I assume you like those (otherwise, why Rust and not sticking to Elixir).

> Maybe you are using Rust, but you actually really want a different language, one that doesn't focus so much on low level / performance?

That is very possible. But utilizing my experience and intuition, very rarely have I seen such meticulous and relentless pursuit for efficiency and a compiler that will kill most of your bugs after it successfully compiles your program like Rust. Maybe Haskell and OCaml are it as well but they have plethora of problems that Rust doesn't have. Maybe Nim and Zig? Only heard good things about those but never tried them.

> Haskell or Scala or F# come to my mind. I'm listing statically typed languages, because I assume you like those (otherwise, why Rust and not sticking to Elixir).

Personal / professional development. I started with C/C++ and Java 19 years ago and moved to dynamic languages at least 12 years ago and I felt that I want to have such a powerful language like Rust in my toolbelt again.

I would say Haskell does a much better job but at the cost of much harder to predict performance.

Scala (which I use professionally) comes close to Haskell, but you need more discipline, because it has e.g. the concept of "null" and you have to avoid it.

What I like about Scala is that it has a sweet spot in the sense of a good number of jobs (way more than Haskell or Rust) and also having very good tooling (better than rust, not as good as Java though).

And Scala gives you this "if it compiles, it works" feel. But it has a steep learning curve.

I think F# is also great and underrated - same for OCaml. But because the languages are even more niche, they have less good tooling etc. What plethora of problems are you referring to btw?

Nim sounds exciting, but I've never used it either.

> I felt that I want to have such a powerful language like Rust in my toolbelt again.

If you are up for systems development, I would stick with Rust tbh. I think it will offer you some good job opportunities down the road and in general have a bright future. I don't think other languages like C++ or D can really compete with Rust in the long term.

Otherwise, I recommend to Haskell or Scala a try, depending on if you favor the learning experience or the practical gain.

> What plethora of problems are you referring to btw?

- Haskell: literal hundreds of possible combinations of compiler variants. Immediate turn-off.

- Haskell: several String types. I understand the lazy / non-lazy distinction but I can't understand why in 2021 you have C strings and UTF8 strings separately. I am not seeing much Haskell adoption in embedded contexts where every byte counts. Felt like a meaningless academic pursuit and not a practical concern.

- OCaml: lack of actual parallelism. I am following the Multicore OCaml monthly reports but at this point I accepted that it's best to just wait for OCaml 5.0 which promises it will have Multicore baked in (earliest timeline: end of 2021, so I don't know likely mid-2022?). Also I don't like the mixed paradigms. Even if I would appreciate using a `for` loop every now and then I think I shouldn't be given that freedom. But that last one is a minor gripe actually.

- OCaml: strings again. Having UTF-8 strings there is a challenge. In 2021 there is absolutely no excuse to introduce friction on such topic. UTF-8 strings must exist. I know I can use the libiconv bridge and it's not what I am talking about. I am talking first-class support.

- Haskell and OCaml tooling felt behind excellent tools like `mix` (Elixir) and `cargo` (Rust) but I hear that they are constantly improving and are easier and more intuitive these days. Hope my impressions are outdated there!

There were others but I only managed to remember those above.

Ah yeah, the Haskell problems you mentioned are indeed annoying. However I think the compiler extensions are actually not a bad idea. Haskell is an old language and the extensions allowed it to improve over time.

Languages like Rust or Go will find themselves in a spot where improving the language will become hard - same for Java and look how slowly the language improved and improves still.

Can't say so much to your remarks about OCaml, but was interesting for me to read.

So, why not try Scala or Crystal? :)