News for hackers. Stuff that matters.
Re:Two Weeks of Rust by pcwalton on Tuesday January 12, 2016 @12:37PM (#10888856)
> * It's not always that you have internet connection when building your code.

Cargo does not require this.

> * It's not always that you have access to the website code is downloaded from (websites break, and companies have different policies about internet), and even if you do, you don't always have it direct (e.g. proxy).

Supporting local proxies is on the Cargo roadmap.

> Compare this to Rust compiler: you start with nothing but C(++? I don't remember) compiler, and end with Rust compiler. No intermediate download involved.

This is incorrect. Rust has been self-hosting for years. Before it was bootstrapping, it was written in OCaml.

> It's not invalid, quite the contrary. It's just Cargo doesn't boostrap itself out of clean code. It's that simple. I wouldn't have as big problem with it if its build process produced an intermediate, crippled Cargo binary.

Cargo is basically just part of the Rust compiler. Rust needs Rust to bootstrap itself, like tons of other languages. So Cargo needs Cargo to bootstrap itself. This really isn't a problem.

The fact that you didn't even know that Rust is self-hosted is proof that it really doesn't matter to the user—it was so invisible you didn't notice it!

Re:Two Weeks of Rust by nickpsecurity on Tuesday January 12, 2016 @02:57PM (#10889899)
"Before it was bootstrapping, it was written in OCaml."

That's been my exact recommendation for getting compilers started in robust way. You people keep surprising me in pleasant ways. :)

Curious, did Ocaml's clean syntax and ease of decomposing functions make the transition to Rust easier vs a language like C++ or Java? I predicted ML languages should have that benefit but I couldn't test it on small projects.

Re:Two Weeks of Rust by pjmlp on Wednesday January 13, 2016 @03:21AM (#10892991)
Back when I was in the university (90's), Lisp, Prolog and Caml Light (OCaml's percursor) were forbidden to be chosen in compiler design classes, although we used them a lot in other classes.

The reasoning for the rule, was that they made our compiler assignments too easy.

On my case, we ended up using the recently introduced Java with JavaCC and NASM macros for the generated bytecode.

Nowadays I would only use something like C++ for the runtime library, or reuse of existing tools, e.g. LLVM.

Re:Two Weeks of Rust by nickpsecurity on Wednesday January 13, 2016 @11:51AM (#10895645)
That's so funny. More support for my recommendation. Since you mentioned it, my main recommendation today if someone wants to get somewhere is to use Ocaml but target LLVM. I'd like to see LLVM re-implemented in Ocaml and parallel developed. Doubt that will happen but using Ocaml to generate LLVM code seems quite doable.
Re:Two Weeks of Rust by dozzie on Tuesday January 12, 2016 @01:06PM (#10889093)
>> Compare this to Rust compiler: you start with nothing but C(++? I don't remember) compiler, and end with Rust compiler. No intermediate download involved.

> This is incorrect. Rust has been self-hosting for years.

Incorrect in that Rust actually downloads something, as steveklabnik pointed. I admit that I expected more from Rust, and I feel disappointed the same with the compiler as with Cargo.

But your premise that self-hosted language automatically means that bootstrapping can't be done using C or C++ is false. Compare that with OCaml and GHC.

> The fact that you didn't even know that Rust is self-hosted is proof that it really doesn't matter to the user—it was so invisible you didn't notice it!

It could be tried to read as that, if it was a fact. I did expect Rust to be self-hosted, just it is a custom that bootstrapping compiler is written in something else.

Look at how OCaml or GHC (Haskell) are built. Both allow to use C compiler to compile them (even though they generally advise to use pre-compiled compilers).

Re:Two Weeks of Rust by pcwalton on Tuesday January 12, 2016 @01:15PM (#10889187)
> Both allow to use C compiler to compile them (even though they generally advise to use pre-compiled compilers).

How many people actually do this, though?

We had this conversation early on in Rust's life and the consensus was that we could make a non-bootstrapping compiler in theory, but that'd be asking us to do a huge amount of work (writing a separate compiler!) for something that very few people are going to use in practice. There are so many more important things that we could be (and are) working on than something that's basically just for purism, because most people just "apt-get install rust" or "brew install rust" and don't care how it's built.

Re:Two Weeks of Rust by dozzie on Tuesday January 12, 2016 @01:23PM (#10889243)
> How many people actually do this, though?

Enough to warrant this being kept after eight years after I've seen it for the first time.

> We had this conversation early on in Rust's life and the consensus was that we could make a non-bootstrapping compiler in theory, but that'd be asking us to do a huge amount of work (writing a separate compiler!) for something that very few people are going to use in practice.

Note that it's not necessary to have fully blown compiler. Just a subset of language would be just enough, if it allowed for compiling the compiler. And how many of the Rust features are embedded in rustc, anyway?

> There are so many more important things that we could be (and are) working on than something that's basically just for purism, because most people just "apt-get install rust" or "brew install rust" and don't care how it's built.

So you basicaly say "fuck you" to distribution developers and all the sysadmins that care about their systems, am I right?

Re:Two Weeks of Rust by burntsushi on Tuesday January 12, 2016 @01:35PM (#10889324)
> So you basicaly say "fuck you" to distribution developers and all the sysadmins that care about their systems, am I right?

Your aggression, insulting tone and condescension (throughout your comments in this thread) is not appreciated. Please stop.

Re:Two Weeks of Rust by pcwalton on Tuesday January 12, 2016 @02:10PM (#10889600)
> And how many of the Rust features are embedded in rustc, anyway?

All of them. This is not an exaggeration.

Re:Two Weeks of Rust by wtetzner on Tuesday January 12, 2016 @02:48PM (#10889833)
Where are you getting your C compiler from?