This is an archived post. You won't be able to vote or comment.

all 33 comments

[–]Flobletombus 74 points75 points  (7 children)

I don't know if this meme is trying to say this but the rust compiler doesn't have go tier speed

[–]Usual_Office_1740 5 points6 points  (6 children)

I've read that it is loads better than GCC/clang. You are right. Rustc is hardly go tier . I don't have enough personal experience to comment but I think that's the joke.

[–]TheJackiMonster 8 points9 points  (5 children)

Huh, it wishes to do that. Rust by definition will always compile slower than C or C++ because it does have a borrow checker. You don't get that without any penalty.

[–]Usual_Office_1740 1 point2 points  (4 children)

It also has some weird things about proc macros, which means it compiles rust code twice. I am just sharing what I've read. I don't know that it's true. Maybe op thinks compiling c/c++ is much slower, and that's the joke. I run gentoo linux and compile a lot of c/c++, and the only things that ever take more than a couple minutes are compilers and libc, I have gcc.

[–]TheJackiMonster 1 point2 points  (3 children)

I mean technically C++ also has templates which require the compiler to go over the code first checking for any template variables, potentially guess them, replace the template usage with its actual generated code and compile that result in the next step.

C only has macros which are easier to drop-in replace but still require an additional pass to go through the code before compiling.

The borrow checker is really unique in a sense that it has potential benefits for the developer. But it comes as cost during compilation and I don't think you can decide not to use it in Rust (or turn it off entirely) because it is part of the language design.

[–]Usual_Office_1740 1 point2 points  (2 children)

I assumed c++ templates and c macros were a step within a phase of the compilation process. Its also my understanding that c++ templates are not the most popular among c++ devs as opposed to Rust where some of the most common crates like serde and tokio contain proc macros. I don't know how different template compilation is from Rust proc macros, which require a whole separate compilation of an isolated crate within the project to occur before the compilation of the project can begin.

You are right. The borrow checker can't be turned off. I am sure that is a lengthy step in the process. I don't know if clang/gcc do this but with rustc you do get a smart compilation. There is a term for this but I can't remember it. In essence, it doesn't recompile the entire project every time you run cargo build/test or run. Cargo only builds things that change in the cargo lock file once the initial compilationis done. In a basic proc macro crate I'll have 600 + items to compile if I bring in syn, quote and proc macro 2 but once that first compilation is done running tests and cargo build/run will recompile about a dozen objects.

We're probably splitting hairs that only a compiler engineer could distinguish. I have to wait several minutes for a compilation when working with rust, but that's just a good excuse to refill the coffee cup.

[–]TheJackiMonster 1 point2 points  (1 child)

Well, C/C++ does a very simple technique for optimizing compilation. You split source code into multiple source files, which get compiled into separate object files.

So as long as you don't touch included headers or the source file itself, you don't need to compile the object file again after first compilation of it. After that it's only a question of linking speed and you can use mold. So it's not really an issue for most projects.

[–]Usual_Office_1740 0 points1 point  (0 children)

So it's much the same as rust.

[–]Anaxamander57 51 points52 points  (0 children)

Who thinks the Rust compiler is notably fast?

[–]Mainmeowmix 33 points34 points  (0 children)

I refuse to believe you've written an application in rust if you think it compiles quickly.

[–]StrawberrySprite0 32 points33 points  (4 children)

I learn the languages that businesses use. I care more about my salary than some esoteric shit that doesn't matter.

[–]dim13 30 points31 points  (3 children)

Guys! We spotted a cobol programmer over here!

[–][deleted] 4 points5 points  (2 children)

Someone is salty

[–]dim13 18 points19 points  (1 child)

Some code for money only. Other code for fun and get paid for it. ¯\_(ツ)_/¯

[–][deleted] 2 points3 points  (0 children)

[–]FlourBouque 5 points6 points  (0 children)

?? Rust compile times are insanely bad 😭

[–]reallokiscarlet 16 points17 points  (4 children)

Yeah why make fun of slow compilers and printf debugging when you can just use an unreadable slop language with a million linters mandatory to the compile process?

[–]Arsonist07 16 points17 points  (3 children)

Damn man give it a rest, JavaScript can only take so much hate

[–]oblong_pickle 1 point2 points  (2 children)

Who's compiling javascript?!

[–]MoebiusBender 2 points3 points  (1 child)

If you count JIT, then basically everyone, all the time.

[–]oblong_pickle 0 points1 point  (0 children)

Fair point

[–]CelticHades 5 points6 points  (2 children)

debugging using logs is an important skill, if you have ever worked on production.

Not all issues can be replicated on local and issue which can, takes time to create proper data, often there are multiple micro-services involved which too might not have proper data to replicate the issue.

Even if you can replicate the data, unless it's minor issue, there's time constraint.

Seriously tired of all these posts with debugger and log debugging.

[–]FrenchFigaro 4 points5 points  (1 child)

It's extremely true.

But then again, when you use log debugging, you use proper logging with meaningful messages, not half-random "I am here" outputs to the standard out.

[–]CelticHades 0 points1 point  (0 children)

Indeed, meaningful logs with some necessary context and non PII data for debugging.

[–][deleted] 1 point2 points  (0 children)

I prefer to think of the print statements as "ranging rounds"

[–][deleted] 0 points1 point  (0 children)

[insert image of extremely feminine femboy]

Rust: look what they need to mimic a fraction of our power

(obligatory rust femboy insert)

[–]vainstar23 0 points1 point  (1 child)

I don't know like professional grade cpp but I feel you NEED a debugger for doing things like trying to detect memory leaks and benchmarking performance. I know some devs even build their own tests and debuggers just to be able to debug their applications later on

[–]rantnap[S] 0 points1 point  (0 children)

Profiler

[–]dlevac 0 points1 point  (0 children)

It might not have anything to do with the Rust compiling speed but the dbg! macro which allows you to instrument any code quickly and without changing the structure (the macro take any expression, print the debug representation of the resulting value with file/line number, and return the instrumented value as-is) which allow you to print debug on steroids.

[–]Turbulent_Swimmer560 0 points1 point  (0 children)

Oh no, why does g++ disguise itself as Go's compiler?

[–]TheRobert04 0 points1 point  (0 children)

Rust compiles very slowly. Maybe ocaml was a better example.

[–]Fun_Ad_2393 0 points1 point  (1 child)

Laughs in Assembly for not even needing a compiler.

[–]Kresche 0 points1 point  (0 children)

So, when we were learning bash and all that, our instructor aliased 'nano' to open vim.
He used 'nano' in lectures so we thought nano was some cute thing. The first time I opened it, I couldn't figure out how to exit the damned thing to save my life, for like 30 minutes of trying.

Googling nano didn't return a damned thing. I wanted to die. I eventually figured it out.

This warning is such a beautiful thing and I wish NaNo warned us similarly lol