let arc = RWARC(some_data);
for num_cpus().times {
let arc2 = clone(&arc);
do task::spawn |move arc2| {
process_data(arc2); // might read, write, whatever
}
}
let modified_data = unwrap(move arc); // blocks on all child tasks at once
// do more of the algorithm, etc.
This is a nice fork/join pattern, allowing implementations with minimal copying and reasonable safety. If this is indicative of design decisions made by the creators of Rust, I think it looks pretty good.Why I think Rust is the "language of the future" for systems programming
131–140 of 193 posts
Re: Why I think Rust is the "language of the future" for systems programming
#132Earlier quoted context omitted.
Apparently it won't work yet! Tragic. In the meantime, I can deliberate on whether or not to call it FOXDIE.
Surely "Pyrite"?
For those with even less of a chemistry background than I have: rust is iron oxide, and pyrite is iron sulfide. It's a good analogy because oxygen and sulfur are in the same group (column) in the periodic table, so they have some chemical similarities.
Re: Why I think Rust is the "language of the future" for systems programming
#133Earlier quoted context omitted.
For what it's worth, I like Rust because I like Python. Python does strive to have one "obvious way to do it", but that ends up meaning it has a very colorful toolbox full of different ways to solve different problems, much like Rust. Generators, context managers, metaclasses, decorators, and descriptors are all very different mechanisms, but they all work together well. Hell, I keep discovering that Rust has already…
Would be interesting to read a comparison with D. And no, "obscure" is not a meaningful description when comparing it to a language still at v0.3.
On the Rust side, algebraic data types, an AST macro system, saner tuples, non-nullable and immutability by default. I'm a bit skeptic about the different pointer types and how they will interact with meta-programming.
On the D side, many good things like unittest(), best-in-class overloading support, compile-time everything, etc.
http://laser.inf.ethz.ch/2012/slides/Alexandrescu/2-D%20cour...
Re: Why I think Rust is the "language of the future" for systems programming
#134There's an entire website named after the results of over-using the stack. Smart pointers and move semantics in C++11 completely smoke GC and memory management everywhere else.
While I'm sure Rust is a nice language and I applaud its innovation,there's already a perfectly good wheel.
Re: Why I think Rust is the "language of the future" for systems programming
#135Earlier quoted context omitted.
There are plenty of companies who have spent millions on developing their websites, written in a variety of the languages you list as 'toy' languages, or even PHP. Whether they would have been better to use other languages is impossible to say of course, but these languages are being used for significant projects. The use of the pejorative 'toy' is not very useful, and likely to evoke emotional reactions. Go was insp…
I'm aware of what and why Go came to be, and I can easily relate to the reasons(I've read the blog post). I am by no means saying C or C++ as languages are perfect, nothing is. However, as I mentioned in my another reply to sanderdj, there's huge investment in effort for the abstractions the two languages build. It's very hard to tackle the problem of existing codebase for example, as that requires building stuff fro…
No books?
Go in Action; Evan Shaw; Manning; http://www.manning.com/shaw/
An Introduction to Programming in Go; Caleb Doxsey; http://www.golang-book.com
Network Programming with Go; Jan Newmarch; Free e-book; http://jan.newmarch.name/golang/
Programming in Go: Creating Applications for the 21st Century; Mark Summerfield; Addison-Wesley Professional; http://qtrac.eu/gobook.html
The Way To Go: A Thorough Introduction To The Go Programming Language; Ivo Balbaert; iUniverse
The Go Programming Language Phrasebook; David Chisnall; Addison-Wesley Professional
The Go Programming Language (upcoming); Brian Ketelsen; The Pragmatic Bookshelf; http://pragprog.com/book/bkgo/the-go-programming-language
Learning Go; Miek Gieben; Free e-book; http://www.miek.nl/projects/learninggo/index.html
Systemprogrammierung in Google Go: Grundlagen, Skalierbarkeit, Performanz, Sicherheit; Frank Müller; Dpunkt Verlag; http://dpunkt.de/buecher/3449.html
Programmierung in Google Go: Einstieg, Beispiele und professionelle Anwendung; Rainer Feike, Steffen Blass; Addison-Wesley
Re: Why I think Rust is the "language of the future" for systems programming
#136Earlier quoted context omitted.
Neither Mozilla nor Google are particularly keen to faff around designing languages for the hell of it. :) Google needed to ease the burden of hours-long Java/C++ compile times on massive projects. Hence Go. Mozilla needed a language that was as fast as C++, but safer and trivially parallelizable. Hence Rust. Beyond these goals, the fact that the rest of the world is excited for these languages is just gravy.
You attribute too much to these entities called "Google" and "Mozilla". They're made of people. No executive asks for a new programming language. However at some enlightened organizations, they are willing to let hackers explore radical approaches. At some point, in order for them to become "official" projects, the hackers have to align the language with the organization's goals. But the imprimatur of their creators…
All languages developed intentionally by corporations.
Additionally, there have been languages developed by committees, such as ALGOL, COBOL, CPL, Haskell, Ada, and many others.
Re: Why I think Rust is the "language of the future" for systems programming
#137Earlier quoted context omitted.
99% sure that remark is in regard to C++. If it's about java, then it's just not true...
You've obviously never compiled java at google :-)
Re: Why I think Rust is the "language of the future" for systems programming
#138Out of mild concern over the title (not that it ought to be changed, TFA doesn't really have a meaningful title), I'd like to preemptively defuse any potential flame war. Go and Rust are not really competing. There may be some overlap in domain, but they occupy different niches and will likely appeal to different crowds. Go will appeal more to people who prefer its focus on conceptual simplicity and its "opinionated"…
Re: Why I think Rust is the "language of the future" for systems programming
#139Earlier quoted context omitted.
Apparently it won't work yet! Tragic. In the meantime, I can deliberate on whether or not to call it FOXDIE.
Surely "Pyrite"?
But that pyrite hasn't been active for a long time.
Re: Why I think Rust is the "language of the future" for systems programming
#140Earlier quoted context omitted.
As languages, nothing. In design, their conservative nature.
Go is not a conservative language. A conservative language would be something like D, which is mostly a clone of C++ with a few extra features tossed in. Go is a highly opinionated language with at least three big new ideas: * goroutines for concurrency ("Don't communicate by sharing memory; share memory by communicating") * a new type system which is based on structural subtyping (some people have called this static…
You're right that Go is not conservative, though, but retro, trying to mitigate the damage done by C and C++.