Live data from Hacker News

A 30-minute Introduction to Rust

doc.rust-lang.org

71–80 of 94 posts

Re: A 30-minute Introduction to Rust

#71

Earlier quoted context omitted.

> Perhaps my expectations would be different with a different title Hmm yes, I will think about it. Ownership is Rust's most important and unique concept, so an intro to ownership _is_ an intro to Rust. I will think about how to make this more clear.

I had no problem with the book analogy. I've been hovering around the periphery of Rust for a while, waiting until I understood the ownership thing before I move into it more seriously. Thanks for writing this! I think it was a solid step in the direction of clearly explaining ownership. I know more than I did before and I'm looking forward to reading your next piece on it. Good work.

Thank you!

The URL to watch is http://doc.rust-lang.org/guide.html . I'm working on it every day. Two more sections should land tonight, and I'm writing the next one as we speak... don't hesitate to ping me with ways the docs could be better, either on IRC, email, or just opening an issue on the repo and CC'ing me.

Re: A 30-minute Introduction to Rust

#72

Earlier quoted context omitted.

> C or C++ code bases get really brittle over time as developers forget what is actually going on This is very true. And one of the culprits is a lack of modules, an shortcoming that Rust avoids. A module system for C++ is grossly overdue, and I'm not holding my breath that one will be forthcoming.

What's your definition of a "module" that is not a class, not an object file, not a .so, and not a namespace? I'm not trying to be argumentative. I've seen this "C++ doesn't have modules" claim before, and I'm trying to get my mind around it.

Part of the reason that "modules" aren't in C++ yet is that there isn't a precise definition of what modules are or what they should be.

That being said, C++ doesn't have even the bare minimum of what would be considered a module system according to any definition. With a lot of hand waving, one should be able to more or less write:

    import std::vector;
...and have the compiler (not the preprocessor!) find the relevant declarations and definitions for std::vector. Probably also important are additional restrictions to give more control over when and how preprocessor macros affect client code.

Re: A 30-minute Introduction to Rust

#73
post #68
post #61

Earlier quoted context omitted.

"Systems programming" is a broad term, so you are painting in too-broad strokes. I'm not super familiar with Erlang, so I may get some things wrong, but heres a few differences: Erlang prefers GC, wheras Rust tends to eschew it (it's available in a library). Erlang is dynamically typed where rust is statically typed. Erlang is single-assignment where rust uses a somewhat more nuanced lifetime system (though that is s…

Are there specific implementation models or areas or systems programming that favor (or have come to use more exclusively) Rust or Erlang?

A significant one is that Rust has no GC, while Erlang does. This can matter if you're trying to build software that's very sensitive to random pauses, or embedded development.

Another significant one is that Erlang has been used to make some of the most reliable software ever for the past few decades, and Rust is still pre-1.0.

Re: A 30-minute Introduction to Rust

#74
post #68

Earlier quoted context omitted.

Are there specific implementation models or areas or systems programming that favor (or have come to use more exclusively) Rust or Erlang?

A significant one is that Rust has no GC, while Erlang does. This can matter if you're trying to build software that's very sensitive to random pauses, or embedded development. Another significant one is that Erlang has been used to make some of the most reliable software ever for the past few decades, and Rust is still pre-1.0.

I don't mean to sounds skeptic when I say this: could you list some of the software (or teams) that use Erlang?

Re: A 30-minute Introduction to Rust

#75
post #68
post #61

Earlier quoted context omitted.

"Systems programming" is a broad term, so you are painting in too-broad strokes. I'm not super familiar with Erlang, so I may get some things wrong, but heres a few differences: Erlang prefers GC, wheras Rust tends to eschew it (it's available in a library). Erlang is dynamically typed where rust is statically typed. Erlang is single-assignment where rust uses a somewhat more nuanced lifetime system (though that is s…

Are there specific implementation models or areas or systems programming that favor (or have come to use more exclusively) Rust or Erlang?

I apologize for not answering your question in this reply, but people still debate which language features are appropriate for which tasks...

My understanding is that Erlang is still primarily used in the telco industry, as it's name implies. In general Erlang shines in doing most software that would run on a server for long periods of time when interruption is expensive (it includes the ability to hot-patch running processes, for example).

Use of a GC is problematic for soft real-time systems (interestingly enough, it can become useful again in hard-real-time systems but that's too long of a tangent here). In rust you can completely ignore the GC just by choosing to not use it. The ease of getting raw-pointer access in rust also indicates places it could be used (I feel like I could write a bare-metal application in a subset of rust with a lot less work than doing so en Erlang).

It used to be that resources were so constrained that the entire OS would be written in a combination of assembler, and something slightly higher level (most commonly C, other times a reduced set of sine other high-level language). This meant that those languages were system languages. Nowadays, writing all but the kernel and drivers in something much higher level has become feasible, so the term "systems language" has blurred in meaning.

Re: A 30-minute Introduction to Rust

#76
post #74

Earlier quoted context omitted.

A significant one is that Rust has no GC, while Erlang does. This can matter if you're trying to build software that's very sensitive to random pauses, or embedded development. Another significant one is that Erlang has been used to make some of the most reliable software ever for the past few decades, and Rust is still pre-1.0.

I don't mean to sounds skeptic when I say this: could you list some of the software (or teams) that use Erlang?

An Erlang system has been created which has nine nines of uptime[1]. That is a stunning achievement.

Riak, CouchDB, RabbitMQ, and SimpleDB are written in Erlang. These are mission critical, mature projects.

[1]: http://stackoverflow.com/questions/8426897/erlangs-99-999999...

Re: A 30-minute Introduction to Rust

#77
post #76
post #74

Earlier quoted context omitted.

I don't mean to sounds skeptic when I say this: could you list some of the software (or teams) that use Erlang?

An Erlang system has been created which has nine nines of uptime[1]. That is a stunning achievement. Riak, CouchDB, RabbitMQ, and SimpleDB are written in Erlang. These are mission critical, mature projects. [1]: http://stackoverflow.com/questions/8426897/erlangs-99-999999...

Also Facebook uses Erlang it for the back-end of their messaging tool and Whatsapp uses it on the back-end as well.

Re: A 30-minute Introduction to Rust

#78
post #68
post #61

Earlier quoted context omitted.

"Systems programming" is a broad term, so you are painting in too-broad strokes. I'm not super familiar with Erlang, so I may get some things wrong, but heres a few differences: Erlang prefers GC, wheras Rust tends to eschew it (it's available in a library). Erlang is dynamically typed where rust is statically typed. Erlang is single-assignment where rust uses a somewhat more nuanced lifetime system (though that is s…

Are there specific implementation models or areas or systems programming that favor (or have come to use more exclusively) Rust or Erlang?

Erlang would not really fit the systems level programming model. Erlang runs on a VM the BEAM (Bogdan/Björn's Erlang Abstract Machine). Erlang is primarily design for back-end services to other systems. If you want a multi-node redundant system and need to do message passing to handle state and concurrency then Erlang fits that bill.

Re: A 30-minute Introduction to Rust

#79
post #68

Earlier quoted context omitted.

Are there specific implementation models or areas or systems programming that favor (or have come to use more exclusively) Rust or Erlang?

A significant one is that Rust has no GC, while Erlang does. This can matter if you're trying to build software that's very sensitive to random pauses, or embedded development. Another significant one is that Erlang has been used to make some of the most reliable software ever for the past few decades, and Rust is still pre-1.0.

Also, if you consider the user-to-engineer ratio of Whatsapp, it's theoretically the most productive language for distributed systems.

Re: A 30-minute Introduction to Rust

#80
post #75
post #68

Earlier quoted context omitted.

Are there specific implementation models or areas or systems programming that favor (or have come to use more exclusively) Rust or Erlang?

I apologize for not answering your question in this reply, but people still debate which language features are appropriate for which tasks... My understanding is that Erlang is still primarily used in the telco industry, as it's name implies. In general Erlang shines in doing most software that would run on a server for long periods of time when interruption is expensive (it includes the ability to hot-patch running…

I'd love to hear about how GCs can be useful for hard real-time systems! I was always under the impression that you needed to avoid that kind of stuff, so any links / information you have would be really interesting.
Post reply on HN