Congratulations to the Rust team! Can't wait to start learning the language and building stuff using it. I'm looking to learn about how Rust's refcounting memory management works (and how it differs from how, e.g. Objective-C or Swift's runtime-based reference counting works), mostly for personal edification. Can anyone point me to any good resources?
Is worth noting that you don't reach for reference counting by default in Rust: your reach for references, then boxes, THEN Arc. You can find documentation on these types here: http://doc.rust-lang.org/guide-pointers.html
The Road to Rust 1.0
81–90 of 248 posts
Re: The Road to Rust 1.0
#82Earlier quoted context omitted.
Fully typed function signatures form a kind of contract you can program against. Haskell and other extremely strongly typed languages can infer the types of function parameters, yet the community still agrees it is good practice to annotate your work.
Would Haskell be better off if the compiler enforced this community agreement, instead of letting users decide? Also, the type annotations can be added on later. While you work and play with ideas, leave everything unannotated. After it's cemented and perhaps refactored a bit, add the "contract". In Rust, even while working things out, the user has to figure out and jot down the types.
Re: The Road to Rust 1.0
#83Earlier quoted context omitted.
Nix was brought up during the discussion that led to Cargo, but no Windows support is a deal breaker.
I would probably make the same decision, but I hope in the end Caro is easy to wrap with Nix, which is a breath of fresh air particularly when needing to mix dependencies that cross language boundaries and share those build recipes with a team. Previously, I wrote shell scripts and worried whether everyone on the team had rsync installed, or xmlstarlet, or some other less common tool. Now I wrap those scripts in a Ni…
That said, the reason that you want it to do the installation is that a lockfile is supposed to represent the way to do a build successfully. Without building everything, you can't actually be sure that the lockfile is correct. In theory, it should be...
Re: The Road to Rust 1.0
#84Earlier quoted context omitted.
I think things have changed :) Steve Klabnik has been doing a ton of work on the docs, and that has brought a lot of "coming from an HLL" perspective to them.
Hm, I learned it more than a year ago now (and have kept up), so it was before Steve's time :) Also, I'm coming mainly from a C background, not higher-level language.
Re: The Road to Rust 1.0
#85I haven't looked at Rust, but it seems from the outside that releasing a stable version of a language every six weeks is very aggresive?
Re: The Road to Rust 1.0
#86Earlier quoted context omitted.
Nope. We're pretty sure they'll be backwards compatible, and there are too many other outstanding issues (eg, syntax) and too little time. Lots of us want them though!
There isn't an RFC for them, at least that I could find. Have they just not gotten that far in terms of thought?
Re: The Road to Rust 1.0
#87Earlier quoted context omitted.
Nope. We're pretty sure they'll be backwards compatible, and there are too many other outstanding issues (eg, syntax) and too little time. Lots of us want them though!
There isn't an RFC for them, at least that I could find. Have they just not gotten that far in terms of thought?
Re: The Road to Rust 1.0
#88Earlier quoted context omitted.
> Curious to hear more about language-specific (though OS-agnostic!) package management systems. As far as I can tell, one of the main justifications for most language package management systems is "we also run on Windows/OSX, which has no package management, so we'll invent our own". As a result, users of systems that do have sane package management get stuck with multiple package management systems, one for the dis…
The other justification is generally a clash of cultures: the people who maintain distro/OS package managers generally come out of the culture of sysadmins, who value stability over feature-richness, while the people working the language communities generally come out of the culture of developers, whose priorities are the exact opposite. When languages try to hook into existing OS-level systems, the people on the lan…
Re: The Road to Rust 1.0
#89Earlier quoted context omitted.
Even in languages with whole-program inference, it's generally regarded as best practice to write out the types of your functions, hence Rust's choice here. You're right that there's a tradeoff. In general, Rust follows 'explicit over implicit.' > This gets annoying when you get into functions with complex arguments. Have you seen the where clauses yet? This should significantly help complex function declarations.
I just don't understand why there has to be a tradeoff. I just don't get why the compiler should decide on such a large thing, instead of letting the programmer do it. One can always be more explicit if one feels they're getting value from it. If someone wants to write a bunch of terse code, why stop them? Does the compiler gain a large benefit from not having to include this feature? Who loses by allowing users to d…
fn fubar(x: uint) {
let times = |n| x * n;
println!("{} * 5 = {}", x, times(5));
}
Rust only enforces type annotations on top-level functions.> Does the compiler gain a large benefit from not having to include this feature? Who loses by allowing users to do what they want?
FWIW, I feel precisely the opposite as you. I'd rather have an ecosystem of code where top level functions must be annotated by types than an ecosystem where types are there only if the author feels like adding them. There is a small cost but a large gain, IMO.
Re: The Road to Rust 1.0
#90Earlier quoted context omitted.
Nope. We're pretty sure they'll be backwards compatible, and there are too many other outstanding issues (eg, syntax) and too little time. Lots of us want them though!
There isn't an RFC for them, at least that I could find. Have they just not gotten that far in terms of thought?