Rust debate thread

So a while back I decided the C++ project I'm working on should really be using fixed size integers. I settled for changing
>typedef unsigned uint
to
>typedef uint_fast32_t uint
I can't remember if that type actually guarantees a size of 32, but it didn't work with GCC regardless, uint was already typedefed and I couldn't find any way to change it.

What most people really want is i32 and u32, and this minor design flaw (imho) was enough to give me the itch we all get occasionally to find a replacement for C++.

So I'm reading through the Rust documentation and decided I'd enjoy posting my comments here and seeing what people have to say, since I don't have any programming friends.

> Cargo qua build system
THANK. FUCKING. GOD. Writing page long build scripts really is a waste of time.

> Cargo qua directory convention
Also seems pretty nifty, but I'm not completely sold yet.

> static linking by default
You can fuck right off with this one. That's some stupid shit right there.

> Bounds checking
At least in the basic documentation, it's not nearly clear enough how much of this is kept in the release executable, or how to control whether it's on or off. I like the idea, but defer judgement until I understand exactly what it's doing.

> scalar typenames
Once again: THANK.FUCKING.GOD.

> declaration syntax
Seems verbose. I prefer mutable default to constant default.

> Use of semicolon for expression vs. statement
I like it. Seems a tad clearer.

> Optional return keyword
Very obnoxious and hurts readability.

> Parens not needed around if condition
Awesome, less pointless typing.

> Macros end with !
This might be my favorite thing about the whole language. Macros are awesome for writing concise, DRY, code, but not marking them explicitly make creating refactoring tools harder, and hurts readability.

> == for equality comparison
WHY??? FUCKING WHY??? Am I the only one who still constantly writes "if x = y" on accident even after years of programming?

Other urls found in this thread:

glot.io/snippets/ertc8vw9dh
twitter.com/NSFWRedditGif

Shut the fuck up with your meme language for noobs.

Shitty argument. C++ has tons of cruft and flaws, and no one has made a better language yet.

If you aren't interested in that happening, then you're a noob who has never tried writing a complex enough piece of software to want compile time reflection or a variadic function.

It appears this board no longer has even remotely competent programmers, just faggot children whining about their gaming keyboards. What a shame.

>claims to be a competent programmer
>rants about semicolons, return syntax, and other kinds of bikeshedding fodder
awful b8 my dude

>>typedef unsigned uint
>to
>>typedef uint_fast32_t uint
Use nim
glot.io/snippets/ertc8vw9dh

If language syntax isn't interesting to you, and apparently it isn't interesting to anyone here, then this is going to be a boring thread.

I haven't even gotten to the meatier part of language, so yeah, these might not be the best part of the language to talk about.

Unfortunately, it looks like people here are a lot more interested in delusionally satisfying their superiority complexes than talking about code. So I'm out. Stupid idea to think intelligent people might be lurking on Sup Forums anyways.

I think Rust changes too much. A cleaner C++ replacement would be nice, but it'd still fundamentally be C++.

>intelligent people
>Sup Forums
cmon m80.

Either way, I have never wrote super duper hurr durr programs on C++ a side from some small modules that integrate with python and JS for personal use.

I find that solving problems is easier if I spend more time on the actual problem than type checking & compiling, but that's mainly because I'm a college student and my deadlines are sometimes as small as 3 days.

Moving to the topic of syntax, I don't dislike C++/C syntax I actually find it really comfy mainly because most languages I've used have similar syntax (except for Haskell). I'm starting with Rust and syntax is a bit weird but again not far from C.

For what I've learned Rust is more about code safety and less bugs, in which immutable default makes sense, I'm liking it since it seems to perform really well on most benchmarks and a claimed 80% bug reduction looks remarkable.

Yeah, that sums up how I feel about it pretty well.

Dlang does a lot of nice things (template syntax and UFCS) but shits the bed with excessive GC reliance and other weird design choices (e.g. enums)

Rust enums are awesome, on the other hand.

>and no one has made a better language yet.
define better

it takes a lot of work to make C++ fast, not to speak of initial investment in learning

>> static linking by default
>You can fuck right off with this one. That's some stupid shit right there.


yeah let's make programs that download redistr bloatcrap for a millionth time to the end user to save a few MB from the executable that's a great idea.

is this a reference to int 0x80?

delete this;

Thank you. I don't trust languages with automatic types. Is this number an int, unsigned int, or maybe long? Oh. It's float.

What are you talking about?

Daily reminder all Rust threads on Sup Forums are made by shills paid by mozilla to get their language some real world usage. Ignore them at all costs.

this.

bait with some effort.
bravo

Rust is meh at best.
default immutability is nice.

but that entire borrow system can go and fuck itself.
that thing is more a burden than an aid because you constantly need to worry about who owns it at what time.

Also, shit like `into_iter` are complete bullshit and a lame excuse for not having arrays and vectors be iterable in the first place.

and everyone just works around it by .copy ' ing the fuck out of everything to not have to bother with ownership

Good C/C++ programmers already write safe code.

>> Optional return keyword
>Very obnoxious and hurts readability.
It's an expression language. You only ever write "return" when it's an early return, which you avoid most of the time anyways. I'll bet you that 75%-80% of the for loops you'd write in Java or C++ (before became a thing) can be rephrased as 1-3 iterator methods.

>> == for equality comparison
>WHY??? FUCKING WHY??? Am I the only one who still constantly writes "if x = y" on accident even after years of programming?
Yes you are.

I am enjoying Rust a lot and I agree with a lot of your points. However one thing I'm afraid of is distrbuting Rust to other people. Rust projects commonly pull in TONS of dependencies, like 10-15 sub-dependencies if you include just a few simple dependencies. It doesn't feel as lightweight to distribute Rust sources as it is to say, send somebody a Makefile and a "src" folder.


>that thing is more a burden than an aid
I might agree. I wish I could have a lot of the upsides of Rust without having to opt into the borrow system, but I understand that it plays an important role.

>Also, shit like `into_iter` are complete bullshit and a lame excuse for not having arrays and vectors be iterable in the first place.
Those create iterators. Name me ONE language where iterators aren't separate from the thing being iterated on.

>everyone just works around it by .copy ' ing the fuck out of everything
Only clueless Rust programmers would do that. Although one of the bad things about Rust is that it requires a paradigm shift but attracts idiots who can't be bothered to learn anything beyond their Java and minor C++ knowledge.

You still have to worry about who owns what in C and C++, but the consequences are memory leaks, subtle bugs, and/or undocumented assumptions, all of which are less important during early prototyping, rather than compile-time errors that are useful during long-term maintenance. Still annoying to deal with when you know the program is currently single-threaded with no re-entrant functions, and the whole thing terminates long before it would need to free memory at all, though.
You CAN iterate over a Vec, but it consumes it in the process. You can't iterate directly over an array, but you can just write for x in &arr and it'll work again. Then there's always .iter() and .iter_mut().
Finally, it's .clone, not .copy.

You forgot
>Pattern matching
Literally godsend.

However I believe Rust's Module system is a bit weird. D's module system is simpler where every file is a package. Nice and simple.

The only reason I don't use Rust is because it's sorta difficult to get stuff done, like C itself.

I am reading through the Nim book as of now, and I am fairly confused with format proc actually.

How do you write stuff like this?
writeln("An int value: %i, and a string: %s", intval, strval);

That seems like a misfeature, why would I want to redefine an existing type half way into my code? How does this affect multiple files/modules that all redefine a type in different ways?

Wrong

If they don't write safe code, they aren't good C/C++ programmers.

No one is a good C/C++ programmer then

Well you certainly aren't

Neither are you, more certainly

I've never written C/C++ with bugs in it, you on the other hand,

Hello world programs hardly contain bugs

savage

void main()

Great, the Rust autist is going on again on way his over dependent and obtuse language has to replace C/C++ while samefagging. Great thread as always.

What is an over dependent language?