News for hackers. Stuff that matters.
Re:A Doom Renderer written in Rust by pcwalton on Sunday October 12, 2014 @12:27AM (#8444387)
They also didn't have the zero-cost memory safety abstractions that Rust has. Nor did they do much optimization.

That said, we're working on compilation speed. The focus so far has been getting the language in shape and runtime performance of the generated code, not compilation speed (although we've picked most of the low-hanging fruit in compilation speed anyway).

Re:A Doom Renderer written in Rust by cageface on Sunday October 12, 2014 @01:02AM (#8444455)
How optimistic are you that the compilation speed can be significantly increased? Are there a lot of easy optimizations available or is this just the price paid for extra compile time safety?

I'm not really a fan of Go but waiting for the compiler can be a pretty significant productivity killer on larger projects. Their fast compilation times are a pretty big selling point for what is (IMO) an otherwise underwhelming language design.

Re:A Doom Renderer written in Rust by pcwalton on Sunday October 12, 2014 @01:10AM (#8444469)
> How optimistic are you that the compilation speed can be significantly increased? Are there a lot of easy optimizations available or is this just the price paid for extra compile time safety?

The vast majority of compile time for optimized builds (80%-90%) is spent in code generation and optimization in LLVM.

For unoptimized builds, most of the compile time is spent in the typechecker doing type unifications for method lookup. With some optimizations to quickly reject method candidates I suspect this can be greatly improved.

Incremental compilation for the fast turnaround is being worked on and there has been significant progress, to address comex' complaint.

> Their fast compilation times are a pretty big selling point for what is (IMO) an otherwise underwhelming language design.

Go 6g/8g also doesn't do much optimization by comparison to GCC/LLVM. (Rust uses LLVM.)

Re:A Doom Renderer written in Rust by pjmlp on Sunday October 12, 2014 @11:48AM (#8445582)
> Go 6g/8g also doesn't do much optimization by comparison to GCC/LLVM. (Rust uses LLVM.)

You should compare with gccgo, though.

Re:A Doom Renderer written in Rust by pjmlp on Sunday October 12, 2014 @01:29AM (#8444495)
Rust compilation times can still be made faster.

Generally I think many people complain too much for what takes a few seconds.

C++ builds are measured in hours, usually require distributed build systems, clever use of forward declarations and cutting class private declarations into static code or PImpl classes to bring it down to something manageable.

Re:A Doom Renderer written in Rust by steveklabnik on Sunday October 12, 2014 @08:49AM (#8445141)
While I agree with you, I'll also say that the difference between a second or two and instant is _huge_. The Ruby world has been talking about how to get unit tests runs down for the past few years for this reason. Sub-second test suite runs are _amazing_.
Re:A Doom Renderer written in Rust by pjmlp on Sunday October 12, 2014 @10:21AM (#8445345)
I am a huge sponsor of agile, but in the enterprise world I work on, strong type checking wins over unit tests.

It is a lost battle trying to make enterprise guys to write a single line of unit tests.

Re:A Doom Renderer written in Rust by steveklabnik on Sunday October 12, 2014 @12:28PM (#8445714)
Ruby has strong type checking. ;)

Static typing vs. unit tests is a false dichotomy.

Re:A Doom Renderer written in Rust by pjmlp on Sunday October 12, 2014 @02:11PM (#8446053)
> Static typing vs. unit tests is a false dichotomy.

Not at the enterprise.

In what is now almost 30 years of dealing with computer systems. I only had the luck to work at one single company that took unit tests seriously.

All the other companies, the guys just write tests if a manager imposes them (usually only if the customer makes it a condition of payment), or they are somehow related to their performance evaluation.

Otherwise, the best you can get are integration tests at around one month before delivery date.

Ah, and agile in the enterprise is a synonym for a 3 week long mini-waterfall project.

Re:A Doom Renderer written in Rust by pjmlp on Sunday October 12, 2014 @01:02AM (#8444456)
> They also didn't have the zero-cost memory safety abstractions that Rust has.

No, but it is was better than what C and C++ have.

> Nor did they do much optimization.

I don't use them since the late 90's, but they used to be comparable to contemporary C and C++ MS-DOS/Windows compilers.

Re:A Doom Renderer written in Rust by pcwalton on Sunday October 12, 2014 @01:12AM (#8444470)
> I don't use them since the late 90's, but they used to be comparable to contemporary C and C++ MS-DOS/Windows compilers.

There has been an enormous difference in the quality of optimization and code generation since the 1990s, when single-pass compilers such as Turbo Pascal and Delphi were common. At that time you usually went straight from AST to machine code, doing some peephole optimizations along the way, but this is unacceptable today if you want to compete with modern C and C++ compilers (or even Java HotSpot). The introduction of SSA (and along with it GVN, SROA, SCCP, etc.) was a big deal.

Re:A Doom Renderer written in Rust by pjmlp on Sunday October 12, 2014 @01:23AM (#8444487)
I am aware of it.

What I was trying to say, it that if you put a C or C++ compiler against Turbo Pascal or Delphi compiler of the same age, the latter will compile way faster and generate similar code in terms of quality.

If they had received the same investment as C and C++ had become since those days, the situation would still hold.

But history took another path, so it is kind of moot point now.