Hacker News new | ask | show | jobs
by stevefolta 667 days ago
Yeah, Rust is the language for people who think C++ is not complex (or hostile) _enough_.
1 comments

When I tried to read some rust, I was surprised on how much alien it is to mainstream languages and how convoluted the syntax is.
My experience (and I admit I may be too biased given years of prior C/C++ experience) is that Rust's syntax is a necessity, since no other mainstream languages besides C/C++ are as low-level as Rust.

Most mainstream languages have a GC, and don't support distinguishing between values on the stack or references, don't need to deal with lifetimes or don't provide the safety you get with them, etc.

I'm curious though, could you give an example of syntax you consider convoluted, and how you would do it instead?

How do you want to be taken seriously if you don't see the convolution of the syntax of c++ and rust? You are going against an absolute truth.
Oh, I absolutely see it.

My point was that it's necessary. How would you implement the same features Rust and C++ have, without garbage collection, but with simpler syntax?

So you are very careful not to depend on any of their toxic complex features. In the end, better not use them at all.

Even plain and simple C99 compilers can be reasonably written by a solo dev, so a motivated small team...

I do depend on their features, and I see the value in doing that.

For example, at $WORK I had to reimplement Apache's mod_rewrite.c in Rust, and I made it 100x faster for our particular use-case.

I could've done that in C as well, sure, but the simplicity of the C language just moves the complexity to the code itself; whereas, with Rust, I whipped out a prototype in just 3 days, and was able to freely pass around pointers to data, with zero allocations, zero copying, and every time it compiled I knew it was guaranteed to be safe.

You can't get that safety in C. You can't get that speed in Java.

You can't do this in any other language that does not have these features. I absolutely agree that the syntax is horrible... but I see no other way to achieve this.